Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SDK.h
- #ifndef SDK_H
- #define SDK_H
- #include "Math.h"
- #include "WinCustom.h"
- #include "CRC32.h"
- #include "dt_recv.h"
- typedef void* (*CreateInterfaceFn)( const char*, int* );
- #undef CreateFont
- class CBaseEntity;
- class CBaseWeapon;
- 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;
- };
- class ClientClass
- {
- public:
- unsigned char __pad0[ 0x8 ];
- const char* m_pNetworkName;
- RecvTable* m_pRecvTable;
- ClientClass* m_pNext;
- int m_iClassID;
- };
- class IBaseClientDLL
- {
- public:
- ClientClass* GetAllClasses ()
- {
- typedef ClientClass* (__thiscall* GetAllClassesFn)( void* );
- return GetMethod< GetAllClassesFn > ( this, 7 )( this );
- }
- };
- class IClientEntityList
- {
- public:
- CBaseEntity* GetClientEntity ( int nIndex )
- {
- typedef CBaseEntity* (__thiscall* GetClientEntityFn)( void*, int );
- return GetMethod< GetClientEntityFn > ( this, 3 )( this, nIndex );
- }
- CBaseEntity* GetClientEntityFromHandle ( int nHandle )
- {
- typedef CBaseEntity* (__thiscall* GetClientEntityFromHandleFn)( void*, int );
- return GetMethod< GetClientEntityFromHandleFn > ( this, 4 )( this, nHandle );
- }
- int GetHighestEntityIndex ()
- {
- typedef int (__thiscall* GetHighestEntityIndexFn)( void* );
- return GetMethod< GetHighestEntityIndexFn > ( this, 6 )( this );
- }
- };
- class IVEngineClient
- {
- public:
- void GetScreenSize ( int& width, int& height )
- {
- typedef void (__thiscall* GetScreenSizeFn)( void*, int&, int& );
- GetMethod< GetScreenSizeFn > ( this, 5 )( this, width, height );
- }
- int GetLocalPlayer ()
- {
- typedef int (__thiscall* GetLocalPlayerFn)( void* );
- return GetMethod< GetLocalPlayerFn > ( this, 12 )( this );
- }
- void GetViewAngles ( QAngle& va )
- {
- typedef void (__thiscall* GetViewAnglesFn)( void*, QAngle& );
- GetMethod< GetViewAnglesFn > ( this, 19 )( this, va );
- }
- void SetViewAngles( QAngle& va )
- {
- typedef void (__thiscall* SetViewAnglesFn)( void*, QAngle& );
- GetMethod< SetViewAnglesFn > ( this, 20 )( this, va );
- }
- int GetMaxClients ( void )
- {
- typedef int (__thiscall* GetMaxClientsFn)( void* );
- return GetMethod< GetMaxClientsFn > ( this, 21 )( this );
- }
- const VMatrix& WorldToScreenMatrix ( uintptr_t engine )
- {
- uintptr_t dwMatrix = (((0x1C8 * *(int*)(engine + 0x72B608)) + *(uintptr_t*)(engine + 0x72B5FC)) - 0x44);
- return *(VMatrix*)dwMatrix;
- }
- };
- class IVDebugOverlay
- {
- public:
- int ScreenPosition ( const Vector& point, Vector& screen )
- {
- typedef int (__thiscall* ScreenPositionFn)( void*, const Vector&, Vector& );
- return GetMethod< ScreenPositionFn > ( this, 13 )( this, point, screen );
- }
- };
- #endif // SDK_H
- // Entity.h
- #ifndef ENTITY_H
- #define ENTITY_H
- #include "SDK.h"
- class CDotaAbility
- {
- public:
- float GetCooldown ( void );
- };
- class CBaseEntity
- {
- public:
- bool IsIllusion ( void );
- bool IsDormant ( void );
- int GetHealth ( void );
- int GetMaxHealth ( void );
- int GetIndex ( void );
- int GetTeamNum ( void );
- float GetMana ( void );
- float GetMaxMana ( void );
- Vector GetOrigin ( void );
- ClientClass* GetClientClass ( void );
- CDotaAbility* GetUltAbility ( void );
- void GetRenderBounds ( Vector& min, Vector& max );
- };
- #endif // ENTITY_H
- // Entity.cpp
- #include "Entity.h"
- #include "HL2.h"
- float CDotaAbility::GetCooldown ( void )
- {
- return *(float*)( this + HL2::NetVar::Ability::m_fCooldown );
- }
- bool CBaseEntity::IsIllusion ( void )
- {
- return (bool)( *(uintptr_t*)( this + HL2::NetVar::Entity::m_hReplicatingOtherHeroModel ) );
- }
- bool CBaseEntity::IsDormant ( void )
- {
- void* pNetworkable = (void*)( this + 0x8 );
- typedef bool (__thiscall* IsDormantFn)( void* );
- return GetMethod< IsDormantFn > ( pNetworkable, 8 )( pNetworkable );
- }
- int CBaseEntity::GetHealth ( void )
- {
- return *(int*)( this + HL2::NetVar::Entity::m_iHealth );
- }
- int CBaseEntity::GetMaxHealth ( void )
- {
- return *(int*)( this + HL2::NetVar::Entity::m_iMaxHealth );
- }
- int CBaseEntity::GetIndex ( void )
- {
- void* pNetworkable = (void*)( this + 0x8 );
- typedef bool (__thiscall* GetIndexFn)( void* );
- return GetMethod< GetIndexFn > ( pNetworkable, 9 )( pNetworkable );
- }
- int CBaseEntity::GetTeamNum ( void )
- {
- typedef int (__thiscall* GetTeamNumFn)( void* );
- return GetMethod< GetTeamNumFn > ( this, 89 )( this );
- }
- float CBaseEntity::GetMana ( void )
- {
- return *(float*)( this + HL2::NetVar::Entity::m_flMana );
- }
- float CBaseEntity::GetMaxMana ( void )
- {
- return *(float*)( this + HL2::NetVar::Entity::m_flMaxMana );
- }
- Vector CBaseEntity::GetOrigin ( void )
- {
- typedef Vector& (__thiscall* GetOriginFn)( void* );
- return GetMethod< GetOriginFn > ( this, 11 )( this );
- }
- ClientClass* CBaseEntity::GetClientClass ( void )
- {
- void* pNetworkable = (void*)( this + 0x8 );
- typedef ClientClass* (__thiscall* GetClientClassFn)( void* );
- return GetMethod< GetClientClassFn > ( pNetworkable, 2 )( pNetworkable );
- }
- CDotaAbility* CBaseEntity::GetUltAbility ( void )
- {
- int handle = *(int*)( this + HL2::NetVar::Entity::m_hAbilities + 5 * 4 );
- if ( handle )
- return (CDotaAbility*)HL2::m_pEntList->GetClientEntityFromHandle ( handle );
- handle = *(int*)( this + HL2::NetVar::Entity::m_hAbilities + 4 * 4 );
- if ( handle )
- return (CDotaAbility*)HL2::m_pEntList->GetClientEntityFromHandle ( handle );
- handle = *(int*)( this + HL2::NetVar::Entity::m_hAbilities + 3 * 4 );
- if ( handle )
- return (CDotaAbility*)HL2::m_pEntList->GetClientEntityFromHandle ( handle );
- return 0;
- }
- void CBaseEntity::GetRenderBounds ( Vector& min, Vector& max )
- {
- void* pRenderable = (void*)( this + 0x4 );
- typedef void (__thiscall* GetRenderBoundsFn)( void*, Vector&, Vector& );
- GetMethod< GetRenderBoundsFn > ( this, 20 )( this, min, max );
- }
- // netvars
- Entity::m_iHealth = GetNetVar ( "DT_DOTA_BaseNPC", "m_iHealth", 0 );
- Entity::m_iMaxHealth = GetNetVar ( "DT_DOTA_BaseNPC", "m_iMaxHealth", 0 );
- Entity::m_flMana = GetNetVar ( "DT_DOTA_BaseNPC", "m_flMana", 0 );
- Entity::m_flMaxMana = GetNetVar ( "DT_DOTA_BaseNPC", "m_flMaxMana", 0 );
- Entity::m_hReplicatingOtherHeroModel = GetNetVar ( "DT_DOTA_BaseNPC_Hero", "m_hReplicatingOtherHeroModel", 0 );
- Entity::m_hAbilities = GetNetVar ( "DT_DOTA_BaseNPC", "m_hAbilities", 0 );
- Ability::m_fCooldown = GetNetVar ( "DT_DOTABaseAbility", "m_fCooldown", 0 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement