mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-23 02:42:09 +00:00
dmnt-cheat: update frozen address values on write
This commit is contained in:
parent
e5bedd52ac
commit
18e4d80073
1 changed files with 11 additions and 1 deletions
|
@ -104,7 +104,17 @@ Result DmntCheatManager::ReadCheatProcessMemoryForVm(u64 proc_addr, void *out_da
|
|||
|
||||
Result DmntCheatManager::WriteCheatProcessMemoryForVm(u64 proc_addr, const void *data, size_t size) {
|
||||
if (HasActiveCheatProcess()) {
|
||||
return svcWriteDebugProcessMemory(g_cheat_process_debug_hnd, data, proc_addr, size);
|
||||
Result rc = svcWriteDebugProcessMemory(g_cheat_process_debug_hnd, data, proc_addr, size);
|
||||
|
||||
/* We might have a frozen address. Update it if we do! */
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
auto it = g_frozen_addresses_map.find(proc_addr);
|
||||
if (it != g_frozen_addresses_map.end()) {
|
||||
memcpy(&it->second.value, data, size < sizeof(it->second.value) ? size : sizeof(it->second.value));
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
return ResultDmntCheatNotAttached;
|
||||
|
|
Loading…
Reference in a new issue