Начинающий
-
Автор темы
- #1
Код:
class IEngineClient : IAppSystem
{
public:
virtual bool IsPaused(void) = 0;
virtual float GetTimeScale(void) = 0;
virtual void FindOrCreateWorldSession(void) = 0;
virtual void GetEntityLumpForTemplate(void) = 0;
virtual void GetStatsAppID(void) = 0;
virtual void* GetGameClientFactory(void) = 0;
virtual void* GetSteamUniverse(void) = 0; // Added Late June 2018
virtual void ServerCmd(int inputCommandSrc, const char* command) = 0;
virtual void ClientCmd(int inputCommandSrc, const char* command) = 0;
virtual bool GetPlayerInfo(int iIndex, player_info_t* pInfo) = 0; // 20
virtual int GetPlayerForUserID(int ID) = 0;
virtual int GetLocalPlayer(int& LocalPlayerID, int splitScreenSlot = 0) = 0;
virtual long GetLastTimestamp(void) = 0;
....
class CGameEntitySystem {
public:
virtual void n_0();
virtual void BuildResourceManifest(void); // 01
virtual void n_2();
virtual void n_3();
virtual void n_4();
virtual void n_5();
virtual void n_6();
virtual void AddRefKeyValues(); // 7
virtual void ReleaseKeyValues(); // 8
virtual void n_9();
virtual void n_10();
virtual void ClearEntityDatabase(void); // 11
virtual CEntityInstance* FindEntityProcedural(const char *...);
virtual CEntityInstance * OnEntityParentChanged (CEntityInstance *, CEntityInstance *); // 13
virtual CEntityInstance* OnAddEntity(CEntityInstance*, CEntityHandle); // 14
virtual CEntityInstance * OnRemoveEntity (CEntityInstance *, CEntityHandle); // 15
virtual void n_16();
virtual void SortEntities(int, EntitySpawnInfo_t*, int*, int*); // 17
virtual void n_18();
virtual void n_19();
virtual void n_20();
virtual void n_21();
void* unk;
CEntityIdentities* m_pEntityList[MAX_ENTITY_LISTS];
CEntityInstance* GetBaseEntity(int index)
{
if (index <= -1 || index >= MAX_TOTAL_ENTITIES)
return nullptr;
int listToUse = (index / MAX_ENTITIES_IN_LIST);
if (!m_pEntityList[listToUse])
return nullptr;
if (m_pEntityList[listToUse]->m_pIdentities[index % MAX_ENTITIES_IN_LIST].entity)
return m_pEntityList[listToUse]->m_pIdentities[index % MAX_ENTITIES_IN_LIST].entity;
else
return nullptr;
}
};
void Start(){
void* client = GetInterface("client.dll", "Source2Client002");
uintptr_t* vmt_slot = *(uintptr_t**)client + 25;
uintptr_t addr_start = *vmt_slot + 3;
entity = *(CGameEntitySystem**)(addr_start + *(uint32_t*)(addr_start)+4);
IEngineClient* engine = static_cast<IEngineClient*>(GetInterface("engine2.dll", "Source2EngineToClient001"));
int result = 0;
int entID= engine->GetLocalPlayer(result , 0);
CBaseEntity* ent = (CBaseEntity*)entity->GetBaseEntity(entID);
}
both result and entID only returns 0.
any help please ? thanks