Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <Windows.h>
- #include <string>
- #include <cmath>
- #include <ctime>
- using namespace std;
- DWORD FindDmaAddy(int PointerLevel, HANDLE handle, DWORD Offsets[], DWORD BaseAddress);
- void WriteToMemory(HANDLE handle);
- std::string GameName = "AssaultCube";
- LPCSTR LGameWindow = "AssaultCube";
- std::string GameStatus;
- //ammo variables
- //BYTE AmmoValue[] = { 0xA3, 0x1C, 0x0, 0x0 };
- int AmmoValue;
- DWORD AmmoBaseAddress = { 0x509B74 };
- DWORD AmmoOffsets[] = { 0x374, 0x14, 0x0 };
- //health variables
- //BYTE HealthValue[] = { 0x39, 0x5, 0x0, 0x0 };
- int HealthValue;
- DWORD HealthBaseAddress = { 0x50f4f4 }; // these are the variables to find our values.
- DWORD HealthOffsets[] = { 0xf8 };
- //smoke variables
- //BYTE HealthValue[] = { 0x39, 0x5, 0x0, 0x0 };
- int SmokeValue;
- DWORD SmokeBaseAddress = { 0x50F4F4 };
- DWORD SmokeOffsets[] = { 0x368, 0x14, 0x0 };
- int main() {
- DWORD AddressToWrite;
- string WantAgain;
- system("title Hackermode");
- HWND hwnd = FindWindowA(NULL, "AssaultCube");
- if (hwnd == NULL) {
- cout << "Cannot find window" << endl;
- Sleep(3000);
- exit(-1);
- }
- else {
- DWORD procID;
- GetWindowThreadProcessId(hwnd, &procID);
- HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
- if (procID == NULL) {
- cout << "Cannot obtain process" << endl;
- Sleep(3000);
- exit(-1);
- }
- else {
- gotome:
- system("cls");
- // health
- cout << "How much health do you want? ";
- cin >> HealthValue;
- //ammo
- cout << "How many bullets do you want to add? ";
- cin >> AmmoValue;
- //smoke
- cout << "How many smokes do you want? ";
- cin >> SmokeValue;
- //shield (doesnt work)
- WriteToMemory(handle);
- cout << "===========================================================" << endl;
- cout << "| You now have " << HealthValue << " health points" << endl;
- cout << "| You now have " << AmmoValue << " bullet" << endl;
- cout << "| You now have " << SmokeValue << " smokes" << endl;
- cout << "===========================================================" << endl;
- cout << "writed to memory successfully." << endl << endl;
- cout << "Do you want again? (yes/no): ";
- cin >> WantAgain;
- if (WantAgain == "yes" || WantAgain == "y") {
- goto gotome;
- }
- else if (WantAgain == "no" || WantAgain == "n") {
- return false;
- }
- else {
- goto gotome;
- }
- } // end if advanced
- } //end else
- system("pause >nul");
- }
- //finds the address using our variables
- DWORD FindDmaAddy(int PointerLevel, HANDLE handle, DWORD Offsets[], DWORD BaseAddress) {
- DWORD pointer = BaseAddress;
- DWORD pTemp;
- DWORD pointerAddr;
- for (int c = 0; c < PointerLevel; c++) {
- if (c == 0) {
- ReadProcessMemory(handle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
- }
- pointerAddr = pTemp + Offsets[c];
- ReadProcessMemory(handle, (LPCVOID)pointerAddr, &pTemp, sizeof(pTemp), NULL);
- }
- return pointerAddr;
- }
- // writes to memory
- void WriteToMemory(HANDLE handle) {
- DWORD AddressToWrite;
- AddressToWrite = FindDmaAddy(3, handle, AmmoOffsets, AmmoBaseAddress);
- WriteProcessMemory(handle, (BYTE*)AddressToWrite, &AmmoValue, sizeof(AmmoValue), NULL);
- AddressToWrite = FindDmaAddy(1, handle, HealthOffsets, HealthBaseAddress);
- WriteProcessMemory(handle, (BYTE*)AddressToWrite, &HealthValue, sizeof(HealthValue), NULL);
- AddressToWrite = FindDmaAddy(3, handle, SmokeOffsets, SmokeBaseAddress);
- WriteProcessMemory(handle, (BYTE*)AddressToWrite, &SmokeValue, sizeof(SmokeValue), NULL);
- }
Add Comment
Please, Sign In to add comment