1
0
Fork 0

DBG: improve the skipInt3Stepping feature to work for long int3 instructions

This commit is contained in:
Duncan Ogilvie 2018-11-18 15:49:43 +01:00
parent 49f5780935
commit 418541e46e
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 5 additions and 4 deletions

View File

@ -19,12 +19,13 @@
static bool skipInt3Stepping(int argc, char* argv[])
{
if(!bSkipInt3Stepping || dbgisrunning())
if(!bSkipInt3Stepping || dbgisrunning() || getLastExceptionInfo().ExceptionRecord.ExceptionCode != EXCEPTION_BREAKPOINT)
return false;
duint cip = GetContextDataEx(hActiveThread, UE_CIP);
unsigned char ch;
MemRead(cip, &ch, sizeof(ch));
if(ch == 0xCC && getLastExceptionInfo().ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT)
unsigned char data[MAX_DISASM_BUFFER];
MemRead(cip, data, sizeof(data));
Zydis zydis;
if(zydis.Disassemble(cip, data) && zydis.IsInt3())
{
//Don't allow skipping of multiple consecutive INT3 instructions
getLastExceptionInfo().ExceptionRecord.ExceptionCode = 0;