1
0
Fork 0

DBG: not not force RIP to the ExceptionAddress for EXCEPTION_BREAKPOINT

This commit is contained in:
Duncan Ogilvie 2020-04-28 00:25:04 +02:00
parent 0763064b70
commit 1d5766e8bc
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 4 additions and 5 deletions

View File

@ -21,16 +21,16 @@ static bool skipInt3Stepping(int argc, char* argv[])
{
if(!bSkipInt3Stepping || dbgisrunning() || getLastExceptionInfo().ExceptionRecord.ExceptionCode != EXCEPTION_BREAKPOINT)
return false;
duint cip = GetContextDataEx(hActiveThread, UE_CIP);
auto exceptionAddress = (duint)getLastExceptionInfo().ExceptionRecord.ExceptionAddress;
unsigned char data[MAX_DISASM_BUFFER];
MemRead(cip, data, sizeof(data));
MemRead(exceptionAddress, data, sizeof(data));
Zydis zydis;
if(zydis.Disassemble(cip, data) && zydis.IsInt3())
if(zydis.Disassemble(exceptionAddress, data) && zydis.IsInt3())
{
//Don't allow skipping of multiple consecutive INT3 instructions
getLastExceptionInfo().ExceptionRecord.ExceptionCode = 0;
dputs(QT_TRANSLATE_NOOP("DBG", "Skipped INT3!"));
cbDebugSkip(1, argv);
cbDebugContinue(1, argv);
return true;
}
return false;

View File

@ -1916,7 +1916,6 @@ static void cbException(EXCEPTION_DEBUG_INFO* ExceptionData)
_dbg_animatestop(); // Stop animating
return;
}
SetContextDataEx(hActiveThread, UE_CIP, (duint)ExceptionData->ExceptionRecord.ExceptionAddress);
}
else if(ExceptionData->ExceptionRecord.ExceptionCode == MS_VC_EXCEPTION) //SetThreadName exception
{