Code:
#include <iostream>
#include <Windows.h>
#include <string>
using namespace std;
int main() {
int newValue = 133337;
HWND hWnd = FindWindow(0, "Call of Duty®: BlackOps");
if(hWnd == 0) {
cerr << "Cannot find window." << endl;
return 1;
} else {
bool ammoCheat = false;
bool pointCheat = false;
bool rapidfire = false;
bool invincibility = false;
int health = 50000;
int hurr = 0;
DWORD baseAddr = 0x1C08F00;
DWORD baseAddr2 = 0x1C08F10;
DWORD baseAddrGrenades = 0x01C08F08;
DWORD baseAddrPoints = 0x1C0A6C8;
DWORD baseAddrKills = 0x01C0A6CC;
DWORD baseAddrHeadshots = 0x01C0A6EC;
DWORD baseAddrMonkeyBombs = 0x01C08F18;
// Player Structure
DWORD baseAddrHealth = 0x01A7987C;
DWORD baseAddrRapidFire = 0x01C08B7C;
DWORD baseAddrRapidFire2 = 0x01C08B84;
int timeX = 50;
while(!GetAsyncKeyState(VK_DELETE)) {
Sleep(timeX);
DWORD pId;
GetWindowThreadProcessId(hWnd, &pId);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, false, pId);
if (!hProc) {
cerr << "Cannot open process." << endl;
return 2;
} else {
if(rapidfire) {
WriteProcessMemory(hProc, (LPVOID)baseAddrRapidFire, &hurr, sizeof(baseAddrRapidFire), NULL); // 1 byte
WriteProcessMemory(hProc, (LPVOID)baseAddrRapidFire2, &hurr, sizeof(baseAddrRapidFire2), NULL); // 1 byte
}
if(invincibility) {
WriteProcessMemory(hProc, (LPVOID)baseAddrHealth, &health, sizeof(baseAddrHealth), NULL);
}
if(GetAsyncKeyState(VK_F5)) {
if(rapidfire == true) {
cout << "F1 | Infinite Ammo" << endl;
cout << "F2 | Point Hack" << endl;
cout << "F3 | Invincibility" << endl;
cout << "F4 | Rapid Fire ON" << endl;
} else {
cout << "F1 | Infinite Ammo" << endl;
cout << "F2 | Point Hack" << endl;
cout << "F3 | Kills/headshots 13337" << endl;
cout << "F4 | Rapid Fire OFF" << endl;
}
}
if(GetAsyncKeyState(VK_F1)) {
int isSuccessful = WriteProcessMemory(hProc, (LPVOID)baseAddr, &newValue, sizeof(newValue), NULL);
int isSuccessful2 = WriteProcessMemory(hProc, (LPVOID)baseAddr2, &newValue, sizeof(newValue), NULL);
int isSuccessful3 = WriteProcessMemory(hProc, (LPVOID)baseAddrGrenades, &newValue, sizeof(newValue), NULL);
int isSuccessful4 = WriteProcessMemory(hProc, (LPVOID)baseAddrMonkeyBombs, &newValue, sizeof(newValue), NULL);
if(isSuccessful > 0 && isSuccessful2 > 0 && isSuccessful3 > 0 && isSuccessful4 > 0) {
clog << "Ammo & nades hacked successfully" << endl;
Sleep(400);
} else {
cerr << "Cannot write memory :c" << endl;
}
}
if(GetAsyncKeyState(VK_F2)) {
int isSuccessful = WriteProcessMemory(hProc, (LPVOID)baseAddrPoints, &newValue, sizeof(newValue), NULL);
if(isSuccessful > 0) {
clog << "Points hacked successfully" << endl;
Sleep(400);
} else {
cerr << "Cannot write memory :c" << endl;
}
}
if(GetAsyncKeyState(VK_F3)) {
int isSuccessful = WriteProcessMemory(hProc, (LPVOID)baseAddrHealth, &newValue, sizeof(newValue), NULL);
if(isSuccessful > 0) {
clog << "Invincibility " << invincibility << endl;
invincibility = !invincibility;
if(rapidfire) {
timeX = 3;
} else {
timeX = 25;
}
Sleep(200);
} else {
cerr << "Cannot write memory :c" << endl;
}
}
if(GetAsyncKeyState(VK_F4)) {
int isSuccessful = WriteProcessMemory(hProc, (LPVOID)baseAddrRapidFire, &hurr, sizeof(hurr), NULL); // 1 byte
int isSuccessful2 = WriteProcessMemory(hProc, (LPVOID)baseAddrRapidFire2, &hurr, sizeof(hurr), NULL); // 1 byte
if(isSuccessful > 0 && isSuccessful2 > 0) {
clog << "Rapid Fire " << rapidfire << endl;
rapidfire = !rapidfire;
if(rapidfire) {
timeX = 3;
} else {
timeX = 25;
}
Sleep(200);
} else {
cerr << "Cannot write memory :c" << endl;
}
}
}
}
}
return 0;
}