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

Function Exploit

HijackMethod/dllmain.cpp:309–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309void Exploit() {
310 if (MH_Initialize() != MH_OK) {
311 MessageBoxA(nullptr, "MH Init Error!", "ERROR", MB_ICONERROR | MB_OK);
312 exit(1);
313 }
314
315 void* FileVerify_MainPointer = nullptr;
316 if (OldQQ)
317 {
318 FileVerify_MainPointer = static_cast<void*>(sig(GetModuleHandleA(NULL), Sig_text));
319 }
320 else
321 {
322 FileVerify_MainPointer = static_cast<void*>(sig(GetModuleHandleA("QQNT.dll"), Sig_text2));
323 }
324
325 HMODULE SelfModule = GetModuleHandleA("dbghelp.dll");
326 MODULEINFO SelfModuleInfo = { 0 };
327 GetModuleInformation(GetCurrentProcess(), SelfModule, &SelfModuleInfo, sizeof(SelfModuleInfo));
328
329 if ((FileVerify_MainPointer >= SelfModule && FileVerify_MainPointer < SelfModule+SelfModuleInfo.SizeOfImage)) {
330 MessageBoxA(nullptr, "Sig not found!", "ERROR", MB_ICONERROR | MB_OK);
331 exit(1);
332 }
333
334 if (FileVerify_MainPointer != nullptr) {
335 if (MH_CreateHook(FileVerify_MainPointer, &Hk_sub_7FF67F97A5A0, reinterpret_cast<LPVOID*>(&Org_sub_7FF67F97A5A0)) != MH_OK) {
336 MessageBoxA(nullptr, "MH Hook Patch failed!", "ERROR", MB_ICONERROR | MB_OK);
337 exit(1);
338 }
339 }
340 else
341 {
342 MessageBoxA(nullptr, "Sig not found!", "ERROR", MB_ICONERROR | MB_OK);
343 exit(1);
344 }
345
346 if (MH_CreateHook(&MessageBoxW, &Hk_MessageBoxW, reinterpret_cast<LPVOID*>(&Org_MessageBoxW)) != MH_OK) {
347 MessageBoxA(nullptr, "MH Hook MessageBoxW failed!", "ERROR", MB_ICONERROR | MB_OK);
348 exit(1);
349 }
350
351 if (MH_CreateHook(&CreateFileW, &Hk_CreateFileW, reinterpret_cast<LPVOID*>(&Org_CreateFileW)) != MH_OK) {
352 MessageBoxA(nullptr, "MH Hook CreateFileW failed!", "ERROR", MB_ICONERROR | MB_OK);
353 exit(1);
354 }
355
356 if (MH_EnableHook(MH_ALL_HOOKS)!=MH_OK) {
357 MessageBoxA(nullptr, "MH enable all hooks failed!", "ERROR", MB_ICONERROR | MB_OK);
358 exit(1);
359 }
360}
361
362DWORD GetParentProcessID() {
363 HANDLE hSnapshot;

Callers 2

DLLNotificationFunction · 0.70
DllMainFunction · 0.70

Calls 1

sigFunction · 0.70

Tested by

no test coverage detected