From 6ae30c9b15fcc200c7b642016e7adbfdf9b979f4 Mon Sep 17 00:00:00 2001 From: BobTheBob9 Date: Tue, 12 Jul 2022 14:05:02 +0100 Subject: move exploit prevention and limits code out of serverauthentication, and have actual defs for CBasePlayer --- NorthstarDLL/r2server.h | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'NorthstarDLL/r2server.h') diff --git a/NorthstarDLL/r2server.h b/NorthstarDLL/r2server.h index 816adc82..c032d722 100644 --- a/NorthstarDLL/r2server.h +++ b/NorthstarDLL/r2server.h @@ -14,6 +14,44 @@ namespace R2 extern server_state_t* g_pServerState; // server entity stuff - typedef void* (*Server_GetEntityByIndexType)(int index); - extern Server_GetEntityByIndexType Server_GetEntityByIndex; + extern void* (*Server_GetEntityByIndex)(int index); + + const int PERSISTENCE_MAX_SIZE = 0xD000; + + enum class ePersistenceReady : char + { + NOT_READY, + READY = 3, + READY_LOCAL = 3, + READY_REMOTE + }; + + #pragma pack(push, 1) + struct CBasePlayer + { + char pad0[0x16]; + + // +0x16 + char m_Name[64]; + // +0x56 + + char pad1[0x44A]; + + // +0x4A0 + ePersistenceReady m_iPersistenceReady; + // +0x4A1 + + char pad2[0x59]; + + // +0x4FA + char m_PersistenceBuffer[PERSISTENCE_MAX_SIZE]; + + char pad3[0x2006]; + + // +0xF500 + char m_UID[32]; + }; + #pragma pack(pop) + + extern CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex); } // namespace R2 \ No newline at end of file -- cgit v1.2.3