mirror of https://github.com/x64dbg/TitanEngine
fixed detection when stepping over 'pop ss, pushfd/q' (thanks to firelegend for reporting)
This commit is contained in:
parent
a6a093760a
commit
a815753c52
|
|
@ -50,12 +50,18 @@ __declspec(dllexport) void TITCALL ForceClose()
|
|||
__declspec(dllexport) void TITCALL StepInto(LPVOID StepCallBack)
|
||||
{
|
||||
ULONG_PTR ueCurrentPosition = GetContextData(UE_CIP);
|
||||
unsigned char instr[16];
|
||||
unsigned char instr[32]; //two instructions
|
||||
MemoryReadSafe(dbgProcessInformation.hProcess, (void*)ueCurrentPosition, instr, sizeof(instr), 0);
|
||||
char* DisassembledString = (char*)StaticDisassembleEx(ueCurrentPosition, (LPVOID)instr);
|
||||
if(strstr(DisassembledString, "PUSHF"))
|
||||
StepOver(StepCallBack);
|
||||
else
|
||||
{
|
||||
int len = StaticLengthDisassemble((LPVOID)instr);
|
||||
DisassembledString = (char*)StaticDisassembleEx(ueCurrentPosition + len, (LPVOID)(instr + len));
|
||||
if(strstr(DisassembledString, "PUSHF")) //we wanna land on PUSHF safely (to prevent 'PUSH SS, POP SS' problems
|
||||
SetBPX(ueCurrentPosition + len, UE_BREAKPOINT_TYPE_INT3 + UE_SINGLESHOOT, StepCallBack);
|
||||
else
|
||||
{
|
||||
ULONG_PTR ueContext = NULL;
|
||||
ueContext = (ULONG_PTR)GetContextData(UE_EFLAGS);
|
||||
|
|
@ -66,6 +72,7 @@ __declspec(dllexport) void TITCALL StepInto(LPVOID StepCallBack)
|
|||
engineStepCount = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(dllexport) void TITCALL StepOver(LPVOID StepCallBack)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue