Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef SDK_H
- #define SDK_H
- #include "Vector.h"
- #include "VMethod.h"
- #include "dt_recv.h"
- #include "crc32_checksum.h"
- #include "md5_checksum.h"
- typedef void* ( *CreateInterfaceFn )( const char*, int* );
- #undef CreateFont
- #define IN_ATTACK ( 1 << 0 )
- #define IN_JUMP ( 1 << 1 )
- #define IN_DUCK ( 1 << 2 )
- #define FL_ONGROUND ( 1 << 0 )
- #define FL_DUCKING ( 1 << 1 )
- #define MULTIPLAYER_BACKUP ( 150 )
- #define COLORCODE( r, g, b, a ) ((DWORD_PTR)((((r)&0xFF)<<24)|(((g)&0xFF)<<16)|(((b)&0xFF)<<8)|(((a)&0xFF))))
- #define RED( COLORCODE ) ((int)(COLORCODE>>24))
- #define BLUE( COLORCODE ) ((int)(COLORCODE>>8)&0xFF)
- #define GREEN( COLORCODE ) ((int)(COLORCODE>>16)&0xFF)
- #define ALPHA( COLORCODE ) ((int)(COLORCODE&0xFF))
- #define RGBA( COLORCODE ) RED(COLORCODE),GREEN(COLORCODE),BLUE(COLORCODE),ALPHA(COLORCODE)
- class IPanel;
- class ISurface;
- class IBaseClientDLL;
- class IVEngineClient;
- class IClientEntityList;
- class CInput;
- class CUserCmd;
- class CVerifiedUserCmd;
- class IEngineTrace;
- class ClientClass;
- class CSPlayer;
- class CSWeapon;
- class model_t;
- typedef struct player_info_s
- {
- unsigned long long unknown;
- unsigned long long xuid;
- char name[128];
- int userID;
- char guid[32 + 1];
- unsigned int friendsID;
- char friendsName[128];
- bool fakeplayer;
- bool ishltv;
- unsigned long customFiles[4];
- unsigned char filesDownloaded;
- } player_info_t;
- class ClientClass
- {
- public:
- const char* GetName( )
- {
- return *( char** )( this + 0x8 );
- }
- RecvTable* GetTable( )
- {
- return *( RecvTable** )( this + 0xC );
- }
- ClientClass* NextClass( )
- {
- return *( ClientClass** )( this + 0x10 );
- }
- int GetClassId( )
- {
- return *( int* )( this + 0x14 );
- }
- };
- class IBaseClientDLL
- {
- public:
- ClientClass* GetAllClasses( )
- {
- typedef ClientClass* ( __thiscall* GetAllClassesFn )( PVOID );
- return GetMethod< GetAllClassesFn >( this, 8 )( this );
- }
- };
- class IClientEntityList
- {
- public:
- CSPlayer* GetClientEntity( int nIndex )
- {
- typedef CSPlayer* ( __thiscall* GetClientEntityFn )( PVOID, int );
- return GetMethod< GetClientEntityFn >( this, 3 )( this, nIndex );
- }
- CSWeapon* GetClientEntityFromHandle( int nHandle )
- {
- typedef CSWeapon* ( __thiscall* GetClientEntityFromHandleFn )( PVOID, int );
- return GetMethod< GetClientEntityFromHandleFn >( this, 4 )( this, nHandle );
- }
- int GetHighestEntityIndex( )
- {
- typedef int ( __thiscall* GetHighestEntityIndexFn )( PVOID );
- return GetMethod< GetHighestEntityIndexFn >( this, 6 )( this );
- }
- };
- class IVEngineClient
- {
- public:
- void GetScreenSize( int& width, int& height )
- {
- typedef void ( __thiscall* GetScreenSizeFn )( PVOID, int& , int& );
- return GetMethod< GetScreenSizeFn >( this, 5 )( this, width, height );
- }
- bool GetPlayerInfo( int ent_num, player_info_t* pinfo )
- {
- typedef bool ( __thiscall* GetPlayerInfoFn )( PVOID, int, player_info_t* );
- return GetMethod< GetPlayerInfoFn >( this, 8 )( this, ent_num, pinfo );
- }
- int GetLocalPlayer( )
- {
- typedef int ( __thiscall* GetLocalPlayerFn )( PVOID );
- return GetMethod< GetLocalPlayerFn >( this, 12 )( this );
- }
- void GetViewAngles( Vector& va )
- {
- typedef void ( __thiscall* GetViewAnglesFn )( PVOID, Vector& );
- GetMethod< GetViewAnglesFn >( this, 18 )( this, va );
- }
- void SetViewAngles( Vector& va )
- {
- typedef void ( __thiscall* SetViewAnglesFn )( PVOID, Vector& );
- GetMethod< SetViewAnglesFn >( this, 19 )( this, va );
- }
- int GetMaxClients( )
- {
- typedef int ( __thiscall* GetMaxClientsFn )( PVOID );
- return GetMethod< GetMaxClientsFn >( this, 20 )( this );
- }
- const VMatrix& WorldToScreenMatrix( )
- {
- typedef const VMatrix& ( __thiscall* WorldToScreenMatrixFn )( PVOID );
- return GetMethod< WorldToScreenMatrixFn >( this, 37 )( this );
- }
- };
- class CUserCmd
- {
- public:
- virtual ~CUserCmd( ) { };
- int command_number;
- int tick_count;
- Vector viewangles;
- Vector aimdirection;
- float forwardmove;
- float sidemove;
- float upmove;
- int buttons;
- BYTE impulse;
- int weaponselect;
- int weaponsubtype;
- int random_seed;
- short mousedx;
- short mousedy;
- bool hasbeenpredicted;
- Vector headangles;
- Vector headoffset;
- };
- class CVerifiedUserCmd
- {
- public:
- CUserCmd m_cmd;
- ULONG m_crc;
- };
- class CInput
- {
- public:
- CUserCmd* GetUserCmd( int nSlot, int sequence_number )
- {
- typedef CUserCmd* ( __thiscall* GetUserCmdFn )( PVOID, int, int );
- return GetMethod< GetUserCmdFn >( this, 8 )( this, nSlot, sequence_number );
- }
- char __pad0[ 0xE4 ];
- CUserCmd* m_pCmd;
- CVerifiedUserCmd* m_pVerifiedCmd;
- };
- class CGlobalVarsBase
- {
- public:
- float realtime;
- int framecount;
- float absoluteframetime;
- float curtime;
- float frametime;
- int maxClients;
- int tickcount;
- float interval_per_tick;
- float interpolation_amount;
- int simTicksThisFrame;
- int network_protocol;
- };
- struct mstudiobbox_t
- {
- int bone;
- int group;
- Vector bbmin;
- Vector bbmax;
- int szhitboxnameindex;
- int unused[8];
- const char* pszHitboxName( ) const
- {
- if( szhitboxnameindex == 0 )
- return "";
- return ( ( const char* )this ) + szhitboxnameindex;
- }
- };
- struct mstudiohitboxset_t
- {
- int sznameindex;
- inline char* const pszName( void ) const { return ( ( char* )this ) + sznameindex; }
- int numhitboxes;
- int hitboxindex;
- inline mstudiobbox_t* pHitbox( int i ) const { return ( mstudiobbox_t* )( ( ( BYTE* )this ) + hitboxindex ) + i; };
- };
- struct studiohdr_t
- {
- unsigned char pad[0xAC];
- int numhitboxsets;
- int hitboxsetindex;
- mstudiohitboxset_t* pHitboxSet( int i ) const
- {
- return ( mstudiohitboxset_t* )( ( ( BYTE* )this ) + hitboxsetindex ) + i;
- };
- inline mstudiobbox_t* pHitbox( int i, int set ) const
- {
- mstudiohitboxset_t const* s = pHitboxSet( set );
- if( !s )
- return NULL;
- return s->pHitbox( i );
- };
- inline int iHitboxCount( int set ) const
- {
- mstudiohitboxset_t const* s = pHitboxSet( set );
- if( !s )
- return 0;
- return s->numhitboxes;
- };
- };
- struct Ray_t
- {
- VectorAligned m_Start;
- VectorAligned m_Delta;
- VectorAligned m_StartOffset;
- VectorAligned m_Extents;
- const matrix3x4_t* m_pWorldAxisTransform;
- bool m_IsRay;
- bool m_IsSwept;
- Ray_t( ) : m_pWorldAxisTransform( NULL ) { }
- void Init( Vector& vecStart, Vector& vecEnd )
- {
- m_Delta = vecEnd - vecStart;
- m_IsSwept = ( m_Delta.LengthSqr( ) != 0 );
- m_Extents.x = m_Extents.y = m_Extents.z = 0.0f;
- m_pWorldAxisTransform = NULL;
- m_IsRay = true;
- m_StartOffset.x = m_StartOffset.y = m_StartOffset.z = 0.0f;
- m_Start = vecStart;
- }
- };
- struct cplane_t
- {
- Vector normal;
- float dist;
- BYTE type;
- BYTE signbits;
- BYTE pad[2];
- };
- class CBaseTrace
- {
- public:
- Vector startpos;
- Vector endpos;
- cplane_t plane;
- float fraction;
- int contents;
- unsigned short dispFlags;
- bool allsolid;
- bool startsolid;
- };
- struct csurface_t
- {
- const char* name;
- short surfaceProps;
- unsigned short flags;
- };
- class CGameTrace : public CBaseTrace
- {
- public:
- bool DidHitWorld( ) const;
- bool DidHitNonWorldEntity( ) const;
- int GetEntityIndex( ) const;
- bool DidHit( ) const;
- public:
- float fractionleftsolid;
- csurface_t surface;
- int hitgroup;
- short physicsbone;
- unsigned short worldSurfaceIndex;
- CSPlayer* m_pEnt;
- int hitbox;
- };
- inline bool CGameTrace::DidHit( ) const
- {
- return fraction < 1.0f || allsolid || startsolid;
- }
- typedef CGameTrace trace_t;
- enum TraceType_t
- {
- TRACE_EVERYTHING = 0,
- TRACE_WORLD_ONLY,
- TRACE_ENTITIES_ONLY,
- TRACE_EVERYTHING_FILTER_PROPS,
- };
- class ITraceFilter
- {
- public:
- virtual bool ShouldHitEntity( PVOID pEntity, int contentsMask ) = 0;
- virtual TraceType_t GetTraceType( ) const = 0;
- };
- class IEngineTrace
- {
- public:
- void TraceRay( const Ray_t& ray, unsigned int flMask, ITraceFilter* pTraceFilter, trace_t* pTrace )
- {
- typedef void ( __thiscall* TraceRayFn )( PVOID, const Ray_t&, unsigned int, ITraceFilter*, trace_t* );
- GetMethod< TraceRayFn >( this, 5 )( this, ray, flMask, pTraceFilter, pTrace );
- }
- };
- class IVModelInfoClient
- {
- public:
- const char* GetModelName( const model_t* model )
- {
- typedef const char* ( __thiscall* GetModelNameFn )( PVOID, const model_t* );
- return GetMethod< GetModelNameFn >( this, 3 )( this, model );
- }
- studiohdr_t* GetStudiomodel( const model_t* mod )
- {
- typedef studiohdr_t* ( __thiscall* GetStudiomodelFn )( PVOID, const model_t* );
- return GetMethod< GetStudiomodelFn >( this, 30 )( this, mod );
- }
- };
- class IPanel
- {
- public:
- const char* GetPanelName( unsigned int vguiPanel )
- {
- typedef const char* ( __thiscall* GetPanelNameFn )( void*, unsigned int );
- return GetMethod< GetPanelNameFn >( this, 36 )( this, vguiPanel );
- }
- };
- class ISurface
- {
- public:
- void DrawSetColor( int r, int g, int b, int a )
- {
- typedef void ( __thiscall* DrawSetColorFn )( PVOID, int, int, int, int );
- GetMethod< DrawSetColorFn >( this, 14 )( this, r, g, b, a );
- }
- void DrawFilledRect( int x0, int y0, int x1, int y1 )
- {
- typedef void ( __thiscall* DrawFilledRectFn )( PVOID, int, int, int, int );
- GetMethod< DrawFilledRectFn >( this, 15 )( this, x0, y0, x1, y1 );
- }
- void DrawOutlinedRect( int x0, int y0, int x1, int y1 )
- {
- typedef void ( __thiscall* DrawOutlinedFn )( PVOID, int, int, int, int );
- GetMethod< DrawOutlinedFn >( this, 17 )( this, x0, y0, x1, y1 );
- }
- void DrawLine( int x0, int y0, int x1, int y1 )
- {
- typedef void ( __thiscall* DrawLineFn )( PVOID, int, int, int, int );
- GetMethod< DrawLineFn >( this, 18 )( this, x0, y0, x1, y1 );
- }
- void DrawSetTextFont( unsigned long font )
- {
- typedef void ( __thiscall* DrawSetTextFontFn )( PVOID, unsigned long );
- GetMethod< DrawSetTextFontFn >( this, 22 )( this, font );
- }
- void DrawSetTextColor( int r, int g, int b, int a )
- {
- typedef void ( __thiscall* DrawSetTextColorFn )( PVOID, int, int, int, int );
- GetMethod< DrawSetTextColorFn >( this, 24 )( this, r, g, b, a );
- }
- void DrawSetTextPos( int x, int y )
- {
- typedef void ( __thiscall* DrawSetTextPosFn )( PVOID, int, int );
- GetMethod< DrawSetTextPosFn >( this, 25 )( this, x, y );
- }
- void DrawPrintText( const wchar_t* text, int textLen )
- {
- typedef void ( __thiscall* DrawPrintTextFn )( PVOID, const wchar_t*, int, int );
- return GetMethod< DrawPrintTextFn >( this, 27 )( this, text, textLen, 0 );
- }
- unsigned long CreateFont( )
- {
- typedef unsigned int ( __thiscall* CreateFontFn )( PVOID );
- return GetMethod< CreateFontFn >( this, 70 )( this );
- }
- void SetFontGlyphSet( unsigned long font, const char* windowsFontName, int tall, int weight, int blur, int scanlines, int flags )
- {
- typedef void ( __thiscall* SetFontGlyphSetFn )( PVOID, unsigned long, const char*, int, int, int, int, int, int, int );
- GetMethod< SetFontGlyphSetFn >( this, 71 )( this, font, windowsFontName, tall, weight, blur, scanlines, flags, 0, 0 );
- }
- void GetTextSize( unsigned long font, const wchar_t* text, int& wide, int& tall )
- {
- typedef void ( __thiscall* GetTextSizeFn )( PVOID, unsigned long, const wchar_t*, int&, int& );
- GetMethod< GetTextSizeFn >( this, 78 )( this, font, text, wide, tall );
- }
- };
- enum ButtonCode_t
- {
- BUTTON_CODE_INVALID = -1,
- BUTTON_CODE_NONE = 0,
- KEY_FIRST = 0,
- KEY_NONE = KEY_FIRST,
- KEY_0,
- KEY_1,
- KEY_2,
- KEY_3,
- KEY_4,
- KEY_5,
- KEY_6,
- KEY_7,
- KEY_8,
- KEY_9,
- KEY_A,
- KEY_B,
- KEY_C,
- KEY_D,
- KEY_E,
- KEY_F,
- KEY_G,
- KEY_H,
- KEY_I,
- KEY_J,
- KEY_K,
- KEY_L,
- KEY_M,
- KEY_N,
- KEY_O,
- KEY_P,
- KEY_Q,
- KEY_R,
- KEY_S,
- KEY_T,
- KEY_U,
- KEY_V,
- KEY_W,
- KEY_X,
- KEY_Y,
- KEY_Z,
- KEY_PAD_0,
- KEY_PAD_1,
- KEY_PAD_2,
- KEY_PAD_3,
- KEY_PAD_4,
- KEY_PAD_5,
- KEY_PAD_6,
- KEY_PAD_7,
- KEY_PAD_8,
- KEY_PAD_9,
- KEY_PAD_DIVIDE,
- KEY_PAD_MULTIPLY,
- KEY_PAD_MINUS,
- KEY_PAD_PLUS,
- KEY_PAD_ENTER,
- KEY_PAD_DECIMAL,
- KEY_LBRACKET,
- KEY_RBRACKET,
- KEY_SEMICOLON,
- KEY_APOSTROPHE,
- KEY_BACKQUOTE,
- KEY_COMMA,
- KEY_PERIOD,
- KEY_SLASH,
- KEY_BACKSLASH,
- KEY_MINUS,
- KEY_EQUAL,
- KEY_ENTER,
- KEY_SPACE,
- KEY_BACKSPACE,
- KEY_TAB,
- KEY_CAPSLOCK,
- KEY_NUMLOCK,
- KEY_ESCAPE,
- KEY_SCROLLLOCK,
- KEY_INSERT,
- KEY_DELETE,
- KEY_HOME,
- KEY_END,
- KEY_PAGEUP,
- KEY_PAGEDOWN,
- KEY_BREAK,
- KEY_LSHIFT,
- KEY_RSHIFT,
- KEY_LALT,
- KEY_RALT,
- KEY_LCONTROL,
- KEY_RCONTROL,
- KEY_LWIN,
- KEY_RWIN,
- KEY_APP,
- KEY_UP,
- KEY_LEFT,
- KEY_DOWN,
- KEY_RIGHT,
- KEY_F1,
- KEY_F2,
- KEY_F3,
- KEY_F4,
- KEY_F5,
- KEY_F6,
- KEY_F7,
- KEY_F8,
- KEY_F9,
- KEY_F10,
- KEY_F11,
- KEY_F12,
- KEY_CAPSLOCKTOGGLE,
- KEY_NUMLOCKTOGGLE,
- KEY_SCROLLLOCKTOGGLE,
- KEY_LAST = KEY_SCROLLLOCKTOGGLE,
- KEY_COUNT = KEY_LAST - KEY_FIRST + 1,
- MOUSE_FIRST = KEY_LAST + 1,
- MOUSE_LEFT = MOUSE_FIRST,
- MOUSE_RIGHT,
- MOUSE_MIDDLE,
- MOUSE_4,
- MOUSE_5,
- MOUSE_WHEEL_UP,
- MOUSE_WHEEL_DOWN,
- MOUSE_LAST = MOUSE_WHEEL_DOWN,
- MOUSE_COUNT = MOUSE_LAST - MOUSE_FIRST + 1,
- };
- #endif // SDK_H
Advertisement
Add Comment
Please, Sign In to add comment