Also implement #14 for UD2 breakpoints

This commit is contained in:
Duncan Ogilvie 2023-07-08 12:50:02 +02:00
parent b862c2b36f
commit 490ce02fb3
1 changed files with 10 additions and 0 deletions

View File

@ -1317,6 +1317,16 @@ __declspec(dllexport) void TITCALL DebugLoop()
ResetBPXAddressTo = NULL; ResetBPXAddressTo = NULL;
ResetBPX = false; ResetBPX = false;
} }
else
{
// if the current instruction pushes the flags, erase the trap flag from the stack after its execution
ULONG_PTR ueCurrentPosition = FoundBreakPoint.BreakPointAddress;
unsigned char instr[16];
MemoryReadSafe(dbgProcessInformation.hProcess, (void*)ueCurrentPosition, instr, sizeof(instr), 0);
char* DisassembledString = (char*)StaticDisassembleEx(ueCurrentPosition, (LPVOID)instr);
if(strstr(DisassembledString, "PUSHF"))
PushfBPX = true;
}
//execute callback //execute callback
myCustomBreakPoint = (fCustomBreakPoint)((LPVOID)FoundBreakPoint.ExecuteCallBack); myCustomBreakPoint = (fCustomBreakPoint)((LPVOID)FoundBreakPoint.ExecuteCallBack);