mirror of https://github.com/x64dbg/TitanEngine
Fix debug event timeout feature + add extra check if the debuggee was terminated
Details: https://github.com/x64dbg/x64dbg/issues/2087
This commit is contained in:
parent
50c0d90fcb
commit
7ad288f30e
|
|
@ -77,7 +77,23 @@ __declspec(dllexport) void TITCALL DebugLoop()
|
||||||
|
|
||||||
while(!BreakDBG) //actual debug loop
|
while(!BreakDBG) //actual debug loop
|
||||||
{
|
{
|
||||||
WaitForDebugEvent(&DBGEvent, engineWaitForDebugEventTimeOut);
|
// Fix based on work by https://github.com/number201724
|
||||||
|
if(!WaitForDebugEvent(&DBGEvent, engineWaitForDebugEventTimeOut))
|
||||||
|
{
|
||||||
|
if(WaitForSingleObject(dbgProcessInformation.hProcess, 0) == WAIT_OBJECT_0)
|
||||||
|
{
|
||||||
|
DBGEvent.dwDebugEventCode = EXIT_PROCESS_DEBUG_EVENT;
|
||||||
|
DBGEvent.dwProcessId = dbgProcessInformation.dwProcessId;
|
||||||
|
DBGEvent.dwThreadId = dbgProcessInformation.dwThreadId;
|
||||||
|
if(!GetExitCodeProcess(dbgProcessInformation.hProcess, &DBGEvent.u.ExitProcess.dwExitCode))
|
||||||
|
DBGEvent.u.ExitProcess.dwExitCode = 0xFFFFFFFF;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(engineExecutePluginCallBack)
|
if(engineExecutePluginCallBack)
|
||||||
{
|
{
|
||||||
ExtensionManagerPluginDebugCallBack(&DBGEvent, UE_PLUGIN_CALL_REASON_EXCEPTION);
|
ExtensionManagerPluginDebugCallBack(&DBGEvent, UE_PLUGIN_CALL_REASON_EXCEPTION);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue