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

Method ReplaceTaskManager

WinArk/ProcessHelper.cpp:52–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52bool ProcessHelper::ReplaceTaskManager(bool revert) {
53 CRegKey key;
54 DWORD disp;
55 if (ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE, ifeoKey + L"taskmgr.exe", nullptr, 0, KEY_READ | KEY_WRITE | DELETE, nullptr, &disp))
56 return false;
57
58 ATLASSERT(!revert || (revert && disp == REG_OPENED_EXISTING_KEY));
59
60 if (revert)
61 return key.DeleteValue(L"Debugger") == ERROR_SUCCESS;
62
63 return key.SetStringValue(L"Debugger", GetProcessImageName(), REG_SZ) == ERROR_SUCCESS;
64}
65
66CString ProcessHelper::GetProcessImageName() {
67 static CString path;

Callers

nothing calls this directly

Calls 3

DeleteValueMethod · 0.80
CreateMethod · 0.45
SetStringValueMethod · 0.45

Tested by

no test coverage detected