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
|
//|_ _ _. _ ._ |_ _. _ |
//| | (/_ (_| \/ (/_ | | | | (_| (_ |<
#pragma once
#include "../util.h"
#include "sdk.h"
#include "netvar.h"
#define OFFSET( name, prop, table, type, off ) \
type name() { \
static U32 offset = netvar_find( csgop, table, prop ) + off; \
return get<type>( offset ); } \
void name( type v ) { \
static U32 offset = netvar_find( csgop, table, #name ) + off; \
return set<type>( offset, v ); } \
#define NETVAR( name, table, type ) \
type name() { \
static U32 offset = netvar_find( csgop, table, #name ); \
return get<type>( offset ); } \
void name( type v ) { \
static U32 offset = netvar_find( csgop, table, #name ); \
return set<type>( offset, v ); } \
class CSGOENTITY {
public:
static CSGO* csgop;
public:
CSGOENTITY( U32 ptr ) : base( ptr ) {};
CSGOENTITY( const CSGOENTITY& other ) : base( other.base ) {}
inline operator U32&() { return base; }
template <typename t>
t get( U32 offset ) { return csgop->read<t>( base + offset ); }
template <typename t>
void set( U32 offset, t v ) { return csgop->write<t>( base + offset, v ); }
public:
CSGO_CLIENT_CLASS get_clientclass() {
U32 networkable = get<U32>( 0x8 );
U32 create_fn = csgop->read<U32>( networkable + 0x8 );
U32 clientclass = csgop->read<U32>( create_fn + 0x1 );
return csgop->read<CSGO_CLIENT_CLASS>( clientclass );
}
NETVAR( m_fFlags, "DT_CSPlayer", I32 );
OFFSET( m_iCrosshairID, "m_bHasDefuser", "DT_CSPlayer", I32, 92 );
OFFSET( m_dwBoneMatrix, "m_nForceBone", "DT_BaseAnimating", U32, 28 );
static CSGOENTITY from_list( I32 idx ) {
const U64 entlist = csgop->code_match(
csgop->client, "BB ? ? ? ? 83 FF 01 0F 8C ? ? ? ? 3B F8"
);
return csgop->read<U32>(
csgop->client + entlist + idx * 0x10
);
}
bool is_weapon() {
CSGO_CLIENT_CLASS cl = get_clientclass();
return cl.index >= CWeaponAug && cl.index <= CWeaponXM1014;
}
public:
U32 base;
};
|