-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
249 lines (221 loc) · 5.7 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
245
246
247
248
249
#include "main.h"
typedef struct player
{
float dist = 0;
int entity_team = 0;
float boxMiddle = 0;
float h_y = 0;
float width = 0;
float height = 0;
float b_x = 0;
float b_y = 0;
bool knocked = false;
bool visible = false;
int health = 0;
int shield = 0;
char name[33] = { 0 };
}player;
uint32_t check = 0xABCD;
int aim_key = VK_RBUTTON;
int shoot_key = VK_LBUTTON;
bool use_nvidia = true;
bool active = true;
bool ready = false;
extern visuals v;
int aim = 0; //read
bool esp = false; //read
bool item_glow = false;
bool player_glow = false;
bool aim_no_recoil = true;
bool aiming = false; //read
uint64_t g_Base = 0; //write
float max_dist = 200.0f * 40.0f; //read
float smooth = 12.0f;
float max_fov = 15.0f;
int bone = 2;
bool thirdperson = false;
int spectators = 0; //write
int allied_spectators = 0; //write
bool chargerifle = false;
bool shooting = false; //read
bool valid = false; //write
bool next = false; //read write
uint64_t add[20];
bool k_f5 = 0;
bool k_f6 = 0;
bool k_f8 = 0;
bool IsKeyDown(int vk)
{
return (GetAsyncKeyState(vk) & 0x8000) != 0;
}
player players[100];
void Overlay::RenderEsp()
{
next = false;
if (g_Base != 0 && esp)
{
memset(players, 0, sizeof(players));
while (!next && esp)
{
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
if (next && valid)
{
ImGui::SetNextWindowPos(ImVec2(0, 0));
ImGui::SetNextWindowSize(ImVec2((float)getWidth(), (float)getHeight()));
ImGui::Begin(XorStr("##esp"), (bool*)true, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoBringToFrontOnFocus);
for (int i = 0; i < 100; i++)
{
if (players[i].health > 0)
{
std::string distance = std::to_string(players[i].dist / 39.62);
distance = distance.substr(0, distance.find('.')) + "m(" + std::to_string(players[i].entity_team) + ")";
if (v.box)
{
if (players[i].visible)
{
if (players[i].dist < 1600.0f)
DrawBox(RED, players[i].boxMiddle, players[i].h_y, players[i].width, players[i].height); //BOX
else
DrawBox(ORANGE, players[i].boxMiddle, players[i].h_y, players[i].width, players[i].height); //BOX
}
else
{
DrawBox(WHITE, players[i].boxMiddle, players[i].h_y, players[i].width, players[i].height); //white if player not visible
}
}
if(v.line)
DrawLine(ImVec2((float)(getWidth() / 2), (float)getHeight()), ImVec2(players[i].b_x, players[i].b_y), BLUE, 1); //LINE FROM MIDDLE SCREEN
if (v.distance)
{
if (players[i].knocked)
String(ImVec2(players[i].boxMiddle, (players[i].b_y + 1)), RED, distance.c_str()); //DISTANCE
else
String(ImVec2(players[i].boxMiddle, (players[i].b_y + 1)), GREEN, distance.c_str()); //DISTANCE
}
if(v.healthbar)
ProgressBar((players[i].b_x - (players[i].width / 2.0f) - 4), (players[i].b_y - players[i].height), 3, players[i].height, players[i].health, 100); //health bar
if (v.shieldbar)
ProgressBar((players[i].b_x + (players[i].width / 2.0f) + 1), (players[i].b_y - players[i].height), 3, players[i].height, players[i].shield, 125); //shield bar
if(v.name)
String(ImVec2(players[i].boxMiddle, (players[i].b_y - players[i].height - 15)), WHITE, players[i].name);
}
}
ImGui::End();
}
}
}
int main(int argc, char** argv)
{
add[0] = (uintptr_t)✓
add[1] = (uintptr_t)&aim;
add[2] = (uintptr_t)&esp;
add[3] = (uintptr_t)&aiming;
add[4] = (uintptr_t)&g_Base;
add[5] = (uintptr_t)&next;
add[6] = (uintptr_t)&players[0];
add[7] = (uintptr_t)&valid;
add[8] = (uintptr_t)&max_dist;
add[9] = (uintptr_t)&item_glow;
add[10] = (uintptr_t)&player_glow;
add[11] = (uintptr_t)&aim_no_recoil;
add[12] = (uintptr_t)&smooth;
add[13] = (uintptr_t)&max_fov;
add[14] = (uintptr_t)&bone;
add[15] = (uintptr_t)&thirdperson;
add[16] = (uintptr_t)&spectators;
add[17] = (uintptr_t)&allied_spectators;
add[18] = (uintptr_t)&chargerifle;
add[19] = (uintptr_t)&shooting;
printf(XorStr("add offset: 0x%I64x\n"), (uint64_t)&add[0] - (uint64_t)GetModuleHandle(NULL));
Overlay ov1 = Overlay();
ov1.Start();
printf(XorStr("Waiting for host process...\n"));
while (check == 0xABCD)
{
if (IsKeyDown(VK_F4))
{
active = false;
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
if (active)
{
ready = true;
printf(XorStr("Ready\n"));
}
while (active)
{
std::this_thread::sleep_for(std::chrono::milliseconds(1));
if (IsKeyDown(VK_F4))
{
active = false;
}
if (IsKeyDown(VK_F5) && k_f5 == 0)
{
k_f5 = 1;
esp = !esp;
}
else if (!IsKeyDown(VK_F5) && k_f5 == 1)
{
k_f5 = 0;
}
if (IsKeyDown(VK_F6) && k_f6 == 0)
{
k_f6 = 1;
switch (aim)
{
case 0:
aim = 1;
break;
case 1:
aim = 2;
break;
case 2:
aim = 0;
break;
default:
break;
}
}
else if (!IsKeyDown(VK_F6) && k_f6 == 1)
{
k_f6 = 0;
}
if (IsKeyDown(VK_F8) && k_f8 == 0)
{
k_f8 = 1;
item_glow = !item_glow;
}
else if (!IsKeyDown(VK_F8) && k_f8 == 1)
{
k_f8 = 0;
}
if (IsKeyDown(VK_LEFT))
{
if (max_dist > 100.0f * 40.0f)
max_dist -= 50.0f * 40.0f;
std::this_thread::sleep_for(std::chrono::milliseconds(130));
}
if (IsKeyDown(VK_RIGHT))
{
if (max_dist < 800.0f * 40.0f)
max_dist += 50.0f * 40.0f;
std::this_thread::sleep_for(std::chrono::milliseconds(130));
}
if (IsKeyDown(aim_key))
aiming = true;
else
aiming = false;
if (IsKeyDown(shoot_key))
shooting = true;
else
shooting = false;
}
ready = false;
ov1.Clear();
if(!use_nvidia)
system(XorStr("taskkill /F /T /IM overlay_ap.exe")); //custom overlay process name
return 0;
}