Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- // FindWindow();
- // GetWindowThreadProcessId();
- // OpenProcess();
- // WriteProcessMemory();
- // CloseHandle();
- using namespace std;
- int main()
- {
- //int newValue = 500;
- HWND hWnd = FindWindow(0, "Geometry Dash");
- int isSuccesful2;
- int isSuccesful3;
- DWORD oldvalue;
- if (hWnd == 0) {
- cerr << "Cannot find window." << endl;
- cin.get();
- } else {
- DWORD pId;
- GetWindowThreadProcessId(hWnd, &pId);
- HANDLE hProc = OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_QUERY_INFORMATION, FALSE, pId);
- if (!hProc) {
- cerr << "Cannot open process." << endl;
- cin.get();
- } else {
- cout << "MgostIH Score Hack is now ready, press enter to inject the hack!" << endl;
- cin.get();
- char bytes[] = "\xE8\x89\xD4\xF9\xFF\x90";
- int isSuccessful = WriteProcessMemory(hProc, (LPVOID)0x00494CCA, &bytes, (DWORD)(sizeof(bytes)-1), NULL);
- char bytes2[] = "\xBF\xA4\x01\x00\x00\x89\xBE\xE0\x01\x00\x00\xC3\x90";
- int isSuccessful2=WriteProcessMemory(hProc, (LPVOID)0x00432158, &bytes2, (DWORD)(sizeof(bytes2)-1), NULL);
- VirtualProtectEx(hProc,(LPVOID)0x005D3A94,256,PAGE_EXECUTE_READWRITE, &oldvalue);
- //cout << GetLastError() << endl;
- 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";
- int isSuccessful3=WriteProcessMemory(hProc, (LPVOID)0x005D3A94, &bytes3, (DWORD)(sizeof(bytes3)-1), 0);
- //cout << GetLastError() << endl;
- if ((isSuccessful > 0) & (isSuccessful2 > 0) & (isSuccessful3 > 0)) {
- clog << "Process memory written succesfully. You can close this window." << endl;
- cin.get();
- } else {
- cerr << "Cannot write process memory." << endl;
- cin.get();
- }
- CloseHandle(hProc);
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment