Disable DbgUiIssueRemoteBreakin and switch to safe attach per default

This commit is contained in:
Duncan Ogilvie 2020-11-11 23:34:55 +01:00
parent ddfa81366e
commit 7790cc9e12
2 changed files with 5 additions and 1 deletions

View File

@ -68,7 +68,7 @@ public:
bool AttachDebugger(DWORD ProcessId, bool KillOnExit, LPVOID DebugInfo, LPVOID CallBack) bool AttachDebugger(DWORD ProcessId, bool KillOnExit, LPVOID DebugInfo, LPVOID CallBack)
{ {
if(!Attach(ProcessId, mSafeAttach ? DebugActiveProcess_ : DebugActiveProcess)) if(!Attach(ProcessId, DebugActiveProcess_))
return false; return false;
mCbATTACHBREAKPOINT = STEPCALLBACK(CallBack); mCbATTACHBREAKPOINT = STEPCALLBACK(CallBack);
mAttachProcessInfo = (PROCESS_INFORMATION*)DebugInfo; mAttachProcessInfo = (PROCESS_INFORMATION*)DebugInfo;

View File

@ -130,6 +130,9 @@ static NTSTATUS NTAPI DbgUiDebugActiveProcess_(IN HANDLE Process)
{ {
/* Tell the kernel to start debugging */ /* Tell the kernel to start debugging */
NTSTATUS Status = NtDebugActiveProcess(Process, NtCurrentTeb()->DbgSsReserved[1]); NTSTATUS Status = NtDebugActiveProcess(Process, NtCurrentTeb()->DbgSsReserved[1]);
return Status;
#if 0
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
/* Now break-in the process */ /* Now break-in the process */
@ -140,6 +143,7 @@ static NTSTATUS NTAPI DbgUiDebugActiveProcess_(IN HANDLE Process)
DbgUiStopDebugging(Process); DbgUiStopDebugging(Process);
} }
} }
#endif
/* Return status */ /* Return status */
return Status; return Status;