-
Notifications
You must be signed in to change notification settings - Fork 1
/
AssaultCubeTrainer.cpp
227 lines (210 loc) · 7.14 KB
/
AssaultCubeTrainer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#include "Memory.h"
int main()
{
//Getting Process ID
DWORD PID = GetPID(L"ac_client.exe");
//Error check
if (PID == NULL) {
std::cout << "Process 'ac_client.exe' Not Found. " << std::endl;
return EXIT_FAILURE;
system("pause");
}
//Getting ModuleBaseAddress
uintptr_t ModuleAddress = GetModule(PID, L"ac_client.exe");
if (ModuleAddress == NULL) {
std::cout << "ModuleAddress Failed. " << std::endl;
return EXIT_FAILURE;
system("pause");
}
//Opening Handle to the Process
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID);
uintptr_t playerBase = ModuleAddress + 0x00109B74;
uintptr_t playerAddress = FindAddress(hProc, { 0 }, playerBase);
//Offsets
uintptr_t ARammo = playerAddress + 0x150;
uintptr_t ARammoLeft = playerAddress + 0x128;
uintptr_t pistolAmmo = playerAddress + 0x13C;
uintptr_t pistolammoLeft = playerAddress + 0x114;
uintptr_t Health = playerAddress + 0xF8;
uintptr_t Armour = playerAddress + 0xFC;
uintptr_t arRapidfire = playerAddress + 0x178;
uintptr_t nadeAmmo = playerAddress + 0x158;
uintptr_t nadeAnimation = playerAddress + 0x180;
int memoryRead = NULL;
//Values we want to write
int ARammoNew = 999;
int pistolammoNew = 999;
int nadeAmmoNew = 999;
int HealthNew = 999;
int ArmourNew = 999;
int arRapidfireNew = 0;
int nadeRapidFire = 0;
bool arammo = false;
bool pistolammo = false;
bool nadeammo = false;
bool health = false;
bool armour = false;
bool rapidfire = false;
//Console
std::cout << "\nWELCOME TO ASSAULT CUBE TRAINER BY @STAIINLESS\n\n\n";
std::cout << "F4 == ACTIVATE/DEACTIVATE RAPIDFIRE (NADES & AR)\n" << std::endl;
std::cout << "---------------------------------------------------\n" << std::endl;
std::cout << "F5 == ACTIVATE/DEACTIVATE UNLIMITED AR AMMO\n" << std::endl;
std::cout << "---------------------------------------------------\n" << std::endl;
std::cout << "F6 == ACTIVATE/DEACTIVATE UNLIMITED PISTOL AMMO\n" << std::endl;
std::cout << "---------------------------------------------------\n" << std::endl;
std::cout << "F7 == ACTIVATE/DEACTIVATE UNLIMITED HEALTH\n" << std::endl;
std::cout << "---------------------------------------------------\n" << std::endl;
std::cout << "F8 == ACTIVATE/DEACTIVATE UNLIMITED ARMOUR\n" << std::endl;
std::cout << "---------------------------------------------------\n" << std::endl;
std::cout << "F12 == ACTIVATE/DEACTIVATE UNLIMITED GERNADES\n" << std::endl;
std::cout << "---------------------------------------------------\n" << std::endl;
std::cout << "F2 == EXIT TRAINER" << std::endl;
//Hack Loop
while (true)
{
if (GetAsyncKeyState(VK_F4))
{
rapidfire = !rapidfire;
if (rapidfire) std::cout << "RAPIDFIRE IS ACTIVE." << std::endl;
else std::cout << "RAPIDFIRE IN INACTIVE." << std::endl;
Sleep(150);
}
if (rapidfire)
{
bool wpm = WriteProcessMemory(hProc, (LPVOID)arRapidfire, &arRapidfireNew, sizeof(arRapidfire), NULL);
Sleep(5);
wpm = WriteProcessMemory(hProc, (LPVOID)nadeAnimation, &nadeRapidFire, sizeof(nadeAnimation), NULL);
if (wpm == NULL)
{
std::cout << "WriteProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
}
if (GetAsyncKeyState(VK_F5))
{
arammo = !arammo;
bool rpm = ReadProcessMemory(hProc, (LPCVOID)ARammo, &memoryRead, sizeof(ARammo), NULL);
if (rpm == NULL)
{
std::cout << "ReadProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
std::cout << "\nCurrent AR AMMO = " << memoryRead << std::endl;
Sleep(150);
}
if (arammo)
{
bool wpm = WriteProcessMemory(hProc, (LPVOID)ARammo, &ARammoNew, sizeof(ARammo), NULL);
Sleep(5);
if (wpm == NULL)
{
std::cout << "WriteProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
}
if (GetAsyncKeyState(VK_F6))
{
pistolammo = !pistolammo;
bool rpm = ReadProcessMemory(hProc, (LPCVOID)pistolAmmo, &memoryRead, sizeof(pistolAmmo), NULL);
if (rpm == NULL)
{
std::cout << "ReadProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
std::cout << "\nCurrent PISTOL AMMO = " << memoryRead << std::endl;
Sleep(150);
}
if (pistolammo)
{
bool wpm = WriteProcessMemory(hProc, (LPVOID)pistolAmmo, &pistolammoNew, sizeof(pistolAmmo), NULL);
Sleep(5);
if (wpm == NULL)
{
std::cout << "WriteProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
}
if (GetAsyncKeyState(VK_F7))
{
health = !health;
bool rpm = ReadProcessMemory(hProc, (LPCVOID)Health, &memoryRead, sizeof(Health), NULL);
if (rpm == NULL)
{
std::cout << "ReadProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
std::cout << "\nCurrent HEALTH = " << memoryRead << std::endl;
Sleep(150);
}
if (health)
{
bool wpm = WriteProcessMemory(hProc, (LPVOID)Health, &HealthNew, sizeof(Health), NULL);
Sleep(5);
if (wpm == NULL)
{
std::cout << "WriteProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
}
if (GetAsyncKeyState(VK_F8))
{
armour = !armour;
bool rpm = ReadProcessMemory(hProc, (LPCVOID)Armour, &memoryRead, sizeof(Armour), NULL);
if (rpm == NULL)
{
std::cout << "ReadProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
std::cout << "\nCurrent Armour Value = " << memoryRead << std::endl;
Sleep(150);
}
if (armour)
{
bool wpm = WriteProcessMemory(hProc, (LPVOID)Armour, &ArmourNew, sizeof(Armour), NULL);
Sleep(5);
if (wpm == NULL)
{
std::cout << "WriteProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
}
if (GetAsyncKeyState(VK_F12))
{
nadeammo = !nadeammo;
bool rpm = ReadProcessMemory(hProc, (LPCVOID)nadeAmmo, &memoryRead, sizeof(nadeAmmo), NULL);
if (rpm == NULL)
{
std::cout << "ReadProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
std::cout << "Current Gernades = " << memoryRead << std::endl;
Sleep(150);
}
if (nadeammo)
{
bool wpm = WriteProcessMemory(hProc, (LPVOID)nadeAmmo, &nadeAmmoNew, sizeof(nadeAmmo), NULL);
Sleep(5);
if (wpm == NULL)
{
std::cout << "WriteProcessMemory Failed. Last Error = " << std::dec << GetLastError() << std::endl;
return EXIT_FAILURE;
system("pause");
}
}
if (GetAsyncKeyState(VK_F2)) {
break;
}
}
CloseHandle(hProc);
}