mirror of https://github.com/x64dbg/TitanEngine
remove singleshoot breakpoints before the breakpoint callback
This commit is contained in:
parent
7726d8fcf1
commit
fe91cd08b4
|
|
@ -558,8 +558,17 @@ __declspec(dllexport) void TITCALL DebugLoop()
|
||||||
char* DisassembledString = (char*)StaticDisassembleEx(ueCurrentPosition, (LPVOID)instr);
|
char* DisassembledString = (char*)StaticDisassembleEx(ueCurrentPosition, (LPVOID)instr);
|
||||||
if(strstr(DisassembledString, "PUSHF"))
|
if(strstr(DisassembledString, "PUSHF"))
|
||||||
PushfBPX = true;
|
PushfBPX = true;
|
||||||
myCustomBreakPoint = (fCustomBreakPoint)((LPVOID)FoundBreakPoint.ExecuteCallBack);
|
|
||||||
|
if(FoundBreakPoint.BreakPointType == UE_SINGLESHOOT)
|
||||||
|
{
|
||||||
|
DeleteBPX((ULONG_PTR)FoundBreakPoint.BreakPointAddress);
|
||||||
|
ResetBPXSize = FoundBreakPoint.BreakPointSize - 1;
|
||||||
|
ResetBPXAddressTo = NULL;
|
||||||
|
ResetBPX = false;
|
||||||
|
}
|
||||||
|
|
||||||
//execute callback
|
//execute callback
|
||||||
|
myCustomBreakPoint = (fCustomBreakPoint)((LPVOID)FoundBreakPoint.ExecuteCallBack);
|
||||||
__try
|
__try
|
||||||
{
|
{
|
||||||
myCustomBreakPoint();
|
myCustomBreakPoint();
|
||||||
|
|
@ -568,6 +577,7 @@ __declspec(dllexport) void TITCALL DebugLoop()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(FoundBreakPoint.BreakPointType != UE_SINGLESHOOT)
|
if(FoundBreakPoint.BreakPointType != UE_SINGLESHOOT)
|
||||||
{
|
{
|
||||||
DisableBPX((ULONG_PTR)FoundBreakPoint.BreakPointAddress);
|
DisableBPX((ULONG_PTR)FoundBreakPoint.BreakPointAddress);
|
||||||
|
|
@ -575,13 +585,6 @@ __declspec(dllexport) void TITCALL DebugLoop()
|
||||||
ResetBPXAddressTo = (ULONG_PTR)FoundBreakPoint.BreakPointAddress;
|
ResetBPXAddressTo = (ULONG_PTR)FoundBreakPoint.BreakPointAddress;
|
||||||
ResetBPX = true;
|
ResetBPX = true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
DeleteBPX((ULONG_PTR)FoundBreakPoint.BreakPointAddress);
|
|
||||||
ResetBPXSize = FoundBreakPoint.BreakPointSize - 1;
|
|
||||||
ResetBPXAddressTo = NULL;
|
|
||||||
ResetBPX = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
VirtualProtectEx(dbgProcessInformation.hProcess, (LPVOID)FoundBreakPoint.BreakPointAddress, FoundBreakPoint.BreakPointSize, OldProtect, &OldProtect);
|
VirtualProtectEx(dbgProcessInformation.hProcess, (LPVOID)FoundBreakPoint.BreakPointAddress, FoundBreakPoint.BreakPointSize, OldProtect, &OldProtect);
|
||||||
|
|
@ -1180,8 +1183,17 @@ __declspec(dllexport) void TITCALL DebugLoop()
|
||||||
SetThreadContext(hActiveThread, &myDBGContext);
|
SetThreadContext(hActiveThread, &myDBGContext);
|
||||||
EngineCloseHandle(hActiveThread);
|
EngineCloseHandle(hActiveThread);
|
||||||
VirtualProtectEx(dbgProcessInformation.hProcess, (LPVOID)FoundBreakPoint.BreakPointAddress, FoundBreakPoint.BreakPointSize, OldProtect, &OldProtect);
|
VirtualProtectEx(dbgProcessInformation.hProcess, (LPVOID)FoundBreakPoint.BreakPointAddress, FoundBreakPoint.BreakPointSize, OldProtect, &OldProtect);
|
||||||
myCustomBreakPoint = (fCustomBreakPoint)((LPVOID)FoundBreakPoint.ExecuteCallBack);
|
|
||||||
|
if(FoundBreakPoint.BreakPointType == UE_SINGLESHOOT)
|
||||||
|
{
|
||||||
|
DeleteBPX((ULONG_PTR)FoundBreakPoint.BreakPointAddress);
|
||||||
|
ResetBPXSize = FoundBreakPoint.BreakPointSize - 1;
|
||||||
|
ResetBPXAddressTo = NULL;
|
||||||
|
ResetBPX = false;
|
||||||
|
}
|
||||||
|
|
||||||
//execute callback
|
//execute callback
|
||||||
|
myCustomBreakPoint = (fCustomBreakPoint)((LPVOID)FoundBreakPoint.ExecuteCallBack);
|
||||||
__try
|
__try
|
||||||
{
|
{
|
||||||
myCustomBreakPoint();
|
myCustomBreakPoint();
|
||||||
|
|
@ -1190,6 +1202,7 @@ __declspec(dllexport) void TITCALL DebugLoop()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(FoundBreakPoint.BreakPointType != UE_SINGLESHOOT)
|
if(FoundBreakPoint.BreakPointType != UE_SINGLESHOOT)
|
||||||
{
|
{
|
||||||
DisableBPX((ULONG_PTR)FoundBreakPoint.BreakPointAddress);
|
DisableBPX((ULONG_PTR)FoundBreakPoint.BreakPointAddress);
|
||||||
|
|
@ -1197,13 +1210,6 @@ __declspec(dllexport) void TITCALL DebugLoop()
|
||||||
ResetBPXAddressTo = (ULONG_PTR)FoundBreakPoint.BreakPointAddress;
|
ResetBPXAddressTo = (ULONG_PTR)FoundBreakPoint.BreakPointAddress;
|
||||||
ResetBPX = true;
|
ResetBPX = true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
DeleteBPX((ULONG_PTR)FoundBreakPoint.BreakPointAddress);
|
|
||||||
ResetBPXSize = FoundBreakPoint.BreakPointSize - 1;
|
|
||||||
ResetBPXAddressTo = NULL;
|
|
||||||
ResetBPX = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
VirtualProtectEx(dbgProcessInformation.hProcess, (LPVOID)FoundBreakPoint.BreakPointAddress, FoundBreakPoint.BreakPointSize, OldProtect, &OldProtect);
|
VirtualProtectEx(dbgProcessInformation.hProcess, (LPVOID)FoundBreakPoint.BreakPointAddress, FoundBreakPoint.BreakPointSize, OldProtect, &OldProtect);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue