Make SafeAttach the default

This commit is contained in:
Duncan Ogilvie 2020-11-12 04:58:15 +01:00
parent 2447a299c8
commit 0a1c3236b8
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 3 additions and 3 deletions

View File

@ -522,7 +522,7 @@ __declspec(dllexport) void TITCALL DebugLoop()
} }
else //breakpoint not in list else //breakpoint not in list
{ {
if(!FirstBPX) //program generated a breakpoint exception if(DebugAttachedToProcess || !FirstBPX) //program generated a breakpoint exception
{ {
DBGCode = DBG_EXCEPTION_NOT_HANDLED; DBGCode = DBG_EXCEPTION_NOT_HANDLED;
if(DBGCustomHandler->chBreakPoint != NULL) if(DBGCustomHandler->chBreakPoint != NULL)

View File

@ -547,13 +547,13 @@ __declspec(dllexport) bool TITCALL AttachDebugger(DWORD ProcessId, bool KillOnEx
EngineSetDebugPrivilege(GetCurrentProcess(), true); EngineSetDebugPrivilege(GetCurrentProcess(), true);
DebugRemoveDebugPrivilege = true; DebugRemoveDebugPrivilege = true;
} }
if((engineSafeAttach ? DebugActiveProcess_ : DebugActiveProcess)(ProcessId)) if(DebugActiveProcess_(ProcessId))
{ {
funcDebugSetProcessKillOnExit = GetProcAddress(GetModuleHandleA("kernel32.dll"), "DebugSetProcessKillOnExit"); funcDebugSetProcessKillOnExit = GetProcAddress(GetModuleHandleA("kernel32.dll"), "DebugSetProcessKillOnExit");
if(funcDebugSetProcessKillOnExit != NULL) if(funcDebugSetProcessKillOnExit != NULL)
{ {
myDebugSetProcessKillOnExit = (fDebugSetProcessKillOnExit)(funcDebugSetProcessKillOnExit); myDebugSetProcessKillOnExit = (fDebugSetProcessKillOnExit)(funcDebugSetProcessKillOnExit);
myDebugSetProcessKillOnExit(KillOnExit && !engineSafeAttach ? true : false); myDebugSetProcessKillOnExit(KillOnExit);
} }
DebugDebuggingDLL = false; DebugDebuggingDLL = false;
DebugAttachedToProcess = true; DebugAttachedToProcess = true;