forked from sstokic-tgm/Gladiatorcheatz-v2.1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Structs.hpp
502 lines (427 loc) · 15.2 KB
/
Structs.hpp
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
#pragma once
#include "SDK.hpp"
#include "helpers/Utils.hpp"
#define NETVAR(type, name, table, netvar) \
type& name##() const { \
static int _##name = NetMngr::Get().getOffs(table, netvar); \
return *(type*)((uintptr_t)this + _##name); \
}
#define NETVARADDOFFS(type, name, table, netvar, offs) \
type& name##() const { \
static int _##name = NetMngr::Get().getOffs(table, netvar) + offs; \
return *(type*)((uintptr_t)this + _##name); \
}
#define PNETVAR(type, name, table, netvar) \
type* name##() const { \
static int _##name = NetMngr::Get().getOffs(table, netvar); \
return (type*)((uintptr_t)this + _##name); \
}
enum CSWeaponType
{
WEAPONTYPE_KNIFE = 0,
WEAPONTYPE_PISTOL,
WEAPONTYPE_SUBMACHINEGUN,
WEAPONTYPE_RIFLE,
WEAPONTYPE_SHOTGUN,
WEAPONTYPE_SNIPER_RIFLE,
WEAPONTYPE_MACHINEGUN,
WEAPONTYPE_C4,
WEAPONTYPE_PLACEHOLDER,
WEAPONTYPE_GRENADE,
WEAPONTYPE_UNKNOWN
};
class VarMapEntry_t
{
public:
unsigned short type;
unsigned short m_bNeedsToInterpolate; // Set to false when this var doesn't
// need Interpolate() called on it anymore.
void *data;
void *watcher;
};
struct VarMapping_t
{
CUtlVector<VarMapEntry_t> m_Entries;
int m_nInterpolatedEntries;
float m_lastInterpolationTime;
};
struct Item_t;
struct WeaponName_t;
struct QualityName_t;
class AnimationLayer;
class C_CSGOPlayerAnimState;
class C_BaseEntity;
class CStudioHdr;
class WeapInfo_t
{
public:
__int32 weapon_type()
{
return *reinterpret_cast<__int32*>(reinterpret_cast<uintptr_t>(this) + 0xC8);
}
__int32 m_iDamage()
{
return *reinterpret_cast<__int32*>(reinterpret_cast<uintptr_t>(this) + 0xF0);
}
float m_fArmorRatio()
{
return *reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(this) + 0xF4);
}
float m_fPenetration()
{
return *reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(this) + 0xFC);
}
float m_fRange()
{
return *reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(this) + 0x108);
}
float m_fRangeModifier()
{
return *reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(this) + 0x10C);
}
bool m_bHasSilencer()
{
return *reinterpret_cast<bool*>(reinterpret_cast<uintptr_t>(this) + 0x120);
}
};
class C_BaseEntity : public IClientEntity
{
public:
static __forceinline C_BaseEntity* GetEntityByIndex(int index)
{
return static_cast<C_BaseEntity*>(g_EntityList->GetClientEntity(index));
}
static __forceinline C_BaseEntity* get_entity_from_handle(CBaseHandle h)
{
return static_cast<C_BaseEntity*>(g_EntityList->GetClientEntityFromHandle(h));
}
datamap_t *GetDataDescMap()
{
typedef datamap_t*(__thiscall *o_GetPredDescMap)(void*);
return VT::vfunc<o_GetPredDescMap>(this, 15)(this);
}
datamap_t *GetPredDescMap()
{
typedef datamap_t*(__thiscall *o_GetPredDescMap)(void*);
return VT::vfunc<o_GetPredDescMap>(this, 17)(this);
}
NETVAR(int32_t, m_nModelIndex, "CBaseEntity", "m_nModelIndex");
NETVAR(int32_t, m_iTeamNum, "CBaseEntity", "m_iTeamNum");
NETVAR(Vector, m_vecOrigin, "CBaseEntity", "m_vecOrigin");
NETVAR(CHandle<C_BasePlayer>, m_hOwnerEntity, "CBaseEntity", "m_hOwnerEntity");
NETVAR(int32_t, m_CollisionGroup, "CBaseEntity", "m_CollisionGroup");
NETVAR(CHandle<C_BaseEntity>, m_hWeaponWorldModel, "CBaseCombatWeapon", "m_hWeaponWorldModel");
const matrix3x4_t& m_rgflCoordinateFrame()
{
static auto _m_rgflCoordinateFrame = NetMngr::Get().getOffs("CBaseEntity", "m_CollisionGroup") - 0x30;
return *(matrix3x4_t*)((uintptr_t)this + _m_rgflCoordinateFrame);
}
void SetModelIndex(int index)
{
VT::vfunc<void(__thiscall*)(C_BaseEntity*, int)>(this, 75)(this, index);
}
bool IsPlayer();
bool IsWeapon();
bool IsPlantedC4();
bool IsDefuseKit();
unsigned int PhysicsSolidMaskForEntity();
};
class C_BaseAttributableItem : public C_BaseEntity
{
public:
NETVAR(int32_t, m_iItemDefinitionIndex, "CBaseAttributableItem", "m_iItemDefinitionIndex");
NETVAR(int32_t, m_nFallbackStatTrak, "CBaseAttributableItem", "m_nFallbackStatTrak");
NETVAR(int32_t, m_nFallbackPaintKit, "CBaseAttributableItem", "m_nFallbackPaintKit");
NETVAR(int32_t, m_nFallbackSeed, "CBaseAttributableItem", "m_nFallbackSeed");
NETVAR(float_t, m_flFallbackWear, "CBaseAttributableItem", "m_flFallbackWear");
NETVAR(int32_t, m_iAccountID, "CBaseAttributableItem", "m_iAccountID");
NETVAR(int32_t, m_iItemIDHigh, "CBaseAttributableItem", "m_iItemIDHigh");
NETVAR(int32_t, m_iEntityQuality, "CBaseAttributableItem", "m_iEntityQuality");
PNETVAR(char, m_szCustomName, "CBaseAttributableItem", "m_szCustomName");
};
class C_BaseCombatWeapon : public C_BaseAttributableItem
{
public:
NETVAR(float_t, m_flNextPrimaryAttack, "CBaseCombatWeapon", "m_flNextPrimaryAttack");
NETVAR(int16_t, m_iItemDefinitionIndex, "CBaseCombatWeapon", "m_iItemDefinitionIndex");
NETVAR(int32_t, m_iClip1, "CBaseCombatWeapon", "m_iClip1");
NETVAR(int32_t, m_iViewModelIndex, "CBaseCombatWeapon", "m_iViewModelIndex");
NETVAR(int32_t, m_iWorldModelIndex, "CBaseCombatWeapon", "m_iWorldModelIndex");
NETVAR(float_t, m_fAccuracyPenalty, "CWeaponCSBase", "m_fAccuracyPenalty");
NETVAR(int32_t, m_zoomLevel, "CWeaponCSBaseGun", "m_zoomLevel");
NETVAR(bool, m_bPinPulled, "CBaseCSGrenade", "m_bPinPulled");
NETVAR(float_t, m_fThrowTime, "CBaseCSGrenade", "m_fThrowTime");
NETVAR(float_t, m_flPostponeFireReadyTime, "CWeaponCSBase", "m_flPostponeFireReadyTime");
NETVAR(float_t, m_fLastShotTime, "CWeaponCSBase", "m_fLastShotTime");
WeapInfo_t *GetWeapInfo();
bool HasBullets();
bool CanFire();
bool IsReloading();
bool IsRifle();
bool IsPistol();
bool IsSniper();
bool IsGrenade();
float GetInaccuracy();
float GetSpread();
void UpdateAccuracyPenalty();
bool IsWeaponNonAim();
bool CanFirePostPone();
bool IsInThrow();
char* GetWeaponIcon();
};
class C_BasePlayer : public C_BaseEntity
{
public:
static __forceinline C_BasePlayer* GetPlayerByUserId(int id)
{
return static_cast<C_BasePlayer*>(GetEntityByIndex(g_EngineClient->GetPlayerForUserID(id)));
}
static __forceinline C_BasePlayer* GetPlayerByIndex(int i)
{
return static_cast<C_BasePlayer*>(GetEntityByIndex(i));
}
static __forceinline C_BasePlayer *GetLocalPlayer(const bool set = false)
{
static C_BasePlayer *local = nullptr;
if (!local || set)
local = GetPlayerByIndex(g_EngineClient->GetLocalPlayer());
return local;
}
NETVAR(bool, m_bHasDefuser, "CCSPlayer", "m_bHasDefuser");
NETVAR(bool, m_bGunGameImmunity, "CCSPlayer", "m_bGunGameImmunity");
NETVAR(int32_t, m_iShotsFired, "CCSPlayer", "m_iShotsFired");
NETVAR(QAngle, m_angEyeAngles, "CCSPlayer", "m_angEyeAngles[0]");
NETVAR(QAngle, m_angRotation, "CCSPlayer", "m_angRotation");
NETVAR(int32_t, m_ArmorValue, "CCSPlayer", "m_ArmorValue");
NETVAR(bool, m_bHasHelmet, "CCSPlayer", "m_bHasHelmet");
NETVAR(bool, m_bHasHeavyArmor, "CCSPlayer", "m_bHasHeavyArmor");
NETVAR(bool, m_bIsScoped, "CCSPlayer", "m_bIsScoped");;
NETVAR(float_t, m_flLowerBodyYawTarget, "CCSPlayer", "m_flLowerBodyYawTarget");
NETVAR(float_t, m_flFlashDuration, "CCSPlayer", "m_flFlashDuration");
NETVAR(int32_t, m_iHealth, "CBasePlayer", "m_iHealth");
NETVAR(int32_t, m_lifeState, "CBasePlayer", "m_lifeState");
NETVAR(int32_t, m_fFlags, "CBasePlayer", "m_fFlags");
NETVAR(int32_t, m_nHitboxSet, "CBasePlayer", "m_nHitboxSet");
NETVAR(int32_t, m_nTickBase, "CBasePlayer", "m_nTickBase");
NETVAR(Vector, m_vecViewOffset, "CBasePlayer", "m_vecViewOffset[0]");
NETVAR(QAngle, m_viewPunchAngle, "CBasePlayer", "m_viewPunchAngle");
NETVAR(QAngle, m_aimPunchAngle, "CBasePlayer", "m_aimPunchAngle");
NETVAR(CHandle<C_BaseViewModel>, m_hViewModel, "CBasePlayer", "m_hViewModel[0]");
NETVAR(Vector, m_vecVelocity, "CBasePlayer", "m_vecVelocity[0]");
NETVAR(float_t, m_flSimulationTime, "CBaseEntity", "m_flSimulationTime");
NETVAR(int32_t, m_nSurvivalTeam, "CCSPlayer", "m_nSurvivalTeam");
NETVARADDOFFS(float_t, m_flOldSimulationTime, "CBaseEntity", "m_flSimulationTime", 0x4);
NETVAR(float_t, m_flDuckSpeed, "CCSPlayer", "m_flDuckSpeed");
NETVAR(float_t, m_flDuckAmount, "CCSPlayer", "m_flDuckAmount");
NETVAR(bool, m_bDucked, "CCSPlayer", "m_bDucked");
NETVAR(bool, m_bDucking, "CCSPlayer", "m_bDucking");
NETVAR(float_t, m_flFallVelocity, "CBasePlayer", "m_flFallVelocity");
NETVAR(float_t, m_flStepSize, "CBaseEntity", "m_flStepSize");
NETVAR(float_t, m_flNextAttack, "CBaseCombatCharacter", "m_flNextAttack");
NETVAR(int, m_iObserverMode, "CBasePlayer", "m_iObserverMode");
NETVAR(bool, m_bClientSideAnimation, "CBasePlayer", "m_bClientSideAnimation");
NETVAR(CHandle<C_BasePlayer>, m_hObserverTarget, "CBasePlayer", "m_hObserverTarget");
NETVAR(CHandle<C_BaseCombatWeapon>, m_hActiveWeapon, "CBaseCombatCharacter", "m_hActiveWeapon");
CHandle<C_BaseCombatWeapon> *m_hMyWeapons() const
{
static int _m_hMyWeapons = NetMngr::Get().getOffs("CBaseCombatCharacter", "m_hMyWeapons");
return (CHandle<C_BaseCombatWeapon>*)((uintptr_t)this + (_m_hMyWeapons / 2));
}
PNETVAR(CHandle<C_BaseAttributableItem>, m_hMyWearables, "CBaseCombatCharacter", "m_hMyWearables");
float_t &m_surfaceFriction()
{
static unsigned int _m_surfaceFriction = Utils::FindInDataMap(GetPredDescMap(), "m_surfaceFriction");
return *(float_t*)((uintptr_t)this + _m_surfaceFriction);
}
Vector &m_vecBaseVelocity()
{
static unsigned int _m_vecBaseVelocity = Utils::FindInDataMap(GetPredDescMap(), "m_vecBaseVelocity");
return *(Vector*)((uintptr_t)this + _m_vecBaseVelocity);
}
Vector &m_vecAbsVelocity()
{
static unsigned int _m_vecAbsVelocity = Utils::FindInDataMap(GetPredDescMap(), "m_vecAbsVelocity");
return *(Vector*)((uintptr_t)this + _m_vecAbsVelocity);
}
uint32_t &m_iEFlags()
{
static unsigned int _m_iEFlags = Utils::FindInDataMap(GetPredDescMap(), "m_iEFlags");
return *(uint32_t*)((uintptr_t)this + _m_iEFlags);
}
float_t &m_flMaxspeed()
{
static unsigned int _m_flMaxspeed = Utils::FindInDataMap(GetPredDescMap(), "m_flMaxspeed");
return *(float_t*)((uintptr_t)this + _m_flMaxspeed);
}
QAngle &m_angAbsRotation()
{
return *(QAngle*)((DWORD)&m_angRotation() - 12);
}
float_t m_flSpawnTime();
bool IsTeamMate()
{
if (Utils::IsDangerZone())
return (g_LocalPlayer->m_nSurvivalTeam() == -1) ? false : (g_LocalPlayer->m_nSurvivalTeam() == this->m_nSurvivalTeam());
else
return this->m_iTeamNum() == g_LocalPlayer->m_iTeamNum();
}
std::array<float, 24> &m_flPoseParameter();
QAngle &visuals_Angles();
int32_t GetMoveType();
// Move to nice spots, if not moved, remind me to move em because I haven't tested if this is neccesarry yet since setabsangles should update matrix anyways
void SetPoseAngles(float_t yaw, float_t pitch);
void InvalidateBoneCache();
int GetNumAnimOverlays();
AnimationLayer *GetAnimOverlays();
AnimationLayer *GetAnimOverlay(int i);
int GetSequenceActivity(int sequence);
C_CSGOPlayerAnimState *GetPlayerAnimState();
static void UpdateAnimationState(C_CSGOPlayerAnimState *state, QAngle angle);
static void ResetAnimationState(C_CSGOPlayerAnimState *state);
void CreateAnimationState(C_CSGOPlayerAnimState *state);
CBoneAccessor *GetBoneAccessor();
CStudioHdr *GetModelPtr();
void StandardBlendingRules(CStudioHdr *hdr, Vector *pos, Quaternion *q, float_t curtime, int32_t boneMask);
void BuildTransformations(CStudioHdr *hdr, Vector *pos, Quaternion *q, const matrix3x4_t &cameraTransform, int32_t boneMask, byte *computed);
bool HandleBoneSetup(int32_t boneMask, matrix3x4_t *boneOut, float_t curtime);
bool SetupBones2(matrix3x4_t *pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime);
const Vector WorldSpaceCenter();
Vector GetEyePos();
player_info_t GetPlayerInfo();
std::string GetName(bool console_safe = false);
bool IsAlive();
bool HasC4();
Vector GetBonePos(int bone);
int GetBoneByName(const char *boneName);
Vector GetHitboxPos(int hitbox);
bool IsLocalInTarget(C_BasePlayer *player);
VarMapping_t *VarMapping();
void SetAbsOrigin(const Vector &origin);
void SetAbsAngles(const QAngle &angles);
void UpdateClientSideAnimation();
int GetPing();
char* GetArmorName()
{
if (this->m_ArmorValue() > 0)
{
if (this->m_bHasHelmet())
return "H+K";
else
return "K";
}
}
};
class C_BaseViewModel : public C_BaseEntity
{
public:
NETVAR(int32_t, m_nModelIndex, "CBaseViewModel", "m_nModelIndex");
NETVAR(int32_t, m_nViewModelIndex, "CBaseViewModel", "m_nViewModelIndex");
NETVAR(CHandle<C_BaseCombatWeapon>, m_hWeapon, "CBaseViewModel", "m_hWeapon");
NETVAR(CHandle<C_BasePlayer>, m_hOwner, "CBaseViewModel", "m_hOwner");
};
class AnimationLayer
{
public:
char pad_0000[20];
// These should also be present in the padding, don't see the use for it though
//float m_flLayerAnimtime;
//float m_flLayerFadeOuttime;
uint32_t m_nOrder; //0x0014
uint32_t m_nSequence; //0x0018
float_t m_flPrevCycle; //0x001C
float_t m_flWeight; //0x0020
float_t m_flWeightDeltaRate; //0x0024
float_t m_flPlaybackRate; //0x0028
float_t m_flCycle; //0x002C
void *m_pOwner; //0x0030 // player's thisptr
char pad_0038[4]; //0x0034
}; //Size: 0x0038
class C_CSGOPlayerAnimState
{
public:
int32_t &m_iLastClientSideAnimationUpdateFramecount()
{
return *(int32_t*)((uintptr_t)this + 0x70);
}
float_t &m_flEyeYaw()
{
return *(float_t*)((uintptr_t)this + 0x78);
}
float_t &m_flEyePitch()
{
return *(float_t*)((uintptr_t)this + 0x7C);
}
float_t &m_flGoalFeetYaw()
{
return *(float_t*)((uintptr_t)this + 0x80);
}
float_t &m_flCurrentFeetYaw()
{
return *(float_t*)((uintptr_t)this + 0x84);
}
bool &m_bCurrentFeetYawInitialized()
{
return *(bool*)((uintptr_t)this + 0x88);
}
Vector &m_vecVelocity()
{
// Only on ground velocity
return *(Vector*)((uintptr_t)this + 0xC8);
}
float_t &m_flVelocity()
{
return *(float_t*)((uintptr_t)this + 0xEC);
}
bool &m_bOnGround()
{
return *(bool*)((uintptr_t)this + 0x108);
}
char pad_0x0000[0x344]; //0x0000
}; //Size=0x344
class C_EconItemView
{
public:
char pad_0000[4]; //0x0000
CUtlVector<IRefCounted*> m_CustomMaterials; //0x0004
char pad_0018[520]; //0x0018
CUtlVector<IRefCounted*> m_VisualsDataProcessors; //0x0220
};
class C_AttributeManager
{
public:
char pad_0000[64]; //0x0000
C_EconItemView m_Item; //0x0040
};
class C_WeaponCSBase : public IClientEntity
{
public:
char _pad_0x0000[2508];
CUtlVector<IRefCounted*> m_CustomMaterials; //0x09DC
char _pad_0x09F0[9120];
C_AttributeManager m_AttributeManager; //0x2D80
char _pad_0x2D94[812];
bool m_bCustomMaterialInitialized; //0x3330
};
struct Item_t
{
constexpr Item_t(const char* model, const char* icon = nullptr) : model(model), icon(icon) {}
const char* model;
const char* icon;
};
struct WeaponName_t
{
constexpr WeaponName_t(int definition_index, const char* name) : definition_index(definition_index), name(name) {}
int definition_index = 0;
const char* name = nullptr;
};
struct QualityName_t
{
constexpr QualityName_t(int index, const char* name) : index(index), name(name) {}
int index = 0;
const char* name = nullptr;
};
extern const std::map<size_t, Item_t> k_weapon_info;
extern const std::vector<WeaponName_t> k_knife_names;
extern const std::vector<WeaponName_t> k_glove_names;
extern const std::vector<WeaponName_t> k_weapon_names;
extern const std::vector<QualityName_t> k_quality_names;