1
0
Fork 0

DBG: fixed some small bugs in restoreRange + added PatchRestore

This commit is contained in:
Mr. eXoDia 2014-07-06 04:12:32 +02:00
parent 8bef2cef39
commit 41adaf539f
2 changed files with 10 additions and 1 deletions

View File

@ -78,6 +78,12 @@ static void _patchrestorerange(duint start, duint end)
}
for(duint i=start; i<end+1; i++)
patchdel(i, true);
GuiUpdatePatches();
}
static bool _patchrestore(duint addr)
{
return patchdel(addr, true);
}
void dbgfunctionsinit()
@ -94,4 +100,5 @@ void dbgfunctionsinit()
_dbgfunctions.MemPatch=_mempatch;
_dbgfunctions.PatchRestoreRange=_patchrestorerange;
_dbgfunctions.PatchEnum=(PATCHENUM)patchenum;
_dbgfunctions.PatchRestore=_patchrestore;
}

View File

@ -4,7 +4,7 @@
struct DBGPATCHINFO
{
char mod[MAX_MODULE_SIZE];
uint addr;
duint addr;
unsigned char oldbyte;
unsigned char newbyte;
};
@ -21,6 +21,7 @@ typedef bool (*PATCHINRANGE)(duint start, duint end);
typedef bool (*MEMPATCH)(duint va, const unsigned char* src, duint size);
typedef void (*PATCHRESTORERANGE)(duint start, duint end);
typedef bool (*PATCHENUM)(DBGPATCHINFO* patchinfo, size_t* cbsize);
typedef bool (*PATCHRESTORE)(duint addr);
struct DBGFUNCTIONS
{
@ -36,6 +37,7 @@ struct DBGFUNCTIONS
MEMPATCH MemPatch;
PATCHRESTORERANGE PatchRestoreRange;
PATCHENUM PatchEnum;
PATCHRESTORE PatchRestore;
};
#ifdef BUILD_DBG