MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / HookDbgSys

Method HookDbgSys

KernelLibrary/kDbgUtil.cpp:57–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57bool kDbgUtil::HookDbgSys() {
58 if (g_pNtCreateDebugObject) {
59 NTSTATUS status = DetourAttach((PVOID*)&g_pNtCreateDebugObject, NtCreateDebugObject);
60 if (!NT_SUCCESS(status))
61 return false;
62 status = DetourTransactionCommit();
63 if (!NT_SUCCESS(status))
64 return false;
65 }
66 if (g_pNtDebugActiveProcess) {
67 NTSTATUS status = DetourAttach((PVOID*)&g_pNtDebugActiveProcess, NtDebugActiveProcess);
68 if (!NT_SUCCESS(status))
69 return false;
70 status = DetourTransactionCommit();
71 if (!NT_SUCCESS(status))
72 return false;
73 }
74 return true;
75}
76
77bool kDbgUtil::UnhookDbgSys() {
78 NTSTATUS status = DetourDetach((PVOID*)&g_pNtCreateDebugObject, NtCreateDebugObject);

Callers

nothing calls this directly

Calls 2

DetourAttachFunction · 0.85
DetourTransactionCommitFunction · 0.85

Tested by

no test coverage detected