Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Windows.h"
- using namespace std;
- int main()
- {
- HWND hWnd = FindWindow(0, "AssaultCube");
- if (!hWnd)
- return(MessageBox(0, "Error cannot find window!", "Error!", MB_OK + MB_ICONERROR)); // Message Box Error Box
- DWORD Process_ID;
- HANDLE hProcess;
- GetWindowThreadProcessId(hWnd, &Process_ID);
- hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, Process_ID);
- if (!hProcess)
- return(MessageBox(NULL, "Cannot Find Process", "Error", MB_OK + MB_ICONERROR));
- {
- // CHEAT ENGINE ADDRESS FINDINGS //
- //DWORD Off1 = 0x0;
- //DWORD Off2 = 0x14;
- //DWORD Off3 = 0x384;
- //DWORD LocalPlayerBasePointerAddr = 0x0509b74;
- // ADDRESS & OFFSETS (USED) //
- DWORD AmmoOffset = 0x150;
- DWORD PistolOffset = 0x13C;
- DWORD ClientBaseAddress = 0x400000;
- DWORD ClientOffset = 0x109b74;
- // STORED VALUES //
- int LocalPlayerBasePointer;
- int CurrentAmmo;
- int NewAmmovalue = 1337;
- DWORD ClientAddress = ClientBaseAddress + ClientOffset; // This finds the client base address by adding module and offset
- ReadProcessMemory(hProcess, (LPCVOID*)(ClientAddress), &LocalPlayerBasePointer, sizeof(LocalPlayerBasePointer), NULL);
- //cout << "This is the address of ClientBaseAddress + ClientOffset = " << LocalPlayerBasePointer << endl;
- SetConsoleTitle("Assault Cube - External Console Hack Trainer - C++ version.0.0.0.1");
- cout << "=================================================================== " << endl;
- cout << "WELCOME TO THE ASSAULT CUBE CONSOLE TRAINER " << endl;
- cout << "=================================================================== " << endl;
- cout << endl;
- int menu;
- cout << "MENU" << endl;
- cout << "========" << endl << endl;
- cout << "Please Select: " << endl << endl;
- cout << "[ 1 ] - INFINITE HEALTH" << endl;
- cout << "[ 2 ] - INFINITE RIFLE AMMO" << endl;
- cout << "[ 3 ] - INFINITE PISTOL AMMO" << endl;
- cin >> menu;
- system("cls");
- switch (menu)
- {
- case 1:
- {
- //==================== HEALTH FUNCTION =========================//
- cout << "HEALTH HACK IS NOT AVAILABLE AT THE MOMENT" << endl << endl;
- break;
- }
- case 2:
- {
- //==================== RIFLE AMMO FUNCTION ==============================//
- DWORD RifleAmmoAddress = LocalPlayerBasePointer + AmmoOffset;
- ReadProcessMemory(hProcess, (LPCVOID*)(RifleAmmoAddress), &CurrentAmmo, sizeof(CurrentAmmo), NULL);
- WriteProcessMemory(hProcess, (VOID*)(RifleAmmoAddress), &NewAmmovalue, sizeof(NewAmmovalue), NULL);
- cin.ignore(100);
- break;
- }
- case 3:
- {
- //==================== PISTOL AMMO FUNCTION =========================//
- DWORD PistolAmmoAddress = LocalPlayerBasePointer + PistolOffset;
- ReadProcessMemory(hProcess, (LPCVOID*)(PistolAmmoAddress), &CurrentAmmo, sizeof(CurrentAmmo), NULL);
- WriteProcessMemory(hProcess, (VOID*)(PistolAmmoAddress), &NewAmmovalue, sizeof(NewAmmovalue), NULL);
- cin.ignore(100);
- break;
- }
- default:
- cout << "- WRONG INPUT KEY PLEASE SELECT THE KEY FROM THE MENU" << endl << endl;
- }
- system("PAUSE");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement