Advertisement
xParaDoX

Black Ops Zombies Cheat

Oct 30th, 2015
1,224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.15 KB | None | 0 0
  1. // Syf/Float's External BlackOps Zombies hack.
  2. // All addresses found with Cheat Engine & my own knowledge.
  3. #include <iostream>
  4. #include "MemoryManager.h"
  5. #include <thread>
  6. // Defining and declaring variables in the global scope
  7. struct OffsetsStruct {
  8.     DWORD Ammo_Primary = 0x1808F00;
  9.     DWORD Ammo_Secondary = 0x1808F10;
  10.     DWORD Ammo_Grenades = 0x01C08F08;
  11.     DWORD Ammo_Primary_DualWield = 0x1808F20;
  12.     DWORD Ammo_MonkeyBombs = 0x01C08F18;
  13.     DWORD Player_Health = 0x01A7987C;
  14.     DWORD Player_RapidFire1 = 0x01C08B7C;
  15.     DWORD Player_RapidFire2 = 0x01C08B84;
  16.     DWORD Scoreboard_Points = 0x180A6C8;
  17.     DWORD Scoreboard_Kills = 0x01C0A6CC;
  18.     DWORD Scoreboard_Headshots = 0x1C0A6EC;
  19.     // Functions
  20.     DWORD HealthFunction = 0x3DADD0;
  21.     DWORD AmmoFunction = 0x297A10;
  22.     DWORD RapidfireFunction = 0x3669EC;
  23.     DWORD RapidfireFunction2 = 0x367149;
  24.     int _Player_Health;
  25.     // Declaring functions that are later in the program
  26.     bool InvincibilityToggle = false;
  27.     bool InfiniteAmmoToggle = false;
  28.     bool RapidFireToggle = false;
  29.     DWORD modBaseAddr;
  30. };
  31. BYTE HealthFunctionOriginal[] = { 0x89, 0x85, 0x84, 0x01, 0x00, 0x00 }; // BlackOps.exe+3DADD0 - 89 85 84010000        - mov [ebp+00000184],eax
  32. BYTE AmmoFunctionOriginal[] = { 0x89, 0x50, 0x04 }; // BlackOps.exe+297A10 - 89 50 04              - mov [eax+04],edx
  33. BYTE RapidfireFunctionOriginal[] = { 0x89, 0x10 };
  34. BYTE RapidfireFunction2Original[] = { 0x89, 0x48, 0x44 }; // BlackOps.exe + 367149 - 89 48 44 - mov[eax + 44], ecx
  35.  
  36. MemoryManager Memory; // Telling us to use "Memory" to reference when we want to edit the variables
  37. OffsetsStruct Offsets;
  38.  
  39. void Invincibility() {
  40.     BYTE fNop[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
  41.     //WriteProcessMemory(hWnd, (BYTE*)0x3669EC, &btLdrLoadDll, sizeof(btLdrLoadDll), NULL);
  42.     if (GetAsyncKeyState(VK_NUMPAD0)) {
  43.         Offsets.InvincibilityToggle = !Offsets.InvincibilityToggle;
  44.         if (!Offsets.InvincibilityToggle) {
  45.             WriteProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.HealthFunction), &fNop, sizeof(fNop), NULL);
  46.         }
  47.         else if (Offsets.InvincibilityToggle) {
  48.             WriteProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.HealthFunction), &HealthFunctionOriginal, sizeof(HealthFunctionOriginal), NULL);
  49.         }
  50.     }
  51. }
  52.  
  53. void InfiniteAmmo() {
  54.     BYTE fNop[] = { 0x90, 0x90, 0x90 };
  55.     //WriteProcessMemory(hWnd, (BYTE*)0x3669EC, &btLdrLoadDll, sizeof(btLdrLoadDll), NULL);
  56.     if (GetAsyncKeyState(VK_NUMPAD1)) {
  57.         if (!Offsets.InfiniteAmmoToggle) {
  58.             WriteProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.AmmoFunction), &fNop, sizeof(fNop), NULL);
  59.             Offsets.InfiniteAmmoToggle = true;
  60.         }
  61.         else if (Offsets.InvincibilityToggle) {
  62.             WriteProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.AmmoFunction), &AmmoFunctionOriginal, sizeof(AmmoFunctionOriginal), NULL);
  63.             Offsets.InfiniteAmmoToggle = false;
  64.         }
  65.     }
  66. }
  67.  
  68. void Rapidfire() {
  69.     BYTE fNop[] = { 0x90, 0x90 };
  70.     BYTE fNop2[] = { 0x90, 0x90, 0x90 };
  71.     //WriteProcessMemory(hWnd, (BYTE*)0x3669EC, &btLdrLoadDll, sizeof(btLdrLoadDll), NULL);
  72.     if (GetAsyncKeyState(VK_NUMPAD2)) {
  73.         if (!Offsets.RapidFireToggle) {
  74.             WriteProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.RapidfireFunction), &fNop, sizeof(fNop), NULL);
  75.             //WriteProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.RapidfireFunction2), &fNop, sizeof(fNop2), NULL);
  76.             Offsets.RapidFireToggle = true;
  77.         }
  78.         else if (Offsets.RapidFireToggle) {
  79.             WriteProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.RapidfireFunction), &RapidfireFunctionOriginal, sizeof(RapidfireFunctionOriginal), NULL);
  80.             //WriteProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.RapidfireFunction2), &RapidfireFunction2Original, sizeof(RapidfireFunction2Original), NULL);
  81.             Offsets.RapidFireToggle = false;
  82.         }
  83.     }
  84. }
  85. void userOptions();
  86. void fixVars() {
  87.     BYTE fixInvincibility;
  88.     ReadProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.HealthFunction), &fixInvincibility, sizeof(BYTE), NULL);
  89.     if (fixInvincibility == 0x90)
  90.         Offsets.InvincibilityToggle = true;
  91.     else
  92.         Offsets.InvincibilityToggle = false;
  93.     BYTE fixInfiniteAmmo;
  94.     ReadProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.InfiniteAmmoToggle), &fixInfiniteAmmo, sizeof(BYTE), NULL);
  95.     if (fixInvincibility == 0x90)
  96.         Offsets.InfiniteAmmoToggle = true;
  97.     else
  98.         Offsets.InfiniteAmmoToggle = false;
  99.     BYTE fixRapidfire;
  100.     ReadProcessMemory(Memory.hProcess, (LPVOID)(Offsets.modBaseAddr + Offsets.RapidfireFunction), &fixRapidfire, sizeof(BYTE), NULL);
  101.     if (fixInvincibility == 0x90)
  102.         Offsets.RapidFireToggle = true;
  103.     else
  104.         Offsets.RapidFireToggle = false;
  105.     userOptions();
  106.     std::cout << "\nFixed vars." << std::endl;
  107. }
  108.  
  109. void userOptions() {
  110.     system("cls");
  111.     std::cout << "SyFloat's Black Ops Zombies hack" << std::endl;
  112.     std::cout << "INSERT to re-attach\nHOME to Scoreboard cheat\nEND to fix vars" << std::endl;
  113.     std::cout << "DELETE to quit program" << std::endl;
  114.     std::cout << "NUMPAD0 to toggle invincibility - " << Offsets.InvincibilityToggle << std::endl;
  115.     std::cout << "NUMPAD1 to toggle infinite ammo - " << Offsets.InfiniteAmmoToggle << std::endl;
  116.     std::cout << "NUMPAD2 to toggle rapid fire - " << Offsets.RapidFireToggle << std::endl;
  117. }
  118.  
  119. int main()
  120. {
  121.     // Memory.WriteMemory<BYTE>(Memory.GetModuleBaseAddress("BlackOps.exe") + 0x3669EC, 0x90); // This writes 0x90 (nop) to BlackOps.exe+Rapidfire
  122.  
  123.     Memory.AttachProcess("BlackOps.exe");
  124.     Offsets.modBaseAddr = Memory.GetModuleBaseAddress("BlackOps.exe");
  125.     userOptions();
  126.     while(!GetAsyncKeyState(VK_DELETE)) {
  127.         if (GetAsyncKeyState(VK_INSERT)) {
  128.             Memory.AttachProcess("BlackOps.exe");
  129.             Offsets.modBaseAddr = Memory.GetModuleBaseAddress("BlackOps.exe");
  130.             userOptions();
  131.         }
  132.         if (GetAsyncKeyState(VK_HOME)) {
  133.             Memory.WriteMemory<int>(Offsets.modBaseAddr + Offsets.Scoreboard_Points, 777777);
  134.         }
  135.         if (GetAsyncKeyState(VK_END))
  136.             fixVars();
  137.         if (GetAsyncKeyState(VK_NUMPAD0)) {
  138.             Invincibility();
  139.             userOptions();
  140.         }
  141.         if (GetAsyncKeyState(VK_NUMPAD1)) {
  142.             InfiniteAmmo();
  143.             userOptions();
  144.         }
  145.         if (GetAsyncKeyState(VK_NUMPAD2)) {
  146.             Rapidfire();
  147.             userOptions();
  148.         }
  149.         Sleep(150);
  150.     }
  151. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement