MCPcopy Create free account
hub / github.com/LiteLoaderQQNT/QQNTFileVerifyPatch / GetParentProcessID

Function GetParentProcessID

HijackMethod/dllmain.cpp:362–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362DWORD GetParentProcessID() {
363 HANDLE hSnapshot;
364 PROCESSENTRY32 pe32;
365 DWORD ppid = 0, pid = GetCurrentProcessId();
366
367 hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
368 if (hSnapshot == INVALID_HANDLE_VALUE) return 0;
369
370 pe32.dwSize = sizeof(PROCESSENTRY32);
371 if (Process32First(hSnapshot, &pe32)) {
372 do {
373 if (pe32.th32ProcessID == pid) {
374 ppid = pe32.th32ParentProcessID;
375 break;
376 }
377 } while (Process32Next(hSnapshot, &pe32));
378 }
379
380 CloseHandle(hSnapshot);
381 return ppid;
382}
383
384bool IsParentQQ() {
385 DWORD parentPID = GetParentProcessID();

Callers 1

IsParentQQFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected