-
Notifications
You must be signed in to change notification settings - Fork 0
/
Createmove.h
270 lines (213 loc) · 7.43 KB
/
Createmove.h
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
#include "Hooks.h"
#include "checksum_md5.h"
#include "NetChannelhook.h"
#include "WriteUsercmdDeltaToBuffer.h"
#include "RunCommand.h"
void __stdcall Hooked_CreateMove(int sequence_number, float input_sample_frametime, bool active, bool& bSendPacket)
{
static auto CreateMove = g_pClientHook->GetOriginal< CreateMoveFn >(g_HookIndices[fnva1(hs::Hooked_CreateMove.s().c_str())]);
CreateMove(interfaces.client, sequence_number, input_sample_frametime, active);
csgo->updatelocalplayer();
auto cmd = interfaces.input->GetUserCmd(sequence_number);
if (!cmd || !cmd->command_number || !csgo->local || csgo->DoUnload)
return CreateMove(interfaces.client, sequence_number, input_sample_frametime, active);
csgo->in_cm = true;
csgo->cmd = cmd;
csgo->original = cmd->viewangles;
csgo->send_packet = true;
csgo->shift_amount = 0;
g_Misc->Clantag();
g_Misc->ProcessMissedShots();
g_Misc->FixMouseInput();
INetChannel* pNetChannel = (INetChannel*)csgo->client_state->pNetChannel;
if (csgo->local->isAlive())
{
static bool toggle_hs = false;
static bool toggle_dt = false;
if (g_Binds[bind_hide_shots].active) {
if (!toggle_hs) {
g_Misc->hide_shots_key = true;
toggle_hs = true;
}
}
else
toggle_hs = false;
if (g_Binds[bind_double_tap].active) {
if (!toggle_dt) {
g_Misc->double_tap_key = true;
toggle_dt = true;
}
}
else
toggle_dt = false;
if (g_Misc->double_tap_key && g_Binds[bind_hide_shots].key != g_Binds[bind_double_tap].key)
g_Misc->hide_shots_key = false;
if (g_Misc->hide_shots_key && g_Binds[bind_double_tap].key != g_Binds[bind_hide_shots].key)
g_Misc->double_tap_key = false;
bool shit = g_Misc->double_tap_enabled && g_Misc->double_tap_key || g_Misc->hide_shots_enabled && g_Misc->hide_shots_key;
if (csgo->skip_ticks < 16 &&
shit) {
csgo->need_to_recharge = true;
}
if (g_Misc->hs_works)
csgo->fixed_tickbase = csgo->local->GetTickBase() - 6;
else
csgo->fixed_tickbase = csgo->local->GetTickBase();
csgo->tick_rate = 1.f / interfaces.global_vars->interval_per_tick;
csgo->vecUnpredictedVel = csgo->local->GetVelocity();
csgo->unpdred_tick = interfaces.global_vars->tickcount;
csgo->weapon = csgo->local->GetWeapon();
csgo->origin = csgo->local->GetOrigin();
csgo->unpred_eyepos = csgo->local->GetEyePosition();
csgo->duck_amount = csgo->local->GetDuckAmount();
if (csgo->weapon)
{
csgo->unpred_inaccuracy = csgo->weapon->GetInaccuracy();
csgo->weapon_range = []() {
if (const auto& info = csgo->weapon->GetCSWpnData(); info != nullptr)
return info->m_flRange;
return -1.f;
}();
csgo->exploits = g_Binds[bind_double_tap].active && g_Misc->double_tap_key
|| g_Binds[bind_hide_shots].active && g_Misc->hide_shots_key;
csgo->original_forwardmove = cmd->forwardmove;
csgo->original_sidemove = cmd->sidemove;
g_Misc->FakeDuck();
g_Ragebot->DropTarget();
g_Legit->AutoPistol();
g_AntiAim->Fakelag();
g_Bunnyhop->Run(csgo->original);
g_Misc->SlideWalk();
g_EnginePrediction->update();
g_EnginePrediction->start(csgo->local, cmd);
{
g_Resolver->StoreAntifreestand();
g_AntiAim->Initialize();
run_callback("createmove");
g_NetData->RecordViewmodelValues();
csgo->weapon_data = csgo->weapon->GetCSWpnData();
if (csgo->weapon->IsGun())
{
csgo->spread = csgo->weapon->GetSpread();
csgo->innacuracy = csgo->weapon->GetInaccuracy();
csgo->weaponspread = (csgo->spread + csgo->innacuracy) * 1000.f;
}
else
csgo->weaponspread = 0.f;
if (vars.misc.knifebot)
g_Knifebot->Run();
if (vars.ragebot.enable) {
g_Ragebot->in_ragebot = true;
g_Ragebot->Run();
g_Ragebot->in_ragebot = false;
}
csgo->eyepos = csgo->local->GetEyePosition();
if (vars.legitbot.enable && vars.legitbot.backtrack) {
g_Legit->Backtrack();
}
if (vars.antiaim.enable)
{
g_AntiAim->Run();
if (!g_AutoPeek->has_shot)
g_AntiAim->Sidemove();
}
g_Misc->Doubletap();
g_Misc->Hideshots();
g_AutoPeek->Run();
if (F::Shooting()) {
csgo->m_shot_command_number = cmd->command_number;
if (!csgo->fake_duck)
csgo->send_packet = true;
}
csgo->forcing_shot = false;
if (cmd->command_number >= csgo->m_shot_command_number
&& csgo->m_shot_command_number >= cmd->command_number - csgo->client_state->iChokedCommands) {
csgo->forcing_shot = true;
if (csgo->send_packet)
csgo->FakeAngle = interfaces.input->m_pCommands[csgo->m_shot_command_number % 150].viewangles;
else
csgo->VisualAngle = interfaces.input->m_pCommands[csgo->m_shot_command_number % 150].viewangles;
csgo->CurAngle = interfaces.input->m_pCommands[csgo->m_shot_command_number % 150].viewangles;
}
else {
if (csgo->send_packet)
csgo->FakeAngle = csgo->cmd->viewangles;
else
csgo->VisualAngle = csgo->cmd->viewangles;
csgo->CurAngle = csgo->cmd->viewangles;
}
if (vars.misc.antiuntrusted)
csgo->cmd->viewangles = Math::normalize(csgo->cmd->viewangles);
g_Animfix->UpdateFakeState();
if (!g_Misc->hs_shot)
g_Animfix->UpdateRealState();
}
g_EnginePrediction->end(csgo->local);
g_Misc->FixMovement(cmd, csgo->original);
auto& correct = csgo->c_data.emplace_front();
correct.command_number = csgo->cmd->command_number;
correct.choked_commands = csgo->client_state->iChokedCommands;
correct.tickcount = interfaces.global_vars->tickcount;
if (csgo->send_packet)
csgo->choked_number.clear();
else
csgo->choked_number.emplace_back(correct.command_number);
while (csgo->c_data.size() > (int)(1.0f / interfaces.global_vars->interval_per_tick))
csgo->c_data.pop_back();
auto& out = csgo->packets.emplace_back();
out.is_outgoing = csgo->send_packet;
out.is_used = false;
out.cmd_number = csgo->cmd->command_number;
out.previous_command_number = 0;
while (csgo->packets.size() > (int)(1.0f / interfaces.global_vars->interval_per_tick))
csgo->packets.pop_front();
if (!csgo->send_packet && !csgo->game_rules->IsValveDS())
{
auto net_channel = csgo->client_state->pNetChannel;
if (net_channel->iChokedPackets > 0 && !(net_channel->iChokedPackets % 4))
{
auto backup_choke = net_channel->iChokedPackets;
net_channel->iChokedPackets = 0;
net_channel->SendDatagram();
--net_channel->iOutSequenceNr;
net_channel->iChokedPackets = backup_choke;
}
}
g_GrenadePrediction->Tick(csgo->cmd->buttons);
}
g_Misc->UpdateDormantTime();
g_Misc->StoreTaserRange();
static INetChannel* old_net_chan = nullptr;
if (csgo->local->isAlive()) {
csgo->ping = interfaces.engine->GetNetChannelInfo()->GetLatency(FLOW_INCOMING) + interfaces.engine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING);
csgo->ping *= 1000.f;
}
}
else {
csgo->ForceOffAA = false;
csgo->should_draw_taser_range = false;
}
bSendPacket = csgo->send_packet;
csgo->last_sendpacket = csgo->send_packet;
csgo->in_cm = false;
auto verified = interfaces.input->GetVerifiedUserCmd(sequence_number);
if (verified)
{
verified->m_cmd = *cmd;
verified->m_crc = cmd->GetChecksum();
}
}
__declspec(naked) void __stdcall Hooked_CreateMove_Naked(int sequence_number, float input_sample_frametime, bool active)
{
__asm
{
push ebx
push esp
push dword ptr[esp + 20]
push dword ptr[esp + 0Ch + 8]
push dword ptr[esp + 10h + 4]
call Hooked_CreateMove
pop ebx
retn 0Ch
}
}