-
Notifications
You must be signed in to change notification settings - Fork 0
/
hack.h
executable file
·186 lines (155 loc) · 4.44 KB
/
hack.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
#ifndef __HACK_H_
#define __HACK_H_
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/keysymdef.h>
#include <X11/extensions/XTest.h>
#include <chrono>
#include <thread>
#include <stddef.h>
#include <libconfig.h++>
#include <iostream>
#include <atomic>
#include <cmath>
#include <mutex>
#include <math.h>
#include <memory.h>
#include <boost/thread/locks.hpp>
#include <boost/thread/shared_mutex.hpp>
#include "offsets.h"
#include "remote.h"
#include "types.h"
#include "helper.h"
using namespace std;
using namespace libconfig;
#define TEAM_SPECTATOR 1
#define LIFE_ALIVE 0 // alive
#define LIFE_DYING 1 // playing death animation or still falling off of a ledge waiting to hit ground
#define LIFE_DEAD 2 // dead. lying still.
#define LIFE_RESPAWNABLE 3
#define LIFE_DISCARDBODY 4
#define ON_GROUND (1<<0)
#define MAX_TRAIL_LENGTH 30
#define MAX_PLAYER_NAME_LENGTH 128
class hack {
template<class T> class CUtlVector {
public:
T* DataPtr; // 0000 (054612C0)
unsigned int Max; // 0004 (054612C4)
unsigned int unk02; // 0008 (054612C8)
unsigned int Count; // 000C (054612CC)
unsigned int DataPtrBack; // 0010 (054612D0)
};
public:
struct GlowObjectDefinition_t {
bool ShouldDraw( int nSlot ) const {
return m_pEntity && ( m_nSplitScreenSlot == -1 || m_nSplitScreenSlot == nSlot ) && ( m_bRenderWhenOccluded || m_bRenderWhenUnoccluded );
}
bool IsUnused() const {
return m_nNextFreeSlot != GlowObjectDefinition_t::ENTRY_IN_USE;
}
long writeStart() {
return (long(&(this)->m_flGlowRed) - long(this));
}
long writeEnd() {
return (long(&(this)->unk2) - long(this));
}
void* m_pEntity;
float m_flGlowRed;
float m_flGlowGreen;
float m_flGlowBlue;
float m_flGlowAlpha;
uint8_t unk0[16];
bool m_bRenderWhenOccluded : 8;
bool m_bRenderWhenUnoccluded : 8;
bool m_bFullBloomRender : 8;
unsigned char unk1;
int m_nFullBloomStencilTestValue;
int m_nSplitScreenSlot;
int m_nNextFreeSlot;
unsigned char unk2[4];
static const int END_OF_FREE_LIST = -1;
static const int ENTRY_IN_USE = -2;
}; // sizeof() == 0x34
class CGlowObjectManager
{
public:
CUtlVector<GlowObjectDefinition_t> m_GlowObjectDefinitions; // 0000
int m_nFirstFreeSlot; // 0014 (054612D4)
unsigned int unk1; // 0018 (054612D8)
unsigned int unk2; // 001C (054612DC)
unsigned int unk3; // 0020 (054612E0)
unsigned int unk4; // 0024 (054612E4)
unsigned int unk5; // 0028 (054612E8)
};
public:
void init();
bool checkKeys();
void bhop();
void noFlash();
bool glow();
void trigger();
void aim();
void setFov();
void setHands();
void setVAng(QAngle *newAngle, unsigned long addressOfViewAngle);
int getClosestBone(unsigned long m_pStudioBones, std::vector<int> &bones, QAngle &curViewAngle, QAngle &aimPunch, Vector &myPos);
int getLifeState(unsigned long entityPtr);
void setIsConnected();
std::atomic<bool> isConnected;
void readEntities(std::array<EntityInfo,64> &rentities);
void writeEntities(std::array<EntityInfo,64> &wentities);
bool getWorldToScreenData(std::array<EntityToScreen,64> &output);
boost::shared_mutex entities_access;
std::array<EntityInfo,64> entities;
std::array<std::pair<Vector,Vector>,64> screenPositions;
remote::Handle csgo;
Display* display;
Screen* screen;
char keys[32];
char lastkeys[32];
remote::MapModuleMemoryRegion client;
remote::MapModuleMemoryRegion engine;
double* colors;
int keycodeBhop;
int keycodeTrigger;
int keycodeGlow;
int keycodeNoFlash;
int keycodeRage;
int keycodeRCS;
unsigned char spotted;
int toggleOn = 5;
int toggleOff = 4;
//
std::atomic<bool> entityInCrossHair;
//static addresses (set at hack::init())
unsigned long m_addressOfGlowPointer;
unsigned long m_addressOfLocalPlayer;
unsigned long m_addressOfForceAttack;
unsigned long m_addressOfAlt1;
unsigned long m_addressOfAlt2;
unsigned long m_addressOfJump;
unsigned long basePointerOfViewAngle;
unsigned long addressServerDetail;
unsigned long addressIsConnected;
//settings
Config cfg;
bool ShouldGlow;
bool ShouldTrigger;
bool ShouldBhop;
bool NoFlash;
bool alwaysRCS;
int bone;
std::vector<int> bones;
float flashMax;
float fov;
bool rage;
float percentSmoothing;
int viewFov;
bool noHands;
bool resolver;
bool shootFriends;
};
extern hack h;
#endif