forked from faggotman69/Prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateMove.h
More file actions
145 lines (115 loc) · 3.45 KB
/
CreateMove.h
File metadata and controls
145 lines (115 loc) · 3.45 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
#pragma once
#include "HookIncludes.h"
#include "Misc.h"
#include "RageBot.h"
#include "LegitBot.h"
#include "GrenadePrediction.h"
#include "LagComp.h"
#include "ESP.h"
#include "OverrideView.h"
using create_move_t = void(__thiscall *)(IBaseClientDLL *, int, float, bool);
QAngle qLastTickAngles = QAngle(0.0f, 0.0f, 0.0f);
void __stdcall CHLCreateMove(int sequence_number, float input_sample_frametime, bool active, bool& bSendPacket)
{
static auto ofunc = hooks::client.get_original<create_move_t>(21);
ofunc(g_CHLClient, sequence_number, input_sample_frametime, active);
C_BaseEntity *local = g_EntityList->GetClientEntity(g_Engine->GetLocalPlayer());
CInput::CUserCmd *cmd = g_Input->GetUserCmd(0, sequence_number);
if (!cmd)
return;
static float next_time = 0;
if (!Globals::ySwitch && local->IsAlive() && local->GetVelocity().Length2D() == 0)
{
float TickStuff = TICKS_TO_TIME(local->GetTickBase());
Globals::shouldflip = false;
bool moveFlip;
Globals::NextTime = next_time;
if (next_time - TICKS_TO_TIME(local->GetTickBase()) > 1.1)
{
next_time = 0;
}
if (local->GetVelocity().Length2D() > 1)
{
moveFlip = true;
}
if (local->GetVelocity().Length2D() == 0 && !moveFlip)
{
if (TickStuff > next_time + 1.1f)
{
next_time = TickStuff + TICKS_TO_TIME(1);
Globals::shouldflip = true;
}
}
else if (moveFlip && local->GetVelocity().Length2D() == 0)
{
if (TickStuff > next_time + 0.22f)
{
next_time = TickStuff + TICKS_TO_TIME(1);
Globals::shouldflip = true;
moveFlip = false;
}
}
}
if (!cmd->command_number)
return;
CInput::CVerifiedUserCmd *verifiedCommands = *(CInput::CVerifiedUserCmd **)(reinterpret_cast< uint32_t >(g_Input) + 0xF0);
CInput::CVerifiedUserCmd *verified = &verifiedCommands[sequence_number % 150];
if (!verified)
return;
if (!local)
return;
QAngle oldAngle = cmd->viewangles;
float oldForward = cmd->forwardmove;
float oldSideMove = cmd->sidemove;
backtracking->legitBackTrack(cmd, local);
backtracking->RageBackTrack(cmd, local);
RankReveal(cmd);
misc::instance().OnCreateMove(cmd, local);
if (GetAsyncKeyState(g_Options.Misc.iFreeCamKey) && g_Options.Misc.bFreeCam)
{
cmd->forwardmove = 0;
cmd->sidemove = 0;
}
if (g_Options.Misc.AutoStrafe)
{
misc::AutoStrafe(cmd, local, cmd->viewangles);
}
legitbot::instance().OnCreateMove(cmd, local);
ragebot::instance().OnCreateMove(cmd, bSendPacket);
grenade_prediction::instance().Tick(cmd->buttons);
if (!bSendPacket && g_Options.Ragebot.YawFake) qLastTickAngles = cmd->viewangles;
else if (bSendPacket && !g_Options.Ragebot.YawFake) qLastTickAngles = cmd->viewangles;
if (g_Options.Misc.antiuntrusted)
if (!sanitize_angles(cmd->viewangles))
return;
movementfix(oldAngle, cmd);
if (g_Options.Misc.antiuntrusted)
clampMovement(cmd);
verified->m_cmd = *cmd;
verified->m_crc = cmd->GetChecksum();
if (Globals::ySwitch) {
Globals::FakeAngle = cmd->viewangles.y;
}
else {
Globals::RealAngle = cmd->viewangles.y;
}
}
#pragma warning(disable : 4409)
__declspec(naked) void __stdcall hkCreateMove(int sequence_number, float input_sample_frametime, bool active)
{
__asm
{
PUSH EBP
MOV EBP, ESP
PUSH EBX
LEA ECX, [ESP]
PUSH ECX
PUSH active
PUSH input_sample_frametime
PUSH sequence_number
CALL CHLCreateMove
POP EBX
POP EBP
RETN 0xC
}
}