forked from alimb2/Ayyware-Full-Fixed-Updated-2019
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MiscHacks.cpp
359 lines (301 loc) · 7.1 KB
/
MiscHacks.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
// Don't take credits for this ;) Joplin / Manhhao are the first uploaders ;)
#define _CRT_SECURE_NO_WARNINGS
#include "MiscHacks.h"
#include "Interfaces.h"
#include "RenderManager.h"
#include <time.h>
template<class T, class U>
inline T clamp(T in, U low, U high)
{
if (in <= low)
return low;
else if (in >= high)
return high;
else
return in;
}
inline float bitsToFloat(unsigned long i)
{
return *reinterpret_cast<float*>(&i);
}
inline float FloatNegate(float f)
{
return bitsToFloat(FloatBits(f) ^ 0x80000000);
}
Vector AutoStrafeView;
void CMiscHacks::Init()
{
// Any init
}
void CMiscHacks::Draw()
{
// Any drawing
// Spams
switch (Menu::Window.MiscTab.OtherChatSpam.GetIndex())
{
case 0:
// No Chat Spam
break;
case 1:
// Namestealer
ChatSpamName();
break;
case 2:
// Regular
ChatSpamRegular();
break;
case 3:
// Interwebz
ChatSpamInterwebz();
break;
case 4:
// Report Spam
ChatSpamDisperseName();
break;
}
}
void CMiscHacks::Move(CUserCmd *pCmd, bool &bSendPacket)
{
// Any Move Stuff
// Bhop
switch (Menu::Window.MiscTab.OtherAutoJump.GetIndex())
{
case 0:
break;
case 1:
AutoJump(pCmd);
break;
}
// AutoStrafe
Interfaces::Engine->GetViewAngles(AutoStrafeView);
switch (Menu::Window.MiscTab.OtherAutoStrafe.GetIndex())
{
case 0:
// Off
break;
case 1:
LegitStrafe(pCmd);
break;
case 2:
RageStrafe(pCmd);
break;
}
//Fake Lag
if (Menu::Window.MiscTab.FakeLagEnable.GetState())
Fakelag(pCmd, bSendPacket);
}
static __declspec(naked) void __cdecl Invoke_NET_SetConVar(void* pfn, const char* cvar, const char* value)
{
__asm
{
push ebp
mov ebp, esp
and esp, 0FFFFFFF8h
sub esp, 44h
push ebx
push esi
push edi
mov edi, cvar
mov esi, value
jmp pfn
}
}
void DECLSPEC_NOINLINE NET_SetConVar(const char* value, const char* cvar)
{
static DWORD setaddr = Utilities::Memory::FindPattern("engine.dll", (PBYTE)"\x8D\x4C\x24\x1C\xE8\x00\x00\x00\x00\x56", "xxxxx????x");
if (setaddr != 0)
{
void* pvSetConVar = (char*)setaddr;
Invoke_NET_SetConVar(pvSetConVar, cvar, value);
}
}
void change_name(const char* name)
{
if (Interfaces::Engine->IsInGame() && Interfaces::Engine->IsConnected())
NET_SetConVar(name, "name");
}
void CMiscHacks::AutoJump(CUserCmd *pCmd)
{
if (pCmd->buttons & IN_JUMP && GUI.GetKeyState(VK_SPACE))
{
int iFlags = hackManager.pLocal()->GetFlags();
if (!(iFlags & FL_ONGROUND))
pCmd->buttons &= ~IN_JUMP;
if (hackManager.pLocal()->GetVelocity().Length() <= 50)
{
pCmd->forwardmove = 450.f;
}
}
}
void CMiscHacks::LegitStrafe(CUserCmd *pCmd)
{
IClientEntity* pLocal = hackManager.pLocal();
if (!(pLocal->GetFlags() & FL_ONGROUND))
{
pCmd->forwardmove = 0.0f;
if (pCmd->mousedx < 0)
{
pCmd->sidemove = -450.0f;
}
else if (pCmd->mousedx > 0)
{
pCmd->sidemove = 450.0f;
}
}
}
void CMiscHacks::RageStrafe(CUserCmd *pCmd)
{
IClientEntity* pLocal = hackManager.pLocal();
bool bKeysPressed = true;
if (GUI.GetKeyState(0x41) || GUI.GetKeyState(0x57) || GUI.GetKeyState(0x53) || GUI.GetKeyState(0x44)) bKeysPressed = false;
if ((GetAsyncKeyState(VK_SPACE) && !(pLocal->GetFlags() & FL_ONGROUND)) && bKeysPressed)
{
if (pCmd->mousedx > 1 || pCmd->mousedx < -1) {
pCmd->sidemove = pCmd->mousedx < 0.f ? -450.f : 450.f;
}
else {
pCmd->forwardmove = (1800.f * 4.f) / pLocal->GetVelocity().Length2D();
pCmd->sidemove = (pCmd->command_number % 2) == 0 ? -450.f : 450.f;
if (pCmd->forwardmove > 450.f)
pCmd->forwardmove = 450.f;
}
}
/* IClientEntity* pLocal = hackManager.pLocal();
static bool bDirection = true;
static float move = 450; //400.f; // move = max(move, (abs(cmd->move.x) + abs(cmd->move.y)) * 0.5f);
float s_move = move * 0.5065f;
if ((pCmd->buttons & IN_JUMP) || !(pLocal->GetFlags() & FL_ONGROUND))
{
pCmd->forwardmove = move * 0.015f;
pCmd->sidemove += (float)(((pCmd->tick_count % 2) * 2) - 1) * s_move;
if (pCmd->mousedx)
pCmd->sidemove = (float)clamp(pCmd->mousedx, -1, 1) * s_move;
static float strafe = pCmd->viewangles.y;
float rt = pCmd->viewangles.y, rotation;
rotation = strafe - rt;
if (rotation < FloatNegate(Interfaces::Globals->interval_per_tick))
pCmd->sidemove = -s_move;
if (rotation > Interfaces::Globals->interval_per_tick)
pCmd->sidemove = s_move;
strafe = rt;
} */
}
Vector GetAutostrafeView()
{
return AutoStrafeView;
}
// …e սʿ
void CMiscHacks::ChatSpamInterwebz()
{
static clock_t start_t = clock();
double timeSoFar = (double)(clock() - start_t) / CLOCKS_PER_SEC;
if (timeSoFar < 0.001)
return;
static bool wasSpamming = true;
//static std::string nameBackup = "INTERWEBZ";
if (wasSpamming)
{
static bool useSpace = true;
if (useSpace)
{
change_name ("INTERWEBZ-");
useSpace = !useSpace;
}
else
{
change_name("-INTERWEBZ");
useSpace = !useSpace;
}
}
start_t = clock();
}
void CMiscHacks::ChatSpamDisperseName()
{
static clock_t start_t = clock();
double timeSoFar = (double)(clock() - start_t) / CLOCKS_PER_SEC;
if (timeSoFar < 0.001)
return;
static bool wasSpamming = true;
//static std::string nameBackup = "INTERWEBZ";
if (wasSpamming)
{
change_name("\n…e…e…e\n");
}
start_t = clock();
}
void CMiscHacks::ChatSpamName()
{
static clock_t start_t = clock();
double timeSoFar = (double)(clock() - start_t) / CLOCKS_PER_SEC;
if (timeSoFar < 0.001)
return;
std::vector < std::string > Names;
for (int i = 0; i < Interfaces::EntList->GetHighestEntityIndex(); i++)
{
// Get the entity
IClientEntity *entity = Interfaces::EntList->GetClientEntity(i);
player_info_t pInfo;
// If it's a valid entity and isn't the player
if (entity && hackManager.pLocal()->GetTeamNum() == entity->GetTeamNum() && entity != hackManager.pLocal())
{
ClientClass* cClass = (ClientClass*)entity->GetClientClass();
// If entity is a player
if (cClass->m_ClassID == (int)CSGOClassID::CCSPlayer)
{
if (Interfaces::Engine->GetPlayerInfo(i, &pInfo))
{
if (!strstr(pInfo.name, "GOTV"))
Names.push_back(pInfo.name);
}
}
}
}
static bool wasSpamming = true;
//static std::string nameBackup = "INTERWEBZ.CC";
int randomIndex = rand() % Names.size();
char buffer[128];
sprintf_s(buffer, "%s ", Names[randomIndex].c_str());
if (wasSpamming)
{
change_name(buffer);
}
else
{
change_name ("p$i 1337");
}
start_t = clock();
}
void CMiscHacks::ChatSpamRegular()
{
// Don't spam it too fast so you can still do stuff
static clock_t start_t = clock();
int spamtime = Menu::Window.MiscTab.OtherChatDelay.GetValue();
double timeSoFar = (double)(clock() - start_t) / CLOCKS_PER_SEC;
if (timeSoFar < spamtime)
return;
static bool holzed = true;
if (Menu::Window.MiscTab.OtherTeamChat.GetState())
{
SayInTeamChat("INTERWEBZ.CC OWNS ME AND ALL");
}
else
{
SayInChat("INTERWEBZ.CC OWNS ME AND ALL");
}
start_t = clock();
}
void CMiscHacks::Fakelag(CUserCmd *pCmd, bool &bSendPacket)
{
int iChoke = Menu::Window.MiscTab.FakeLagChoke.GetValue();
static int iFakeLag = -1;
iFakeLag++;
if (iFakeLag <= iChoke && iFakeLag > -1)
{
bSendPacket = false;
}
else
{
bSendPacket = true;
iFakeLag = -1;
}
}