Code:
class IBase
{
public:
IBase();
~IBase();
public:
template <typename T>
T GetValue(DWORD ofs)
{
T value = (T)NULL;
g_ApiTable->memcpy(&value, (void*)((uintptr_t)this + ofs), sizeof(T));
return value;
}
template <typename T>
void SetValue(DWORD ofs, T data)
{
if (!g_ApiTable->IsBadWritePtr((void*)((uintptr_t)this + ofs), sizeof(T)))
*(T*)((uintptr_t)this + ofs) = data;
}
const char* GetString(DWORD ofs) { return (const char*)((uintptr_t)this + ofs); }
const char* GetStringP(DWORD ofs) { return *(const char**)((uintptr_t)this + ofs); }
};
class ILTCSBase : public IBase
{
public:
//////////////////////////////////////////////////////////////////////////////
// ILTCSBase implementation
// Sub-interface accessors
ILTCommon* Common() { return *reinterpret_cast<ILTCommon**>(GetVFunc<ILTCommon* (__thiscall*)(void*)>(this, t_Common)(this)); }
ILTPhysics* Physics() { return *reinterpret_cast<ILTPhysics**>(GetVFunc<ILTPhysics* (__thiscall*)(void*)>(this, t_Physics)(this)); }
ILTModel* GetModelLT() { return *reinterpret_cast<ILTModel**>(GetVFunc<ILTModel* (__thiscall*)(void*)>(this, t_GetModelLT)(this)); }
ILTTransform* GetTransformLT() { return *reinterpret_cast<ILTTransform**>(GetVFunc<ILTTransform* (__thiscall*)(void*)>(this, t_GetTransformLT)(this)); }
ILTSoundMgr* SoundMgr() { return *reinterpret_cast<ILTSoundMgr**>(GetVFunc<ILTSoundMgr* (__thiscall*)(void*)>(this, t_SoundMgr)(this)); }
};
class ILTClient : public ILTCSBase
{
public:
auto GetILTCSBase() { return this->GetValue<ILTCSBase*>(0x0000); }
};
class ILTModel : public IBase
{
public:
signed int SetAnimRate(ModelInstance* hObj, UINT8 TrackerID, float fRate) { return GetVFunc<signed int(__thiscall*)(void*, ModelInstance*, UINT8, float)>(this, w_SetAnimRate)(this, hObj, TrackerID, fRate); }
};
class ILTModelClient : public ILTModel
{
public:
};
class CLTModelClient : public ILTModelClient
{
public:
};
class ModelInstance : public LTObject
{
public:
void SetAnimRate(unsigned __int8 TrackerID, float fRate) { ilt_model_client->SetAnimRate(this, TrackerID, fRate) }
Model* GetModelDB() { return reinterpret_cast<Model * (__thiscall * )(void*)>(0x????)(this); }
LTAnimTracker* GetTracker(unsigned __int8 TrackerID) { return reinterpret_cast<LTAnimTracker * (__thiscall *)(void*, unsigned __int8)>(0x????)(this, TrackerID); }
};
class CWeaponMgr
{
public:
float& PerturbMin(int id) { return *(float*)((uintptr_t)this + (0x???? + (id * 4))); }
float& PerturbMax(int id) { return *(float*)((uintptr_t)this + (0x???? + (id * 4))); }
float& FullReacPitch(int id) { return *(float*)((uintptr_t)this + (0x???? + (id * 4))); }
float& FullReactYaw(int id) { return *(float*)((uintptr_t)this + (0x???? + (id * 4))); }
float& DetailPerturbShot(int id) { return *(float*)((uintptr_t)this + (0x???? + (id * 4))); }
float& DetailReactPitchShot(int id) { return *(float*)((uintptr_t)this + (0x???? + (id * 4))); }
float& DetailReactYawShot(int id) { return *(float*)((uintptr_t)this + (0x???? + (id * 4))); }
float& CrossHairRatioPerRealSize(int id) { return *(float*)((uintptr_t)this + (0x???? + (id * 4))); }
float& ChangeMovingRealSize(int id) { return *(float*)((uintptr_t)this + (0x???? + (id * 4))); }
};
class CharacFX
{
public:
CWeaponMgr* GetWeapon() { return GetVTable<CWeaponMgr*(__thiscall*)(void*)>(this, c_GetWeapon)(this); }
};
class PlayerViewManager : public IBase
{
public:
ModelInstance* m_hObject() { return this->GetValue<ModelInstance*>(0x0004); }
int GetWeaponID() { return GetVTable<int(__thiscall*)(void*)>(this, p_GetWeaponId)(this); }
int GetCharacterTypeID() { return GetVTable<int(__thiscall*)(void*)>(this, p_GetCharacterTypeID)(this); }
ModelInstance* GetLocalObject() { return GetVTable<ModelInstance*(__thiscall*)(void*)>(this, p_GetLocalObject)(this); }
CharacFX* GetLocalCharacFX() { return GetVTable<CharacFX*(__thiscall*)(void*)>(this, p_GetLocalCharacFX)(this); }
int GetLocalTeamId() { return GetVTable<int(__thiscall*)(void*)>(this, p_GetLocalTeamId)(this); }
int SetLocalTeamId(int id) { return GetVTable<int(__thiscall*)(void*, int)>(this, p_SetLocalTeamId)(this, id); }
int GetLocalPlayerId() { return GetVTable<int(__thiscall*)(void*)>(this, p_GetLocalPlayerId)(this); }
int WeaponZoomIndex() { return GetVTable<int(__thiscall*)(void*)>(this, p_WeaponZoomIndex)(this); }
void ResetWeaponZoom() { GetVTable<void(__thiscall*)(void*)>(this, p_ResetWeaponZoom)(this); }
void SetWeaponZoom(float value) { GetVTable<void(__thiscall*)(void*, float)>(this, p_SetWeaponZoom)(this, value); }
float GetWeaponZoom() { return GetVTable<float(__thiscall*)(void*)>(this, p_GetWeaponZoom)(this); }
int GetWeaponState() { return GetVTable<int(__thiscall*)(void*)>(this, p_GetWeaponState)(this); }
int SetCurAnimTime(int time) { return GetVTable<int(__thiscall*)(void*, int)>(this, p_SetCurAnimTime)(this, time); }
int GetCurAnimTime() { return GetVTable<int(__thiscall*)(void*)>(this, p_GetCurAnimLength)(this); }
float GetAnimRate() { return GetVTable<float(__thiscall*)(void*)>(this, p_GetAnimRate)(this); }
};
class ICPlayerCIntBase : public IBase
{
public:
};
class CPlayerClnt : public ICPlayerCIntBase
{
public:
PlayerViewManager* GetPlayerViewManager() { return GetVTable<PlayerViewManager* (__thiscall*)(void*)>(this, t_GetPlayerViewManager)(this); }
ModelInstance* GetPlayerObject() { return GetVTable<ModelInstance*(__thiscall*)(void*)>(this, t_GetPlayerObject)(this); }
ModelInstance* GetClientObject() { return GetVTable<ModelInstance* (__thiscall*)(void*)>(this, t_pClient_GetClientObject)(this); }
void SetClientObject(ModelInstance* hObj) { GetVTable<ModelInstance* (__thiscall*)(void*, ModelInstance*)>(this, t_pClient_SetClientObject)(this, hObj); }
int GetWeaponID() { return GetVTable<int(__thiscall*)(void*)>(this, t_GetWeaponId)(this); }
int GetCharacterTypeId() { return GetVTable<int(__thiscall*)(void*)>(this, t_GetCharacterTypeId)(this); }
int GetFastFire() { return GetVTable<int(__thiscall*)(void*)>(this, t_GetFireSpeedRate)(this); }
void SetFastFire(int value) { GetVTable<int(__thiscall*)(void*, int)>(this, t_SetFireSpeedRate)(this, value); }
int GetWeaponState() { return GetVTable<int(__thiscall*)(void*)>(this, t_GetWeaponState)(this); }
void SetWeaponState(int value) { GetVTable<int(__thiscall*)(void*, int)>(this, t_SetWeaponState)(this, value); }
bool IsReloading() { return this->GetWeaponState() == eWeaponState::WS_RELOADING }
bool IsSwitching() { return this->GetWeaponState() == eWeaponState::WS_SWITCHING; }
};
class FX_PROP : public IBase
{
public:
const char* GetFXName() { return this->GetStringP(0x0000); }
int GetType() { return this->GetValue<int>(0x000C); }
void SetType(int value) { this->SetValue<int>(0x000C, value); }
float Current() { return this->GetValue<float>(0x0010); }
float Max() { return this->GetValue<float>(0x0014); }
};
class CClientFXMgr : public IBase
{
public:
CClientFXMgr* GetPrev() { return this->GetValue<CClientFXMgr*>(0x0000); }
CClientFXMgr* GetNext() { return this->GetValue<CClientFXMgr*>(0x0004); }
FX_PROP* GetFX_PROP() { return this->GetValue<FX_PROP*>(0x0008); }
};
class CInterfaceMgr : public IBase
{
public:
CInterfaceResMgr* GetCInterfaceResMgr() { return this->GetValue<CInterfaceResMgr*>(0x0004); }
CScreenMgr* GetCScreenMgr() { return this->GetValue<CScreenMgr*>(0x0010); } //or 0x0014
CSetWeaponUI* GetCSetWeaponUI() { return this->GetValue<CSetWeaponUI*>(0x0018); }
CDecisionUI* GetCDecisionUI() { return this->GetValue<CDecisionUI*>(0x0020); }
CGameGuideUI* GetCGameGuideUI() { return this->GetValue<CGameGuideUI*>(0x0024); }
CTutorialWnd* GetCTutorialWnd() { return this->GetValue<CTutorialWnd*>(0x0028); }
CObserverGuideUI* GetCObserverGuideUI() { return this->GetValue<CObserverGuideUI*>(0x002C); }
ILTClient* GetILTClient() { return this->GetValue<ILTClient*>(0x0030); }
CSysTexInterface* GetCSysTexInterface() { return this->GetValue<CSysTexInterface*>(0x0034); }
CD3DDrawPrim* GetCD3DDrawPrim() { return this->GetValue<CD3DDrawPrim*>(0x0038); }
CTopMostPopupMgr* GetCTopMostPopupMgr() { return this->GetValue<CTopMostPopupMgr*>(0x003C); }
LoadingScreenMgr* GetLoadingScreenMgr() { return this->GetValue<LoadingScreenMgr*>(0x0040); }
CAIMgr* GetCAIMgr() { return this->GetValue<CAIMgr*>(0x0094); }
CAICInt* GetCAICInt(int id) { return this->GetValue<CAICInt*>(0x009C + (id * 0x0290)); }
};
class IClientShell : public IBase
{
public:
};
class IClientShellStub : public IClientShell
{
public:
};
class CLTClientShell : public IClientShellStub
{
public:
CClientFXMgr* GetClientFXMgr() { return this->GetValue<CClientFXMgr*>(0x????); }
CPlayerClnt* GetPlayerMgr() { return this->GetValue<CPlayerClnt*>(0x0078); }
PlayerViewManager* GetPlayerViewManager() { return this->GetPlayerMgr()->GetPlayerViewManager(); }
CInterfaceMgr* GetInterfaceMgr() { return (CInterfaceMgr*)((uintptr_t)this + 0x????); }
CharacFX* GetLocalCharacFX() { return this->GetPlayerViewManager()->GetLocalCharacFX(); }
CWeaponMgr* GetWeapon() { return this->GetLocalCharacFX()->GetWeapon(); }
};