DBG: apply patches on every memory change
This commit is contained in:
parent
284d078950
commit
441c895cf0
|
@ -60,9 +60,10 @@ bool assembleat(uint addr, const char* instruction, char* error, bool fillnop)
|
|||
unsigned char nops[16];
|
||||
memset(nops, 0x90, sizeof(nops));
|
||||
|
||||
bool ret=memwrite(fdProcessInfo->hProcess, (void*)addr, dest, destSize, 0);
|
||||
bool ret=mempatch(fdProcessInfo->hProcess, (void*)addr, dest, destSize, 0);
|
||||
if(ret && fillnop && nopsize)
|
||||
if(!memwrite(fdProcessInfo->hProcess, (void*)(addr+destSize), nops, nopsize, 0))
|
||||
if(!mempatch(fdProcessInfo->hProcess, (void*)(addr+destSize), nops, nopsize, 0))
|
||||
ret=false;
|
||||
GuiUpdatePatches();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -968,7 +968,7 @@ CMDRESULT cbInstrCopystr(int argc, char* argv[])
|
|||
dprintf("invalid address \"%s\"!\n", argv[1]);
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
if(!memwrite(fdProcessInfo->hProcess, (void*)addr, string, strlen(string), 0))
|
||||
if(!mempatch(fdProcessInfo->hProcess, (void*)addr, string, strlen(string), 0))
|
||||
{
|
||||
efree(string, "cbInstrCopystr:string");
|
||||
dputs("memwrite failed!");
|
||||
|
@ -977,6 +977,7 @@ CMDRESULT cbInstrCopystr(int argc, char* argv[])
|
|||
efree(string, "cbInstrCopystr:string");
|
||||
dputs("string written!");
|
||||
GuiUpdateAllViews();
|
||||
GuiUpdatePatches();
|
||||
return STATUS_CONTINUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1413,13 +1413,14 @@ bool valtostring(const char* string, uint* value, bool silent)
|
|||
return false;
|
||||
}
|
||||
efree(newstring, "valfromstring::newstring");
|
||||
if(!memwrite(fdProcessInfo->hProcess, (void*)temp, value, read_size, 0))
|
||||
if(!mempatch(fdProcessInfo->hProcess, (void*)temp, value, read_size, 0))
|
||||
{
|
||||
if(!silent)
|
||||
dputs("failed to write memory");
|
||||
return false;
|
||||
}
|
||||
GuiUpdateAllViews(); //repaint gui
|
||||
GuiUpdatePatches(); //update patch dialog
|
||||
return true;
|
||||
}
|
||||
else if(isregister(string)) //register
|
||||
|
|
Loading…
Reference in New Issue