mgostih

RNG Hack

Mar 25th, 2016
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // RNG Hack.cpp : Defines the entry point for the console application.
  2. // mgostIH
  3.  
  4. #include "stdafx.h"
  5. #include <Windows.h>
  6. #include "BetterFunctions.h"
  7. int _tmain(int argc, _TCHAR* argv[])
  8. {
  9.     HANDLE hwnd = GetHandle("Geometry Dash");
  10.     int err;
  11.     SetConsoleTitle("GD Random Number Generator Hack - mgostIH");
  12.     redirect(hwnd);
  13.     deviatesite(hwnd);
  14.     HMODULE mod = LoadLibraryA("msvcr120.dll");
  15.     if (!mod){
  16.         cout << "Error in loading msvcr120.dll, report this number to mgostIH: " << GetLastError() << endl;
  17.         system("PAUSE>NUL");
  18.         return 1;
  19.     }
  20.     DWORD base = (DWORD)GetProcAddress(GetModuleHandleA("msvcr120.dll"), "rand");
  21.     DWORD old;
  22.     VirtualProtectEx(hwnd, (LPVOID)base, 100, PAGE_EXECUTE_READWRITE, &old);
  23.     err = WriteProcessMemory(hwnd, (LPVOID)(base + 0x18), "\xB8\x00\x00\x00\x00\x90\x90\x90", 8, NULL);
  24.     if (!err){
  25.         cout << "Error in writing memory, report this number to mgostIH: " << GetLastError() << endl;
  26.         system("PAUSE>NUL");
  27.         return 2;
  28.     }
  29.     while (1){
  30.         DWORD input = GetNumber();
  31.         err = WriteProcessMemory(hwnd, (LPVOID)(base + 0x19), &input, 4, NULL);
  32.         if (!err){
  33.             cout << "Error in writing memory, report this number to mgostIH: " << GetLastError() << endl;
  34.             system("PAUSE>NUL");
  35.             return 2;
  36.         }
  37.         cout << "Memory written successfully. Press ENTER to write again." << endl;
  38.         system("PAUSE>NUL");
  39.         system("CLS");
  40.     }
  41.     return 0;
  42. }
Add Comment
Please, Sign In to add comment