Advertisement
Guest User

Untitled

a guest
Sep 1st, 2018
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. #include <iostream>
  2. #include "Windows.h"
  3. using namespace std;
  4.  
  5. int main()
  6.  
  7. {
  8. HWND hWnd = FindWindow(0, "AssaultCube");
  9.  
  10. if (!hWnd)
  11. return(MessageBox(0, "Error cannot find window!", "Error!", MB_OK + MB_ICONERROR)); // Message Box Error Box
  12.  
  13.  
  14. DWORD Process_ID;
  15. HANDLE hProcess;
  16.  
  17. GetWindowThreadProcessId(hWnd, &Process_ID);
  18. hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, Process_ID);
  19.  
  20. if (!hProcess)
  21. return(MessageBox(NULL, "Cannot Find Process", "Error", MB_OK + MB_ICONERROR));
  22.  
  23. {
  24. // CHEAT ENGINE ADDRESS FINDINGS //
  25. //DWORD Off1 = 0x0;
  26. //DWORD Off2 = 0x14;
  27. //DWORD Off3 = 0x384;
  28. //DWORD LocalPlayerBasePointerAddr = 0x0509b74;
  29.  
  30. // ADDRESS & OFFSETS (USED) //
  31. DWORD AmmoOffset = 0x150;
  32. DWORD PistolOffset = 0x13C;
  33. DWORD ClientBaseAddress = 0x400000;
  34. DWORD ClientOffset = 0x109b74;
  35.  
  36. // STORED VALUES //
  37. int LocalPlayerBasePointer;
  38. int CurrentAmmo;
  39. int NewAmmovalue = 1337;
  40.  
  41. DWORD ClientAddress = ClientBaseAddress + ClientOffset; // This finds the client base address by adding module and offset
  42. ReadProcessMemory(hProcess, (LPCVOID*)(ClientAddress), &LocalPlayerBasePointer, sizeof(LocalPlayerBasePointer), NULL);
  43. //cout << "This is the address of ClientBaseAddress + ClientOffset = " << LocalPlayerBasePointer << endl;
  44.  
  45.  
  46. SetConsoleTitle("Assault Cube - External Console Hack Trainer - C++ version.0.0.0.1");
  47.  
  48. cout << "=================================================================== " << endl;
  49. cout << "WELCOME TO THE ASSAULT CUBE CONSOLE TRAINER " << endl;
  50. cout << "=================================================================== " << endl;
  51. cout << endl;
  52.  
  53.  
  54. int menu;
  55. cout << "MENU" << endl;
  56. cout << "========" << endl << endl;
  57. cout << "Please Select: " << endl << endl;
  58. cout << "[ 1 ] - INFINITE HEALTH" << endl;
  59. cout << "[ 2 ] - INFINITE RIFLE AMMO" << endl;
  60. cout << "[ 3 ] - INFINITE PISTOL AMMO" << endl;
  61. cin >> menu;
  62. system("cls");
  63.  
  64. switch (menu)
  65. {
  66.  
  67. case 1:
  68. {
  69. //==================== HEALTH FUNCTION =========================//
  70. cout << "HEALTH HACK IS NOT AVAILABLE AT THE MOMENT" << endl << endl;
  71. break;
  72. }
  73.  
  74. case 2:
  75. {
  76. //==================== RIFLE AMMO FUNCTION ==============================//
  77. DWORD RifleAmmoAddress = LocalPlayerBasePointer + AmmoOffset;
  78. ReadProcessMemory(hProcess, (LPCVOID*)(RifleAmmoAddress), &CurrentAmmo, sizeof(CurrentAmmo), NULL);
  79. WriteProcessMemory(hProcess, (VOID*)(RifleAmmoAddress), &NewAmmovalue, sizeof(NewAmmovalue), NULL);
  80. cin.ignore(100);
  81.  
  82. break;
  83.  
  84. }
  85.  
  86. case 3:
  87. {
  88. //==================== PISTOL AMMO FUNCTION =========================//
  89. DWORD PistolAmmoAddress = LocalPlayerBasePointer + PistolOffset;
  90. ReadProcessMemory(hProcess, (LPCVOID*)(PistolAmmoAddress), &CurrentAmmo, sizeof(CurrentAmmo), NULL);
  91. WriteProcessMemory(hProcess, (VOID*)(PistolAmmoAddress), &NewAmmovalue, sizeof(NewAmmovalue), NULL);
  92. cin.ignore(100);
  93.  
  94. break;
  95. }
  96.  
  97. default:
  98.  
  99. cout << "- WRONG INPUT KEY PLEASE SELECT THE KEY FROM THE MENU" << endl << endl;
  100.  
  101. }
  102.  
  103. system("PAUSE");
  104. }
  105.  
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement