2022-02-24 01:51:11 +01:00
|
|
|
//=============================================================================//
|
|
|
|
//
|
|
|
|
// Purpose: Interface server dll virtual functions to the SDK.
|
|
|
|
//
|
|
|
|
// $NoKeywords: $
|
|
|
|
//=============================================================================//
|
|
|
|
|
|
|
|
class CServerGameDLL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void GameInit(void);
|
|
|
|
void PrecompileScriptsJob(void);
|
|
|
|
void LevelShutdown(void);
|
|
|
|
void GameShutdown(void);
|
|
|
|
float GetTickInterval(void);
|
2022-09-18 20:42:16 +01:00
|
|
|
|
|
|
|
static void __fastcall OnReceivedSayTextMessage(void* thisptr, int senderId, const char* text, bool isTeamChat);
|
2022-02-24 01:51:11 +01:00
|
|
|
};
|
2022-04-12 02:48:46 +02:00
|
|
|
class CServerGameClients
|
|
|
|
{
|
|
|
|
};
|
2022-02-24 01:51:11 +01:00
|
|
|
|
2022-09-18 20:42:16 +01:00
|
|
|
inline CMemory p_CServerGameDLL__OnReceivedSayTextMessage;
|
|
|
|
inline auto CServerGameDLL__OnReceivedSayTextMessage = p_CServerGameDLL__OnReceivedSayTextMessage.RCast<void(__fastcall*)(void* thisptr, int senderId, const char* text, bool isTeamChat)>();
|
|
|
|
|
2022-02-24 01:51:11 +01:00
|
|
|
extern CServerGameDLL* g_pServerGameDLL;
|
2022-04-12 02:48:46 +02:00
|
|
|
extern CServerGameClients* g_pServerGameClients;
|
2022-02-24 01:51:11 +01:00
|
|
|
|
2022-09-18 20:42:16 +01:00
|
|
|
void CServerGameDLL_Attach();
|
|
|
|
void CServerGameDLL_Detach();
|
|
|
|
|
2022-02-24 01:51:11 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VServerGameDLL : public IDetour
|
2022-02-24 01:51:11 +01:00
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2022-02-24 01:51:11 +01:00
|
|
|
{
|
2022-09-21 21:07:43 +02:00
|
|
|
spdlog::debug("| FUN: OnReceivedSayTextMessage : {:#18x} |\n", p_CServerGameDLL__OnReceivedSayTextMessage.GetPtr());
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("| VAR: g_pServerGameDLL : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pServerGameDLL));
|
|
|
|
spdlog::debug("| VAR: g_pServerGameClients : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pServerGameClients));
|
|
|
|
spdlog::debug("+----------------------------------------------------------------+\n");
|
2022-02-24 01:51:11 +01:00
|
|
|
}
|
2022-09-18 20:42:16 +01:00
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
|
|
|
#if defined(GAMEDLL_S3)
|
|
|
|
p_CServerGameDLL__OnReceivedSayTextMessage = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x85\xD2\x0F\x8E\x00\x00\x00\x00\x4C\x8B\xDC"), "xxxx????xxx");
|
|
|
|
|
|
|
|
CServerGameDLL__OnReceivedSayTextMessage = p_CServerGameDLL__OnReceivedSayTextMessage.RCast<void(__fastcall*)(void* thisptr, int senderId, const char* text, bool isTeamChat)>();
|
|
|
|
#endif
|
|
|
|
}
|
2022-04-12 02:48:46 +02:00
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
|
|
|
g_pServerGameDLL = p_SV_CreateBaseline.Offset(0x0).FindPatternSelf("48 8B", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).Deref().RCast<CServerGameDLL*>();
|
2022-08-09 03:02:00 +02:00
|
|
|
g_pServerGameClients = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x0F\xB7\x51\x14"), "xxxx?xxxx????xxxx").
|
2022-04-12 02:48:46 +02:00
|
|
|
FindPatternSelf("48 8B 0D", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CServerGameClients*>();
|
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
|
|
|
virtual void Attach(void) const { }
|
|
|
|
virtual void Detach(void) const { }
|
2022-02-24 01:51:11 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2022-05-13 14:53:25 +02:00
|
|
|
REGISTER(VServerGameDLL);
|