From 28f41cf689def99fb586bfca47b7e1786227a5a2 Mon Sep 17 00:00:00 2001 From: navewindre Date: Fri, 12 Jul 2024 05:40:41 +0200 Subject: base shit --- src/csgo/csgoentity.h | 81 --------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 src/csgo/csgoentity.h (limited to 'src/csgo/csgoentity.h') diff --git a/src/csgo/csgoentity.h b/src/csgo/csgoentity.h deleted file mode 100644 index 5d4a4cf..0000000 --- a/src/csgo/csgoentity.h +++ /dev/null @@ -1,81 +0,0 @@ -//|_ _ _. _ ._ |_ _. _ | -//| | (/_ (_| \/ (/_ | | | | (_| (_ |< - -#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( offset ); } \ - void name( type v ) { \ - static U32 offset = netvar_find( csgop, table, #name ) + off; \ - return set( offset, v ); } \ - -#define NETVAR( name, table, type ) \ - type name() { \ - static U32 offset = netvar_find( csgop, table, #name ); \ - return get( offset ); } \ - void name( type v ) { \ - static U32 offset = netvar_find( csgop, table, #name ); \ - return set( 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 - t get( U32 offset ) { return csgop->read( base + offset ); } - - template - void set( U32 offset, t v ) { return csgop->write( base + offset, v ); } - -public: - CSGO_CLIENT_CLASS get_clientclass() { - U32 networkable = get( 0x8 ); - U32 create_fn = csgop->read( networkable + 0x8 ); - U32 clientclass = csgop->read( create_fn + 0x1 ); - - return csgop->read( clientclass ); - } - - NETVAR( m_fFlags, "DT_CSPlayer", I32 ); - OFFSET( m_MoveType , "m_nRenderMode", "DT_CSPlayer" , I32, 1 ); - OFFSET( m_iCrosshairID, "m_bHasDefuser", "DT_CSPlayer" , I32, 92 ); - OFFSET( m_dwBoneMatrix, "m_nForceBone", "DT_BaseAnimating", U32, 28 ); - - bool m_bDormant() { - return get( 0xed ); - } - - static CSGOENTITY from_list( I32 idx ) { - static U32 entlist = csgop->read( - csgop->code_match( - csgop->client, "BB ? ? ? ? 83 FF 01 0F 8C ? ? ? ? 3B F8" - ) + 1 - ); - - return csgop->read( - entlist + idx * 0x10 - ); - } - - bool is_weapon() { - CSGO_CLIENT_CLASS cl = get_clientclass(); - return ( cl.index >= CWeaponAug && cl.index <= CWeaponXM1014 ) - || cl.index == CAK47 || cl.index == CDEagle; - } - -public: - U32 base; -}; \ No newline at end of file -- cgit v1.2.3