Skip to content

Commit 490ce02

Browse files
committed
Also implement x64dbg#14 for UD2 breakpoints
1 parent b862c2b commit 490ce02

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

TitanEngine/TitanEngine.Debugger.DebugLoop.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,16 @@ __declspec(dllexport) void TITCALL DebugLoop()
13171317
ResetBPXAddressTo = NULL;
13181318
ResetBPX = false;
13191319
}
1320+
else
1321+
{
1322+
// if the current instruction pushes the flags, erase the trap flag from the stack after its execution
1323+
ULONG_PTR ueCurrentPosition = FoundBreakPoint.BreakPointAddress;
1324+
unsigned char instr[16];
1325+
MemoryReadSafe(dbgProcessInformation.hProcess, (void*)ueCurrentPosition, instr, sizeof(instr), 0);
1326+
char* DisassembledString = (char*)StaticDisassembleEx(ueCurrentPosition, (LPVOID)instr);
1327+
if(strstr(DisassembledString, "PUSHF"))
1328+
PushfBPX = true;
1329+
}
13201330

13211331
//execute callback
13221332
myCustomBreakPoint = (fCustomBreakPoint)((LPVOID)FoundBreakPoint.ExecuteCallBack);

0 commit comments

Comments
 (0)