-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHacks.cpp
More file actions
185 lines (154 loc) · 4.48 KB
/
Copy pathHacks.cpp
File metadata and controls
185 lines (154 loc) · 4.48 KB
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
#include "Hacks.h"
#include "Interfaces.h"
#include "RenderManager.h"
#include "ESP.h"
#include "Visuals.h"
#include "RageBot.h"
#include "MiscHacks.h"
#include "LegitBot.h"
#include "settings.h"
CEsp Esp;
CVisuals Visuals;
CMiscHacks MiscHacks;//
CRageBot RageBot;
CLegitBot LegitBot;
CPlayersTab PlayersTab;
// Initialise and register ALL hackmanager hacks in here nigga
void Hacks::SetupHacks()
{
Esp.Init();
Visuals.Init();
MiscHacks.Init();
RageBot.Init();
LegitBot.Init();
hackManager.RegisterHack(&Esp);
hackManager.RegisterHack(&Visuals);
hackManager.RegisterHack(&MiscHacks);
hackManager.RegisterHack(&RageBot);
hackManager.RegisterHack(&LegitBot);
//--------------------------------
hackManager.Ready();
}
void SpecList()
{
IClientEntity *pLocal = hackManager.pLocal();
RECT scrn = Draw::GetViewport();
int x = 0;
// Loop through all active entitys
for (int i = 0; i < I::EntList->GetHighestEntityIndex(); i++)
{
// Get the entity
IClientEntity *pEntity = I::EntList->GetClientEntity(i);
player_info_t pinfo;
// The entity isn't some laggy peice of shit or something
if (pEntity && pEntity != pLocal)
{
if (I::Engine->GetPlayerInfo(i, &pinfo) && !pEntity->IsAlive() && !pEntity->IsDormant())
{
HANDLE obs = pEntity->GetObserverTargetHandle();
if (obs)
{
IClientEntity *pTarget = I::EntList->GetClientEntityFromHandle(obs);
player_info_t pinfo2;
if (pTarget)
{
if (I::Engine->GetPlayerInfo(pTarget->GetIndex(), &pinfo2))
{
char buf[255]; sprintf_s(buf, "%s -> %s", pinfo.name, pinfo2.name);
RECT TextSize = Draw::GetTextSize(Draw::Fonts::ESP, buf);
Draw::Clear(scrn.right - 300, 350 + (16 * x), 260, 16, Color(39, 39, 39, 255));
Draw::Text((scrn.right - 300 + 130) - (TextSize.right / 2),
350 + (16 * x),
pTarget->GetIndex() == pLocal->GetIndex() ? globals.forecolor : Color(255, 255, 255, 255),
Draw::Fonts::ESP,
buf);
x++;
}
}
}
}
}
}
Draw::Clear(scrn.right - 308, 350 - 18, 276, 18, Color(28, 28, 28, 255)); //top
RECT TitleSize = Draw::GetTextSize(Draw::Fonts::MenuBold, "Spectators");
Draw::Text(scrn.right - 308 + 5,
350 - 10 - (TitleSize.bottom / 2),
Color(255, 255, 255, 255),
Draw::Fonts::MenuBold,
"Spectators");
Draw::Clear(scrn.right - 308, 350 + (16 * x), 276, 8, Color(28, 28, 28, 255)); //bottom
Draw::Clear(scrn.right - 308, 350, 8, (16 * x), Color(28, 28, 28, 255)); //left
Draw::Clear(scrn.right - 316 + 276, 350, 8, (16 * x), Color(28, 28, 28, 255)); //right
}
// Only gets called in game, use a seperate draw UI call for menus in the hook
void Hacks::DrawHacks()
{
// Spectator List
if (miscconfig.bSpectatorList)
SpecList();
hackManager.Draw();
//--------------------------------
}
// Game Cmd Changes
void Hacks::MoveHacks(CUserCmd *pCmd, bool& bSendPacket)
{
Vector origView = pCmd->viewangles;
hackManager.Move(pCmd, bSendPacket);
// ------------------------------
// Put it in here so it's applied AFTER the aimbot
int AirStuckKey = Menu::Window.MiscTab.AirStuckKey.GetKey();
if (AirStuckKey > 0 && GUI.GetKeyState(AirStuckKey))
{
if (!(pCmd->buttons & IN_ATTACK))
pCmd->tick_count = 0xFFFFF;
}
}
//---------------------------------------------------------------------//
HackManager hackManager;
// Register a new hack
void HackManager::RegisterHack(CHack* hake)
{
Hacks.push_back(hake);
hake->Init();
}
// Draw all the hakes
void HackManager::Draw()
{
if (!IsReady)
return;
// Grab the local player for drawing related hacks
pLocalInstance = I::EntList->GetClientEntity(I::Engine->GetLocalPlayer());
if (!pLocalInstance) return;
for (auto &hack : Hacks)
{
hack->Draw();
}
}
// Handle all the move hakes
void HackManager::Move(CUserCmd *pCmd, bool& bSendPacket)
{
if (!IsReady)
return;
// Grab the local player for move related hacks
pLocalInstance = I::EntList->GetClientEntity(I::Engine->GetLocalPlayer());
if (!pLocalInstance) return;
for (auto &hack : Hacks)
{
hack->Move(pCmd, bSendPacket);
}
}
//---------------------------------------------------------------------//
// Other Utils and shit
// Saves hacks needing to call a bunch of virtuals to get the instance
// Saves on cycles and file size. Recycle your plastic kids
IClientEntity* HackManager::pLocal()
{
return pLocalInstance;
}
// Makes sure none of the hacks are called in their
// hooks until they are completely ready for use
void HackManager::Ready()
{
IsReady = true;
}
// https://steamcommunity.com/id/simplerealistic/