| 307 | } |
| 308 | |
| 309 | void 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 | |
| 362 | DWORD GetParentProcessID() { |
| 363 | HANDLE hSnapshot; |
no test coverage detected