-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
244 lines (213 loc) · 6.08 KB
/
main.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
// INCLUDES
#include <iostream>
#include "vector.h"
#include "memory.h"
#include "utility.h"
#include "offsets.h"
#include "entity.h"
#include <chrono>
#include <cmath>
#include <vector>
//-------------------------------------------------------------------------------
// GLOBAL VARS
int boneID = 6;
int horFoV = 2;
int verFoV = 3;
int speed = 7;
int counter = 0;
DWORD localplayer;
DWORD clientstate;
DWORD entityptr;
DWORD boneptr;
EntityList entlist;
//-------------------------------------------------------------------------------
// AIMBOT THREAD
DWORD WINAPI aimboat(LPVOID In)
{
Vector3D ownPos;
Vector3D enemyPos;
Vector3D coords;
angle hor, hor2;
angle ver, ver2;
while (true)
{
Sleep(3);
// CONTROLS
if ((GetAsyncKeyState(VK_TAB) & 0x8000) || (GetAsyncKeyState(VK_LBUTTON) & 0x8000)) // quick help
{
Sleep(100);
continue;
}
//-------------------------------------------------------------------------------
// OWN READS
ownPos.x = Kevin.Read<float>(localplayer + vecOrigin);
ownPos.y = Kevin.Read<float>(localplayer + vecOrigin + 4);
ownPos.z = Kevin.Read<float>(localplayer + vecOrigin + 8) + Kevin.Read<float>(localplayer + vecOffset + 8);
ver = Kevin.Read<float>(clientstate + viewAngles);
hor = Kevin.Read<float>(clientstate + viewAngles + 4);
//-------------------------------------------------------------------------------
// BEEP INFO
if (GetAsyncKeyState(VK_LMENU) & 0x8000)
{
counter = 0;
for (int j = 0; j < 5; j++)
{
entlist.entlist[j].UpdateHealth();
if (entlist.entlist[j].health == 0)
continue;
enemyPos = entlist.entlist[j].GetBone(boneID);
if (abs(enemyPos.x) + abs(enemyPos.y) + abs(enemyPos.z) > 5000)
continue;
hor2 = HorAngle(hor, ownPos, enemyPos);
ver2 = VerAngle(ver, ownPos, enemyPos);
if (abs(hor2) > 55 || abs(ver2) > 34)
continue;
else
counter++;
}
if (counter > 0)
{
switch (counter)
{
case 1:
Beep(200, 500);
break;
case 2:
Beep(300, 500);
break;
case 3:
Beep(1000, 500);
break;
case 4:
Beep(2500, 500);
break;
default:
Beep(6000, 500);
break;
}
}
Sleep(500);
continue;
}
//-------------------------------------------------------------------------------
// ENEMY READS AND ACTION
for (int j = 0; j < 5; j++)
{
if (entlist.entlist[j].IsDormant())
continue;
enemyPos = entlist.entlist[j].GetBone(boneID);
if (abs(enemyPos.x) + abs(enemyPos.y) + abs(enemyPos.z) > 5000)
continue;
hor2 = HorAngle(hor, ownPos, enemyPos);
ver2 = VerAngle(ver, ownPos, enemyPos);
coords = AngleReg(hor2, ver2, horFoV, verFoV, speed);
if (coords.z == -1)
continue;
else
{
SetCursorPos(coords.x, coords.y);
break;
}
}
//-------------------------------------------------------------------------------
}
}
//-------------------------------------------------------------------------------
DWORD WINAPI proxbeep(LPVOID In)
{
Vector3D ownPos;
Vector3D enemyPos;
float distance = 0;
angle hor, hor2;
int freq, radius;
while (true)
{
// OWN READS
ownPos.x = Kevin.Read<float>(localplayer + vecOrigin);
ownPos.y = Kevin.Read<float>(localplayer + vecOrigin + 4);
ownPos.z = Kevin.Read<float>(localplayer + vecOrigin + 8) + Kevin.Read<float>(localplayer + vecOffset + 8);
//-------------------------------------------------------------------------------
// MAIN LOOP
for (int j = 0; j < 5; j++)
{
entlist.entlist[j].UpdateHealth();
if (entlist.entlist[j].IsDormant() || entlist.entlist[j].health <= 0)
continue;
hor = Kevin.Read<float>(clientstate + viewAngles + 4);
hor2 = HorAngle(hor, ownPos, enemyPos);
enemyPos = entlist.entlist[j].GetBone(boneID);
distance = GetDist(ownPos, enemyPos);
if (abs(hor2) > 90)
{
freq = 1200;
radius = 1000;
}
else
{
freq = 400;
radius = 600;
}
if (distance < radius)
{
Beep(freq, 250);
Sleep(400 * pow(distance/radius,2));
break;
}
else
continue;
}
}
//-------------------------------------------------------------------------------
}
int main()
{
// INITIALIZATION
bool toggle = false;
bool toggle2 = false;
bool gunmode = false;
Kevin.GetHandle("csgo.exe");
Kevin.GetModules();
localplayer = Kevin.Read<DWORD>(Kevin.ClientDLL_base + dwLocalPlayer);
clientstate = Kevin.Read<DWORD>(Kevin.EngineDLL_base + dwClientState);
entlist.CycleEntities();
HANDLE aimthread = CreateThread(NULL, 0, aimboat, NULL, CREATE_SUSPENDED, NULL);
HANDLE proxthread = CreateThread(NULL, 0, proxbeep, NULL, CREATE_SUSPENDED, NULL);
std::cout << "F6 to update entities" << std::endl << "F7 to switch head/chest" << std::endl << "Caps Lock to toggle aimbot" << std::endl;
std::cout << "left Alt for screen beep check" << std::endl;
//-------------------------------------------------------------------------------
// CONTROLS
while (true)
{
Sleep(500);
if (GetAsyncKeyState(VK_CAPITAL)) // toggle aimbot thread
{
if (!toggle)
ResumeThread(aimthread);
else
SuspendThread(aimthread);
toggle = !toggle;
}
if (GetAsyncKeyState(VK_NUMLOCK)) // toggle aimbot thread
{
if (!toggle)
ResumeThread(proxthread);
else
SuspendThread(proxthread);
toggle2 = !toggle2;
}
if (GetAsyncKeyState(VK_F7)) // toggle head/chest
{
if (!gunmode)
boneID = bone_chest;
else
boneID = bone_head;
gunmode = !gunmode;
}
if (GetAsyncKeyState(VK_F6))
{
entlist.CycleEntities(); // update entity list
}
}
//--------------------------------------------------------------------------------
return 0;
}