Guest User

Assault rifle trainer by Nexobeta28

a guest
Dec 5th, 2019
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.26 KB | None | 0 0
  1. //Assault cube exploit by Nexobeta28. 2019. Word#5273
  2. //IMPORTS
  3.  
  4. #include<iostream>
  5. #include<Windows.h>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     //ADDRESSES
  12.     DWORD baseAddress = 0x00509C6C;
  13.  
  14.     DWORD healthAddress = 0x00E7A838; //off F8
  15.     DWORD mtp57_ammoAddress = 0xE7A890; //off 150
  16.     DWORD mk77_ammoAddress = 0x00DBA87C; //off 13C
  17.     DWORD armorAdress = 0x00DBA83C; //off ?
  18.  
  19.     HWND hwnd = FindWindowA(NULL, "AssaultCube"); //Get assault cube window. HWND is a data type that stores Windows.
  20.  
  21.     if (hwnd == NULL)
  22.     {
  23.         cout << "[ERROR]: Cannot find AssaultCube window." << endl;
  24.         Sleep(5000);
  25.         exit(-1);
  26.     }
  27.     else
  28.     {
  29.         DWORD procID; //DWORD is a data type used to store hex addreses. procId is the process ID of AssaultCube.
  30.         GetWindowThreadProcessId(hwnd, &procID); //Hook process. With & we are referencing the actual process ID (hwnd ID).
  31.  
  32.         HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID); //Open process
  33.  
  34.         if (procID == NULL)
  35.         {
  36.             cout << "[ERROR]: Cannot find AssaultCube process ID." << endl;
  37.             Sleep(5000);
  38.             exit(-1);
  39.         }
  40.         else
  41.         {
  42.  
  43.             while (TRUE)
  44.             {
  45.                 int option;
  46.                 int value;
  47.  
  48.                 cout << "[1] Change health value" << endl;
  49.                 cout << "[2] Change MTP-57 ammo value" << endl;
  50.                 cout << "[3] Change MK-77 ammo value" << endl;
  51.                 cout << "[4] Change armor value (max 100)" << endl << endl;
  52.  
  53.                 cout << "Option number: ";
  54.                 cin >> option;
  55.  
  56.                 switch (option)
  57.                 {
  58.                 case 1:
  59.                     int healthValue;
  60.  
  61.                     cout << "New health value: ";
  62.                     cin >> value;
  63.  
  64.                     WriteProcessMemory(handle, (LPVOID)healthAddress, &value, sizeof(value), 0);
  65.                     break;
  66.  
  67.                 case 2:
  68.                     cout << "New MTP-57 ammo value: ";
  69.                     cin >> value;
  70.  
  71.                     WriteProcessMemory(handle, (LPVOID)mtp57_ammoAddress, &value, sizeof(value), 0);
  72.                     break;
  73.  
  74.                 case 3:
  75.                     cout << "New MK-77 ammo value: ";
  76.                     cin >> value;
  77.  
  78.                     WriteProcessMemory(handle, (LPVOID)mk77_ammoAddress, &value, sizeof(value), 0);
  79.                     break;
  80.  
  81.                 case 4:
  82.                     cout << "New armor value: ";
  83.                     cin >> value;
  84.  
  85.                     WriteProcessMemory(handle, (LPVOID)armorAdress, &value, sizeof(value), 0);
  86.                     break;
  87.                 default:
  88.                     cout << "Enter a valid option!";
  89.                     Sleep(3000);
  90.                     break;
  91.                 }
  92.  
  93.                 system("cls");
  94.             }
  95.  
  96.         }
  97.     }
  98.  
  99.  
  100.     return 0;
  101. }
Advertisement
Add Comment
Please, Sign In to add comment