Update all function casts

This commit is contained in:
Kawe Mazidjatari 2022-04-09 06:05:47 +02:00
parent e2f06a8a68
commit b3631facbe
48 changed files with 297 additions and 282 deletions

View File

@ -79,7 +79,7 @@ void __fastcall HFrameStageNotify(CHLClient* rcx, ClientFrameStage_t frameStage)
}
g_pIConsole->Think();
g_pRConClient->RunFrame();
CHLClient_FrameStageNotify(rcx, (int)frameStage);
CHLClient_FrameStageNotify(rcx, frameStage);
}
//-----------------------------------------------------------------------------

View File

@ -41,31 +41,31 @@ public:
/* ==== CHLCLIENT ======================================================================================================================================================= */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CHLClient_PostInit = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\x3D\x00\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00"), "xxx?????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????");
inline void* (*CHLClient_PostInit)() = (void* (*)())p_CHLClient_PostInit.GetPtr(); /*48 83 3D ? ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ?*/
inline auto CHLClient_PostInit = p_CHLClient_PostInit.RCast<void*(*)(void)>(); /*48 83 3D ? ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ? 48 89 05 ? ? ? ? 48 8D 05 ? ? ? ?*/
inline ADDRESS p_CHLClient_LevelShutdown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x56\x41\x54\x41\x56\x48\x83\xEC\x28\x48\x8B\xF1"), "xxxxxxxxxxxxxx");
inline void* (*CHLClient_LevelShutdown)(void* thisptr) = (void* (*)(void*))p_CHLClient_LevelShutdown.GetPtr(); /*40 53 56 41 54 41 56 48 83 EC 28 48 8B F1*/
inline auto CHLClient_LevelShutdown = p_CHLClient_LevelShutdown.RCast<void*(*)(void* thisptr)>(); /*40 53 56 41 54 41 56 48 83 EC 28 48 8B F1*/
inline ADDRESS p_CHLClient_FrameStageNotify = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x38\x89\x15\x00\x00\x00\x00"), "xxxxxx????");
inline void (*CHLClient_FrameStageNotify)(void* rcx, int curStage) = (void(*)(void*, int))p_CHLClient_FrameStageNotify.GetPtr(); /*48 83 EC 38 89 15 ?? ?? ?? ??*/
inline auto CHLClient_FrameStageNotify = p_CHLClient_FrameStageNotify.RCast<void(*)(void* rcx, ClientFrameStage_t frameStage)>(); /*48 83 EC 38 89 15 ?? ?? ?? ??*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CHLClient_PostInit = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x48\x83\x3D\x00\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00"), "xxxxxxx?????xxx????");
inline void* (*CHLClient_PostInit)() = (void* (*)())p_CHLClient_PostInit.GetPtr(); /*48 83 EC 28 48 83 3D ? ? ? ? ? 48 8D 05 ? ? ? ?*/
inline auto CHLClient_PostInit = p_CHLClient_PostInit.RCast<void*(*)(void)>(); /*48 83 EC 28 48 83 3D ? ? ? ? ? 48 8D 05 ? ? ? ?*/
inline ADDRESS p_CHLClient_LevelShutdown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xF9\x48\x8D\x0D\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxxxxxxxxx????");
inline void* (*CHLClient_LevelShutdown)(void* thisptr) = (void* (*)(void*))p_CHLClient_LevelShutdown.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B F9 48 8D 0D ? ? ? ?*/
inline auto CHLClient_LevelShutdown = p_CHLClient_LevelShutdown.RCast<void* (*)(void* thisptr)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B F9 48 8D 0D ? ? ? ?*/
inline ADDRESS p_CHLClient_FrameStageNotify = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x89\x15\x00\x00\x00\x00"), "xxxxxx????");
inline void (*CHLClient_FrameStageNotify)(void* rcx, int curStage) = (void(*)(void*, int))p_CHLClient_FrameStageNotify.GetPtr(); /*48 83 EC 28 89 15 ?? ?? ?? ??*/
inline auto CHLClient_FrameStageNotify = p_CHLClient_FrameStageNotify.RCast<void(*)(void* thisptr, ClientFrameStage_t frameStage)>(); /*48 83 EC 28 89 15 ?? ?? ?? ??*/
#endif
inline ADDRESS p_CHLClient_HudProcessInput = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x0F\xB6\x0D\x00\x00\x00\x00\x88\x15\x00\x00\x00\x00"), "xxxxxxx????xx????");
inline void (*CHLClient_HudProcessInput)(void* thisptr, bool bActive) = (void(*)(void*, bool))p_CHLClient_HudProcessInput.GetPtr(); /*48 83 EC 28 0F B6 0D ? ? ? ? 88 15 ? ? ? ?*/
inline auto CHLClient_HudProcessInput = p_CHLClient_HudProcessInput.RCast<void(*)(void* thisptr, bool bActive)>(); /*48 83 EC 28 0F B6 0D ? ? ? ? 88 15 ? ? ? ?*/
inline bool* cl_time_use_host_tickcount = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x80\x3D\x00\x00\x00\x00\x00\x74\x14\x66\x0F\x6E\x05\x00\x00\x00\x00"), "xx?????xxxxxx????").ResolveRelativeAddress(0x2, 0x7).RCast<bool*>();
///////////////////////////////////////////////////////////////////////////////
void __fastcall HFrameStageNotify(CHLClient* rcx, ClientFrameStage_t curStage);
void __fastcall HFrameStageNotify(CHLClient* rcx, ClientFrameStage_t frameStage);
void PatchNetVarConVar();
void CHLClient_Attach();

View File

@ -2,7 +2,7 @@
/* ==== CVENGINECLIENT ================================================================================================================================================== */
inline ADDRESS p_IVEngineClient_CommandExecute = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x08\x57\x48\x83\xEC\x20\x48\x8D\x0D\x27\x61\xa5\x1E\x41\x8B\xD8"), "xxxx?xxxxxxxx????xxx");
inline void (*IVEngineClient_CommandExecute)(void* self, const char* cmd) = (void (*)(void*, const char*))p_IVEngineClient_CommandExecute.GetPtr(); /*48 89 5C 24 ?? 57 48 83 EC 20 48 8D 0D ?? ?? ?? ?? 41 8B D8*/
inline auto IVEngineClient_CommandExecute = p_IVEngineClient_CommandExecute.RCast<void(*)(void* thisptr, const char* pCmd)>(); /*48 89 5C 24 ?? 57 48 83 EC 20 48 8D 0D ?? ?? ?? ?? 41 8B D8*/
///////////////////////////////////////////////////////////////////////////////

View File

@ -2,20 +2,20 @@
#include "tier0/completion.h"
#include "public/include/utility.h"
#ifdef DEDICATED
//#ifdef DEDICATED
inline ADDRESS p_EbisuSDK_Init_Tier0 = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x80\x3D\x00\x00\x00\x00\x00\x0F\x85\x00\x02\x00\x00\x48\x89\x5C\x24\x20"), "xxxxxx????xxx?xxxxxxxx");
inline void(*EbisuSDK_Init_Tier0) = (void(*))p_EbisuSDK_Init_Tier0.GetPtr(); /*48 83 EC 28 80 3D ?? ?? ?? ?? 00 0F 85 ?? 02 00 00 48 89 5C 24 20*/
inline auto EbisuSDK_Init_Tier0 = p_EbisuSDK_Init_Tier0.RCast<void(*)(void)>(); /*48 83 EC 28 80 3D ?? ?? ?? ?? 00 0F 85 ?? 02 00 00 48 89 5C 24 20*/
inline ADDRESS p_EbisuSDK_CVar_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x57\x48\x83\xEC\x40\x83\x3D"), "xxxxxxxx");
inline void(*EbisuSDK_CVar_Init) = (void(*))p_EbisuSDK_CVar_Init.GetPtr(); /*40 57 48 83 EC 40 83 3D*/
inline auto EbisuSDK_CVar_Init = p_EbisuSDK_CVar_Init.RCast<void(*)(void)>(); /*40 57 48 83 EC 40 83 3D*/
inline ADDRESS p_EbisuSDK_SetState = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x81\xEC\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x0F\x84\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x74\x5B"), "xxx????xx?????xx????xx?????xx");
inline void(*EbisuSDK_SetState) = (void(*))p_EbisuSDK_SetState.GetPtr(); /*48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 0F 84 ? ? ? ? 80 3D ? ? ? ? ? 74 5B*/
inline auto EbisuSDK_SetState = p_EbisuSDK_SetState.RCast<void(*)(void)>(); /*48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 0F 84 ? ? ? ? 80 3D ? ? ? ? ? 74 5B*/
inline bool* g_bEbisuSDKInitialized = p_EbisuSDK_Init_Tier0.Offset(0x0).FindPatternSelf("80 3D", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
inline bool* g_bEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.Offset(0x12A).FindPatternSelf("C6 05", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
inline bool* g_qEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.Offset(0x20).FindPatternSelf("4C 89 05", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast<bool*>();
#endif // DEDICATED
//#endif // DEDICATED
///////////////////////////////////////////////////////////////////////////////

View File

@ -71,10 +71,10 @@ static_assert(sizeof(CBaseClient) == 0x4A4C0);
/* ==== CBASECLIENT ===================================================================================================================================================== */
inline ADDRESS p_CBaseClient_Connect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x41\x56\x41\x57\x48\x83\xEC\x20\x48\x8B\xD9\x48\x89\x74"), "xxxxxxxxxxxxxxxx"); /*40 53 41 56 41 57 48 83 EC 20 48 8B D9 48 89 74*/
inline bool (*CBaseClient_Connect)(CBaseClient* pClient, const char* szName, void* pNetChannel, bool bFakePlayer, void* a5, char* szMessage, int nMessageSize) = (bool (*)(CBaseClient*, const char*, void*, bool, void*, char*, int))p_CBaseClient_Connect.GetPtr();
inline auto CBaseClient_Connect = p_CBaseClient_Connect.RCast<bool (*)(CBaseClient* thisptr, const char* szName, void* pNetChannel, bool bFakePlayer, void* a5, char* szMessage, int nMessageSize)>();
inline ADDRESS p_CBaseClient_Clear = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x41\x56\x41\x57\x48\x83\xEC\x20\x48\x8B\xD9\x48\x89\x74"), "xxxxxxxxxxxxxxxx");
inline void (*CBaseClient_Clear)(CBaseClient* pClient) = (void (*)(CBaseClient*))p_CBaseClient_Clear.GetPtr(); /*40 53 41 56 41 57 48 83 EC 20 48 8B D9 48 89 74*/
inline auto CBaseClient_Clear = p_CBaseClient_Clear.RCast<void (*)(CBaseClient* thisptr)>(); /*40 53 41 56 41 57 48 83 EC 20 48 8B D9 48 89 74*/
inline ADDRESS g_pClientBuffer = p_IVEngineServer__PersistenceAvailable.FindPatternSelf("48 8D 0D", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7);

View File

@ -1,18 +1,6 @@
#pragma once
#include "engine/debugoverlay.h"
/* ==== CCLIENTSTATE ==================================================================================================================================================== */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
//inline ADDRESS p_CClientState__CheckForResend = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x56\x57\x41\x57\x00\x81\xEC\x20\x04\x00\x00\x45\x0F\xB6\xF9\x00\x00\x00\x00\x8B\xF1\x48"), "xxxx?xxxx?xxxx?xxxxx????xxx"); /*48 89 5C 24 ?? 56 57 41 57 ?? 81 EC 20 04 ?? 00 45 0F B6 F9 ?? ?? ?? ?? 8B F1 48*/
//inline void (*CClientState__CheckForResend)(std::int64_t a1, const char* a2, std::int64_t a3, char a4, int a5, std::uint8_t* a6) = (void(*)(std::int64_t, const char*, std::int64_t, char, int, std::uint8_t*))p_CClientState__CheckForResend.GetPtr();
#elif defined (GAMEDLL_S2)
//inline ADDRESS p_CClientState__CheckForResend = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x45\x0F\xB6"), "xxxx?xxxx?xxxx?xxxxx????xxx"); /*48 89 5C 24 ?? 48 89 74 24 ?? 48 89 7C 24 ?? 41 56 48 81 EC ?? ?? ?? ?? 45 0F B6*/
//inline void (*CClientState__CheckForResend)(std::int64_t a1, const char* a2, std::int64_t a3, char a4, int a5, std::uint8_t* a6) = (void(*)(std::int64_t, const char*, std::int64_t, char, int, std::uint8_t*))p_CClientState__CheckForResend.GetPtr();
#elif defined (GAMEDLL_S3)
//inline ADDRESS p_CClientState__CheckForResend = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x32"), "xxxx?xxxx?xxxx?xxxxx????xxx"); /*48 89 5C 24 ?? 48 89 74 24 ?? 48 89 7C 24 ?? 41 56 48 81 EC ?? ?? ?? ?? 48 8B 32*/
//inline void (*CClientState__CheckForResend)(std::int64_t a1, const char* a2, std::int64_t a3, char a4, int a5, std::uint8_t* a6) = (void(*)(std::int64_t, const char*, std::int64_t, char, int, std::uint8_t*))p_CClientState__CheckForResend.GetPtr();
#endif
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline bool* cl_m_bPaused = p_DrawAllOverlays.Offset(0x90).FindPatternSelf("80 3D ? ? ? 0B ?", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x2).RCast<bool*>();
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
@ -32,9 +20,20 @@ public:
int GetClientTickCount() const; // Get the client tick count.
void SetClientTickCount(int tick); // Set the client tick count.
};
extern CBaseClientState* g_pBaseClientState;
/* ==== CCLIENTSTATE ==================================================================================================================================================== */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
//inline ADDRESS p_CClientState__CheckForResend = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x56\x57\x41\x57\x00\x81\xEC\x20\x04\x00\x00\x45\x0F\xB6\xF9\x00\x00\x00\x00\x8B\xF1\x48"), "xxxx?xxxx?xxxx?xxxxx????xxx"); /*48 89 5C 24 ?? 56 57 41 57 ?? 81 EC 20 04 ?? 00 45 0F B6 F9 ?? ?? ?? ?? 8B F1 48*/
//inline auto CClientState__CheckForResend = p_CClientState__CheckForResend.RCast<void(*)(CBaseClientState* thisptr, const char* a2, std::int64_t a3, char a4, int a5, std::uint8_t* a6)>();
#elif defined (GAMEDLL_S2)
//inline ADDRESS p_CClientState__CheckForResend = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x45\x0F\xB6"), "xxxx?xxxx?xxxx?xxxxx????xxx"); /*48 89 5C 24 ?? 48 89 74 24 ?? 48 89 7C 24 ?? 41 56 48 81 EC ?? ?? ?? ?? 45 0F B6*/
//inline auto CClientState__CheckForResend = p_CClientState__CheckForResend.RCast<void(*)(CBaseClientState* thisptr, const char* a2, std::int64_t a3, char a4, int a5, std::uint8_t* a6)>();
#elif defined (GAMEDLL_S3)
//inline ADDRESS p_CClientState__CheckForResend = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x32"), "xxxx?xxxx?xxxx?xxxxx????xxx"); /*48 89 5C 24 ?? 48 89 74 24 ?? 48 89 7C 24 ?? 41 56 48 81 EC ?? ?? ?? ?? 48 8B 32*/
//inline auto CClientState__CheckForResend = p_CClientState__CheckForResend.RCast<void(*)(CBaseClientState* thisptr, const char* a2, std::int64_t a3, char a4, int a5, std::uint8_t* a6)>();
#endif
///////////////////////////////////////////////////////////////////////////////
class HClientState : public IDetour
{

View File

@ -13,8 +13,6 @@ class HBaseServer : public IDetour
{
virtual void debugp()
{
//std::cout << "| VAR: g_dwMaxClients : 0x" << std::hex << std::uppercase << g_dwMaxClients << std::setw(0) << " |" << std::endl;
//std::cout << "| VAR: g_dwMaxFakeClients : 0x" << std::hex << std::uppercase << g_dwMaxFakeClients << std::setw(0) << " |" << std::endl;
//std::cout << "+----------------------------------------------------------------+" << std::endl;
}
};

View File

@ -16,18 +16,18 @@
// Purpose: loads required pakfile assets for specified BSP
// Input : svSetFile -
//-----------------------------------------------------------------------------
void MOD_PreloadPak(const std::string& svSetFile)
void MOD_PreloadPak(const string& svSetFile)
{
std::ostringstream ostream;
ostringstream ostream;
ostream << "platform\\scripts\\levels\\settings\\" << g_pHostState->m_levelName << ".json";
std::filesystem::path fsPath = std::filesystem::current_path() /= ostream.str();
fs::path fsPath = std::filesystem::current_path() /= ostream.str();
if (FileExists(fsPath.string().c_str()))
{
nlohmann::json jsIn;
try
{
std::ifstream iPakLoadDefFile(fsPath, std::ios::binary); // Parse prerequisites file.
ifstream iPakLoadDefFile(fsPath, std::ios::binary); // Parse prerequisites file.
iPakLoadDefFile >> jsIn;
iPakLoadDefFile.close();
@ -39,8 +39,8 @@ void MOD_PreloadPak(const std::string& svSetFile)
{
if (it.value().is_string())
{
std::string svToLoad = it.value().get<std::string>() + ".rpak";
std::uint32_t nPakId = RTech_AsyncLoad((void*)svToLoad.c_str(), g_pMallocPool.GetPtr(), 4, 0);
string svToLoad = it.value().get<string>() + ".rpak";
uint32_t nPakId = RTech_AsyncLoad((void*)svToLoad.c_str(), g_pMallocPool.GetPtr(), 4, 0);
if (nPakId == -1)
{

View File

@ -2,13 +2,13 @@
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CollisionBSPData_LinkPhysics = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\x48\x83\xC1\x08\xE8\x00\x00\x00\x00\x48\x8D\x4B\x68"), "xxxxxxxxxxxxxx????xxxx");
inline uint64_t(*CollisionBSPData_LinkPhysics)(void* thisptr) = (uint64_t(*)(void*))p_CollisionBSPData_LinkPhysics.GetPtr(); /*40 53 48 83 EC 20 48 8B D9 48 83 C1 08 E8 ? ? ? ? 48 8D 4B 68*/
inline auto CollisionBSPData_LinkPhysics = p_CollisionBSPData_LinkPhysics.RCast<uint64_t(*)(void* thisptr)>(); /*40 53 48 83 EC 20 48 8B D9 48 83 C1 08 E8 ? ? ? ? 48 8D 4B 68*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CollisionBSPData_LinkPhysics = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xF9\x33\xED"), "xxxx?xxxx?xxxx????xxxxx");
inline uint64_t(*CollisionBSPData_LinkPhysics)(void* thisptr) = (uint64_t(*)(void*))p_CollisionBSPData_LinkPhysics.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 57 48 81 EC ? ? ? ? 48 8B F9 33 ED*/
inline auto CollisionBSPData_LinkPhysics = p_CollisionBSPData_LinkPhysics.RCast<uint64_t(*)(void* thisptr)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 57 48 81 EC ? ? ? ? 48 8B F9 33 ED*/
#endif
void MOD_PreloadPak(const std::string& svSetFile);
void MOD_PreloadPak(const string& svSetFile);
///////////////////////////////////////////////////////////////////////////////
class HModel_BSP : public IDetour
{

View File

@ -2,8 +2,7 @@
/* ==== COMMON ========================================================================================================================================================== */
inline ADDRESS p_COM_ExplainDisconnection = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x89\x50\x10\x4C\x89\x40\x18\x4C\x89\x48\x20\x48\x81\xEC\x00\x00\x00\x00"), "xxxxxxxxxxxxxxxxxx????");
inline void* (*COM_ExplainDisconnection)(std::uint64_t level, const char* fmt, ...) = (void* (*)(std::uint64_t, const char*, ...))p_COM_ExplainDisconnection.GetPtr(); /*48 8B C4 48 89 50 10 4C 89 40 18 4C 89 48 20 48 81 EC ? ? ? ?*/
inline auto COM_ExplainDisconnection = p_COM_ExplainDisconnection.RCast<void* (*)(uint64_t level, const char* fmt, ...)>(); /*48 8B C4 48 89 50 10 4C 89 40 18 4C 89 48 20 48 81 EC ? ? ? ?*/
///////////////////////////////////////////////////////////////////////////////
class HCommon : public IDetour

View File

@ -101,22 +101,22 @@ void DebugOverlays_Detach();
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_DrawAllOverlays = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x48\x83\xEC\x50\x48\x8B\x05\x00\x00\x00\x00"), "xxxxxxxxx????");
inline void (*DrawAllOverlays)(char a1) = (void (*)(char))p_DrawAllOverlays.GetPtr(); /*40 55 48 83 EC 50 48 8B 05 ? ? ? ?*/
inline auto DrawAllOverlays = p_DrawAllOverlays.RCast<void (*)(char a1)>(); /*40 55 48 83 EC 50 48 8B 05 ? ? ? ?*/
inline ADDRESS p_RenderBox = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x44\x89\x4C\x24\x00"), "xxxx?xxxx?xxxx?"); /*48 89 5C 24 ? 48 89 6C 24 ? 44 89 4C 24 ?*/
inline void* (*RenderBox)(Vector3 origin, QAngle angles, Vector3 vMins, Vector3 vMaxs, Color color, bool bZBuffer) = (void* (*)(Vector3, QAngle, Vector3, Vector3, Color, bool))p_RenderBox.GetPtr();
inline ADDRESS p_RenderBox = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x44\x89\x4C\x24\x00"), "xxxx?xxxx?xxxx?");
inline auto RenderBox = p_RenderBox.RCast<void* (*)(Vector3 origin, QAngle angles, Vector3 vMins, Vector3 vMaxs, Color color, bool bZBuffer)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 44 89 4C 24 ?*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_DrawAllOverlays = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x48\x83\xEC\x30\x48\x8B\x05\x00\x00\x00\x00\x0F\xB6\xE9"), "xxxxxxxxx????xxx");
inline void (*DrawAllOverlays)(char a1) = (void (*)(char))p_DrawAllOverlays.GetPtr(); /*40 55 48 83 EC 30 48 8B 05 ? ? ? ? 0F B6 E9*/
inline auto DrawAllOverlays = p_DrawAllOverlays.RCast<void (*)(char a1)>(); /*40 55 48 83 EC 30 48 8B 05 ? ? ? ? 0F B6 E9*/
inline ADDRESS p_RenderBox = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x44\x89\x4C\x24\x00"), "xxxx?xxxx?xxxx?"); /*48 89 5C 24 ? 48 89 6C 24 ? 44 89 4C 24 ?*/
inline void* (*RenderBox)(Vector3 origin, QAngle angles, Vector3 vMins, Vector3 vMaxs, Color color, bool bZBuffer) = (void* (*)(Vector3, QAngle, Vector3, Vector3, Color, bool))p_RenderBox.GetPtr();
inline ADDRESS p_RenderBox = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x44\x89\x4C\x24\x00"), "xxxx?xxxx?xxxx?");
inline auto RenderBox = p_RenderBox.RCast<void* (*)(Vector3 origin, QAngle angles, Vector3 vMins, Vector3 vMaxs, Color color, bool bZBuffer)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 44 89 4C 24 ?*/
#endif
inline ADDRESS p_RenderLine = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x74\x24\x00\x44\x89\x44\x24\x00\x57\x41\x56"), "xxxx?xxxx?xxx"); /*48 89 74 24 ? 44 89 44 24 ? 57 41 56*/
inline void* (*RenderLine)(Vector3 origin, Vector3 dest, Color color, bool bZBuffer) = (void* (*)(Vector3, Vector3, Color, bool))p_RenderLine.GetPtr();
inline ADDRESS p_RenderLine = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x74\x24\x00\x44\x89\x44\x24\x00\x57\x41\x56"), "xxxx?xxxx?xxx");
inline auto RenderLine = p_RenderLine.RCast<void* (*)(Vector3 origin, Vector3 dest, Color color, bool bZBuffer)>(); /*48 89 74 24 ? 44 89 44 24 ? 57 41 56*/
inline ADDRESS p_DestroyOverlay = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\x48\x8D\x0D\x00\x00\x00\x00\xFF\x15\x00\x00\x00\x00\x48\x63\x03"), "xxxxxxxxxxxx????xx????xxx");
inline void (*DestroyOverlay)(void* pOverlay) = (void (*)(void*))p_DestroyOverlay.GetPtr(); /*40 53 48 83 EC 20 48 8B D9 48 8D 0D ? ? ? ? FF 15 ? ? ? ? 48 63 03 */
inline auto DestroyOverlay = p_DestroyOverlay.RCast<void (*)(OverlayBase_t* pOverlay)>(); /*40 53 48 83 EC 20 48 8B D9 48 8D 0D ? ? ? ? FF 15 ? ? ? ? 48 63 03 */
inline int* client_debugdraw_int_unk = p_DrawAllOverlays.Offset(0xC0).FindPatternSelf("F3 0F 59", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x4, 0x8).RCast<int*>();
inline float* client_debugdraw_float_unk = p_DrawAllOverlays.Offset(0xD0).FindPatternSelf("F3 0F 10", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x4, 0x8).RCast<float*>();

View File

@ -13,19 +13,19 @@ extern EngineParms_t* g_pEngineParms;
/* ==== HOST ============================================================================================================================================================ */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_Host_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xD9\xFF\x15\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxxxxxxxxxx????xxxxx????");
inline void* (*Host_Init)(bool* bDedicated) = (void* (*)(bool*))p_Host_Init.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 54 41 55 41 56 41 57 48 81 EC ? ? ? ? 48 8B D9 FF 15 ? ? ? ?*/
inline auto Host_Init = p_Host_Init.RCast<void* (*)(bool* bDedicated)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 54 41 55 41 56 41 57 48 81 EC ? ? ? ? 48 8B D9 FF 15 ? ? ? ?*/
inline ADDRESS p_Host_NewGame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x56\x41\x54\x41\x57\x48\x81\xEC\x00\x00\x00\x00\xF2\x0F\x10\x05\x00\x00\x00\x00"), "xxxxxxxxxxx????xxxx????"); /*48 8B C4 56 41 54 41 57 48 81 EC ? ? ? ? F2 0F 10 05 ? ? ? ?*/
inline bool (*Host_NewGame)(char* pszMapName, char* pszMapGroup, bool bLoadGame, char bBackground, LARGE_INTEGER PerformanceCount) = (bool (*)(char*, char*, bool, char, LARGE_INTEGER))p_Host_NewGame.GetPtr();
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_Host_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xAC\x24\x00\x00\x00\x00\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x2B\xE0\x48\x8B\xD9"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxx????x????x????xxxxxx");
inline void* (*Host_Init)(bool* bDedicated) = (void* (*)(bool*))p_Host_Init.GetPtr(); /*48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 55 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 8B D9*/
inline auto Host_Init = p_Host_Init.RCast<void* (*)(bool* bDedicated)>(); /*48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 55 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 8B D9*/
inline ADDRESS p_Host_NewGame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x00\x41\x54\x41\x55\x48\x81\xEC\x70\x04\x00\x00\xF2\x0F\x10\x05\x00\x00\x00\x0B"), "xxx?xxxxxxxxxxxxxxx???x"); /*48 8B C4 ?? 41 54 41 55 48 81 EC 70 04 00 00 F2 0F 10 05 ?? ?? ?? 0B*/
inline bool (*Host_NewGame)(char* pszMapName, char* pszMapGroup, bool bLoadGame, char bBackground, LARGE_INTEGER PerformanceCount) = (bool (*)(char*, char*, bool, char, LARGE_INTEGER))p_Host_NewGame.GetPtr();
inline ADDRESS p_Host_NewGame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x00\x41\x54\x41\x55\x48\x81\xEC\x70\x04\x00\x00\xF2\x0F\x10\x05\x00\x00\x00\x0B"), "xxx?xxxxxxxxxxxxxxx???x");
inline auto Host_NewGame = p_Host_NewGame.RCast<bool (*)(char* pszMapName, char* pszMapGroup, bool bLoadGame, char bBackground, LARGE_INTEGER PerformanceCount)>(); /*48 8B C4 ?? 41 54 41 55 48 81 EC 70 04 00 00 F2 0F 10 05 ?? ?? ?? 0B*/
#endif
inline ADDRESS p_malloc_internal = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE9\x00\x00\x00\x00\xCC\xCC\xCC\x40\x53\x48\x83\xEC\x20\x48\x8D\x05\x00\x00\x00\x00"), "x????xxxxxxxxxxxx????");
inline void* (*malloc_internal)(void* pPool, int64_t size) = (void* (*)(void*, int64_t))p_malloc_internal.GetPtr(); /*E9 ? ? ? ? CC CC CC 40 53 48 83 EC 20 48 8D 05 ? ? ? ?*/
inline auto malloc_internal = p_malloc_internal.RCast<void* (*)(void* pBool, int64_t nSize)>(); /*E9 ? ? ? ? CC CC CC 40 53 48 83 EC 20 48 8D 05 ? ? ? ?*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS g_pMallocPool = p_Host_Init.Offset(0x600).FindPatternSelf("48 8D 15 ?? ?? ?? 01", ADDRESS::Direction::DOWN, 100).ResolveRelativeAddressSelf(0x3, 0x7);

View File

@ -49,7 +49,7 @@ public:
/* ==== CHOSTSTATE ====================================================================================================================================================== */
inline ADDRESS p_CHostState_FrameUpdate = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x08\x48\x89\x6C\x24\x20\xF3\x0F\x11\x54\x24\x18"), "xxxxxxxxxxxxxxxx");
inline void (*CHostState_FrameUpdate)(void* rcx, void* rdx, float time) = (void(*)(void*, void*, float))p_CHostState_FrameUpdate.GetPtr(); /*48 89 5C 24 08 48 89 6C 24 20 F3 0F 11 54 24 18*/
inline auto CHostState_FrameUpdate = p_CHostState_FrameUpdate.RCast<void(*)(void* rcx, void* rdx, float time)>(); /*48 89 5C 24 08 48 89 6C 24 20 F3 0F 11 54 24 18*/
namespace // !TEMP
{

View File

@ -2,34 +2,34 @@
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CModelLoader__FindModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x41\x55\x41\x56\x48\x8D\xAC\x24\x00\x00\x00\x00"), "xxxxxxxxxx????");
inline void*(*CModelLoader__FindModel)(void* thisptr, const char* pszModelName) = (void*(*)(void*, const char*))p_CModelLoader__FindModel.GetPtr(); /*40 55 41 55 41 56 48 8D AC 24 ? ? ? ?*/
inline auto CModelLoader__FindModel = p_CModelLoader__FindModel.RCast<void* (*)(void* thisptr, const char* pszModelName)>(); /*40 55 41 55 41 56 48 8D AC 24 ? ? ? ?*/
inline ADDRESS p_CModelLoader__LoadModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x57\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xFA"), "xxxxxxxx????xxx");
inline void(*CModelLoader__LoadModel)(void* thisptr, void* mod) = (void(*)(void*, void*))p_CModelLoader__LoadModel.GetPtr(); /*40 53 57 41 56 48 81 EC ? ? ? ? 48 8B FA*/
inline auto CModelLoader__LoadModel = p_CModelLoader__LoadModel.RCast<void(*)(void* thisptr, void* mod)>(); /*40 53 57 41 56 48 81 EC ? ? ? ? 48 8B FA*/
inline ADDRESS p_CModelLoader__Studio_LoadModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x55\x56\x57\x41\x54\x41\x56\x48\x8D\xAC\x24\x00\x00\x00\x00"), "xxxx?xxxxxxxxxxx????");
inline void* (*CModelLoader__Studio_LoadModel)(void* thisptr) = (void* (*)(void*))p_CModelLoader__Studio_LoadModel.GetPtr(); /*48 89 5C 24 ? 55 56 57 41 54 41 56 48 8D AC 24 ? ? ? ?*/
inline auto CModelLoader__Studio_LoadModel = p_CModelLoader__Studio_LoadModel.RCast<void* (*)(void* thisptr)>(); /*48 89 5C 24 ? 55 56 57 41 54 41 56 48 8D AC 24 ? ? ? ?*/
inline ADDRESS p_CModelLoader__Map_LoadModelGuts = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x54\x24\x00\x48\x89\x4C\x24\x00\x55\x53\x41\x54\x41\x55\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\xFF\x05\x00\x00\x00\x00"), "xxxx?xxxx?xxxxxxxxxx????xxx????xx????"); // BSP.
inline uint64_t(*CModelLoader__Map_LoadModelGuts)(void* thisptr, void* mod) = (uint64_t(*)(void*, void*))p_CModelLoader__Map_LoadModelGuts.GetPtr(); /*48 89 54 24 ? 48 89 4C 24 ? 55 53 41 54 41 55 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? FF 05 ? ? ? ? */
inline auto CModelLoader__Map_LoadModelGuts = p_CModelLoader__Map_LoadModelGuts.RCast<uint64_t(*)(void* thisptr, void* mod)>(); /*48 89 54 24 ? 48 89 4C 24 ? 55 53 41 54 41 55 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? FF 05 ? ? ? ? */
inline ADDRESS p_CModelLoader__UnloadModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x89\x58\x18\x55\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xDA"), "xxxxxxxxxxx????xxx");
inline uint64_t(*CModelLoader__UnloadModel)(void* thisptr, void* pModel) = (uint64_t(*)(void*, void*))p_CModelLoader__UnloadModel.GetPtr(); /*48 8B C4 48 89 58 18 55 48 81 EC ? ? ? ? 48 8B DA*/
inline auto CModelLoader__UnloadModel = p_CModelLoader__UnloadModel.RCast<uint64_t(*)(void* thisptr, void* pModel)>(); /*48 8B C4 48 89 58 18 55 48 81 EC ? ? ? ? 48 8B DA*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CModelLoader__FindModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x41\x57\x48\x83\xEC\x48\x80\x3A\x2A"), "xxxxxxxxxxx");
inline void*(*CModelLoader__FindModel)(void* thisptr, const char* pszModelName) = (void* (*)(void*, const char*))p_CModelLoader__FindModel.GetPtr(); /*40 55 41 57 48 83 EC 48 80 3A 2A*/
inline auto CModelLoader__FindModel = p_CModelLoader__FindModel.RCast<void* (*)(void* thisptr, const char* pszModelName)>(); /*40 55 41 57 48 83 EC 48 80 3A 2A*/
inline ADDRESS p_CModelLoader__LoadModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x57\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00"), "xxxxxxxx????xxx????");
inline void(*CModelLoader__LoadModel)(void* thisptr, void* mod) = (void(*)(void*, void*))p_CModelLoader__LoadModel.GetPtr(); /*40 53 57 41 57 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ?*/
inline auto CModelLoader__LoadModel = p_CModelLoader__LoadModel.RCast<void(*)(void* thisptr, void* mod)>(); /*40 53 57 41 57 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ?*/
inline ADDRESS p_CModelLoader__Studio_LoadModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x55\x56\x57\x41\x54\x41\x57\x48\x81\xEC\x00\x00\x00\x00"), "xxxx?xxxxxxxxxx????");
inline void*(*CModelLoader__Studio_LoadModel)(void* thisptr) = (void*(*)(void*))p_CModelLoader__Studio_LoadModel.GetPtr(); /*48 89 5C 24 ? 55 56 57 41 54 41 57 48 81 EC ? ? ? ?*/
inline auto CModelLoader__Studio_LoadModel = p_CModelLoader__Studio_LoadModel.RCast<void* (*)(void* thisptr)>(); /*48 89 5C 24 ? 55 56 57 41 54 41 57 48 81 EC ? ? ? ?*/
inline ADDRESS p_CModelLoader__Map_LoadModelGuts = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x54\x24\x00\x48\x89\x4C\x24\x00\x55\x53\x56\x57\x41\x54\x41\x55\x41\x57"), "xxxx?xxxx?xxxxxxxxxx"); // BSP.
inline uint64_t(*CModelLoader__Map_LoadModelGuts)(void* thisptr, void* mod) = (uint64_t(*)(void*, void*))p_CModelLoader__Map_LoadModelGuts.GetPtr(); /*48 89 54 24 ? 48 89 4C 24 ? 55 53 56 57 41 54 41 55 41 57*/
inline auto CModelLoader__Map_LoadModelGuts = p_CModelLoader__Map_LoadModelGuts.RCast<uint64_t(*)(void* thisptr, void* mod)>(); /*48 89 54 24 ? 48 89 4C 24 ? 55 53 56 57 41 54 41 55 41 57*/
inline ADDRESS p_CModelLoader__UnloadModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xF9\x33\xED"), "xxxx?xxxx?xxxx????xxxxx");
inline uint64_t(*CModelLoader__UnloadModel)(void* thisptr, void* pModel) = (uint64_t(*)(void*, void*))p_CModelLoader__UnloadModel.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 57 48 81 EC ? ? ? ? 48 8B F9 33 ED*/
inline auto CModelLoader__UnloadModel = p_CModelLoader__UnloadModel.RCast<uint64_t(*)(void* thisptr, void* pModel)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 57 48 81 EC ? ? ? ? 48 8B F9 33 ED*/
#endif
void CModelLoader_Attach();

View File

@ -9,28 +9,28 @@
/* ==== CNETCHAN ======================================================================================================================================================== */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) || defined (GAMEDLL_S2)
inline ADDRESS p_NET_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x08\x48\x89\x6C\x24\x10\x48\x89\x74\x24\x18\x48\x89\x7C\x24\x20\x41\x54\x41\x56\x41\x57\x48\x81\xEC\xC0\x01\x00"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
inline void* (*v_NET_Init)(char a1) = (void* (*)(char))p_NET_Init.GetPtr(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 48 89 7C 24 20 41 54 41 56 41 57 48 81 EC C0 01 00*/
inline auto v_NET_Init = p_NET_Init.RCast<void* (*)(char a1)>(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 48 89 7C 24 20 41 54 41 56 41 57 48 81 EC C0 01 00*/
inline ADDRESS p_NET_Shutdown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x6C\x24\x18\x56\x57\x41\x56\x48\x83\xEC\x30\x83\xB9\xD8"), "xxxxxxxxxxxxxxxx");
inline void (*v_NET_Shutdown)(void* thisptr, const char* a0, std::uint8_t a1, char a2) = (void (*)(void*, const char*, std::uint8_t, char))p_NET_Shutdown.GetPtr(); /*48 89 6C 24 18 56 57 41 56 48 83 EC 30 83 B9 D8*/
inline auto v_NET_Shutdown = p_NET_Shutdown.RCast<void (*)(void* thisptr, const char* szReason, uint8_t a3, char a4)>(); /*48 89 6C 24 18 56 57 41 56 48 83 EC 30 83 B9 D8*/
#elif defined (GAMEDLL_S3)
inline ADDRESS p_NET_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x08\x48\x89\x6C\x24\x10\x48\x89\x74\x24\x18\x48\x89\x7C\x24\x20\x41\x54\x41\x56\x41\x57\x48\x81\xEC\xF0\x01\x00"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
inline void* (*v_NET_Init)(char a1) = (void* (*)(char))p_NET_Init.GetPtr(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 48 89 7C 24 20 41 54 41 56 41 57 48 81 EC F0 01 00*/
inline auto v_NET_Init = p_NET_Init.RCast<void* (*)(char a1)>(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 48 89 7C 24 20 41 54 41 56 41 57 48 81 EC F0 01 00*/
inline ADDRESS p_NET_Shutdown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x6C\x24\x18\x56\x57\x41\x56\x48\x83\xEC\x30\x83\xB9\xD0"), "xxxxxxxxxxxxxxxx");
inline void (*v_NET_Shutdown)(void* thisptr, const char* szReason, std::uint8_t a1, char a2) = (void (*)(void*, const char*, std::uint8_t, char))p_NET_Shutdown.GetPtr(); /*48 89 6C 24 18 56 57 41 56 48 83 EC 30 83 B9 D0*/
inline auto v_NET_Shutdown = p_NET_Shutdown.RCast<void (*)(void* thisptr, const char* szReason, uint8_t a3, char a4)>(); /*48 89 6C 24 18 56 57 41 56 48 83 EC 30 83 B9 D0*/
#endif
inline ADDRESS p_NET_SetKey = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x08\x48\x89\x6C\x24\x10\x48\x89\x74\x24\x18\x57\x48\x83\xEC\x20\x48\x8B\xF9\x41\xB8"), "xxxxxxxxxxxxxxxxxxxxxxxxx");
inline void (*v_NET_SetKey)(std::uintptr_t pKey, const char* szHash) = (void (*)(std::uintptr_t, const char*))p_NET_SetKey.GetPtr(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 20 48 8B F9 41 B8*/
inline auto v_NET_SetKey = p_NET_SetKey.RCast<void (*)(uintptr_t pKey, const char* szHash)>(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 20 48 8B F9 41 B8*/
inline ADDRESS p_NET_ReceiveDatagram = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x74\x24\x18\x48\x89\x7C\x24\x20\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xAC\x24\x50\xEB"), "xxxxxxxxxxxxxxxxxxxxxxxxx");
inline bool (*v_NET_ReceiveDatagram)(int iSocket, netpacket_s* pInpacket, bool bRaw) = (bool (*)(int, netpacket_s*, bool))p_NET_ReceiveDatagram.GetPtr(); /*E8 ?? ?? ?? ?? 84 C0 75 35 48 8B D3*/
inline auto v_NET_ReceiveDatagram = p_NET_ReceiveDatagram.RCast<bool (*)(int iSocket, netpacket_s* pInpacket, bool bRaw)>(); /*E8 ?? ?? ?? ?? 84 C0 75 35 48 8B D3*/
inline ADDRESS p_NET_SendDatagram = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x08\x48\x89\x6C\x24\x10\x48\x89\x74\x24\x18\x57\x41\x56\x41\x57\x48\x81\xEC\x00\x05\x00\x00"), "xxxxxxxxxxxxxxxxxxxxxxx?xxx");
inline void* (*v_NET_SendDatagram)(SOCKET s, const char* szPayload, int iLenght, int nFlags) = (void* (*)(SOCKET, const char*, int, int))p_NET_SendDatagram.GetPtr(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 81 EC ?? 05 00 00*/
inline auto v_NET_SendDatagram = p_NET_SendDatagram.RCast<void* (*)(SOCKET s, const char* szPayload, int iLenght, int nFlags)>(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 81 EC ?? 05 00 00*/
inline ADDRESS p_NET_PrintFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x54\x24\x10\x4C\x89\x44\x24\x18\x4C\x89\x4C\x24\x20\xC3\x48"), "xxxxxxxxxxxxxxxxx");
inline void (*v_NET_PrintFunc)(const char* fmt) = (void(*)(const char*))p_NET_PrintFunc.GetPtr(); /*48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 C3 48*/
inline auto v_NET_PrintFunc = p_NET_PrintFunc.RCast<void(*)(const char* fmt)>(); /*48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 C3 48*/
///////////////////////////////////////////////////////////////////////////////
bool NET_ReceiveDatagram(int iSocket, netpacket_s* pInpacket, bool bRaw);

View File

@ -4,13 +4,13 @@
/* ==== SV_MAIN ======================================================================================================================================================= */
inline ADDRESS p_SV_InitGameDLL = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x81\xEC\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x0F\x85\x00\x00\x00\x00"), "xxx????x????xx?????xx????");
inline void (*SV_InitGameDLL)(float a1) = (void(*)(float))p_SV_InitGameDLL.GetPtr(); /*48 81 EC ? ? ? ? E8 ? ? ? ? 80 3D ? ? ? ? ? 0F 85 ? ? ? ?*/
inline auto SV_InitGameDLL = p_SV_InitGameDLL.RCast<void(*)(float a1)>(); /*48 81 EC ? ? ? ? E8 ? ? ? ? 80 3D ? ? ? ? ? 0F 85 ? ? ? ?*/
inline ADDRESS p_SV_ShutdownGameDLL = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x80\x3D\x00\x00\x00\x00\x00\x0F\x84\x00\x00\x00\x00\x48\x8B\x0D\x00\x00\x00\x00\x48\x89\x5C\x24\x00"), "xxxxxx?????xx????xxx????xxxx?");
inline void (*SV_ShutdownGameDLL)() = (void(*)())p_SV_ShutdownGameDLL.GetPtr(); /*48 83 EC 28 80 3D ? ? ? ? ? 0F 84 ? ? ? ? 48 8B 0D ? ? ? ? 48 89 5C 24 ?*/
inline auto SV_ShutdownGameDLL = p_SV_ShutdownGameDLL.RCast<void(*)(void)>(); /*48 83 EC 28 80 3D ? ? ? ? ? 0F 84 ? ? ? ? 48 8B 0D ? ? ? ? 48 89 5C 24 ?*/
inline ADDRESS p_SV_CreateBaseline = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x75\x07"), "xxxxxxx????xxxxx");
inline bool (*SV_CreateBaseline)() = (bool(*)())p_SV_CreateBaseline.GetPtr(); /*48 83 EC 28 48 8B 0D ? ? ? ? 48 85 C9 75 07*/
inline auto SV_CreateBaseline = p_SV_CreateBaseline.RCast<bool(*)(void)>(); /*48 83 EC 28 48 8B 0D ? ? ? ? 48 85 C9 75 07*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS CGameServer__SpawnServer = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x55\x56\x57\x41\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00"), "xxxxxxxxxxxxxx????");

View File

@ -3,7 +3,7 @@
/* ==== UTILITY ========================================================================================================================================================= */
inline ADDRESS p_Sys_Error_Internal = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x08\x48\x89\x74\x24\x10\x57\x48\x81\xEC\x30\x08\x00\x00\x48\x8B\xDA\x48\x8B\xF9\xE8\x00\x00\x00\xFF\x33\xF6\x48"), "xxxxxxxxxxxxxxxxxxxxxxxxx???xxxx");
inline int (*Sys_Error_Internal)(char* fmt, va_list args) = (int (*)(char*, va_list))p_Sys_Error_Internal.GetPtr(); /*48 89 5C 24 08 48 89 74 24 10 57 48 81 EC 30 08 00 00 48 8B DA 48 8B F9 E8 ?? ?? ?? FF 33 F6 48*/
inline auto Sys_Error_Internal = p_Sys_Error_Internal.RCast<int (*)(char* fmt, va_list args)>(); /*48 89 5C 24 08 48 89 74 24 10 57 48 81 EC 30 08 00 00 48 8B DA 48 8B F9 E8 ?? ?? ?? FF 33 F6 48*/
inline bool* gfExtendedError = p_COM_ExplainDisconnection.Offset(0x0).FindPatternSelf("C6 05", ADDRESS::Direction::DOWN, 300).ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();

View File

@ -8,20 +8,20 @@ public:
};
inline ADDRESS p_CEngineAPI_Connect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x48\x8B\x05\x00\x00\x00\x00\x48\x8D\x0D\x00\x00\x00\x00\x48\x85\xC0\x48\x89\x15"), "xxxxxxx????xxx????xxxxxx");
inline bool (*CEngineAPI_Connect)(CEngineAPI* thisptr, CreateInterfaceFn factory) = (bool (*)(CEngineAPI*, CreateInterfaceFn))p_CEngineAPI_Connect.GetPtr(); /*48 83 EC 28 48 8B 05 ? ? ? ? 48 8D 0D ? ? ? ? 48 85 C0 48 89 15 ? ? ? ?*/
inline auto CEngineAPI_Connect = p_CEngineAPI_Connect.RCast<bool (*)(CEngineAPI* thisptr, CreateInterfaceFn factory)>(); /*48 83 EC 28 48 8B 05 ? ? ? ? 48 8D 0D ? ? ? ? 48 85 C0 48 89 15 ? ? ? ?*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_PakFile_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x44\x88\x44\x24\x00\x56\x57\x41\x54\x41\x56\x41\x57\x48\x83\xEC\x20"), "xxxx?xxxx?xxxx?xxxxxxxxxxxx");
inline int (*PakFile_Init)(char* buffer, char* source, char vpk_file) = (int (*)(char*, char*, char))p_PakFile_Init.GetPtr(); /*48 89 5C 24 ?? 48 89 6C 24 ?? 44 88 44 24 ?? 56 57 41 54 41 56 41 57 48 83 EC 20*/
inline auto PakFile_Init = p_PakFile_Init.RCast<void (*)(char* buffer, char* source, char vpk_file)>(); /*48 89 5C 24 ?? 48 89 6C 24 ?? 44 88 44 24 ?? 56 57 41 54 41 56 41 57 48 83 EC 20*/
inline ADDRESS p_CEngineAPI_MainLoop = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x55\x48\x81\xEC\x00\x00\x00\x00\x45\x33\xC9"), "xxxx?xxxx????xxx");
inline void* (*CEngineAPI_MainLoop)() = (void* (*)())p_CEngineAPI_MainLoop.GetPtr(); /*48 89 5C 24 ? 55 48 81 EC ? ? ? ? 45 33 C9*/
inline auto CEngineAPI_MainLoop = p_CEngineAPI_MainLoop.RCast<bool(*)(void)>(); /*48 89 5C 24 ? 55 48 81 EC ? ? ? ? 45 33 C9*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_PakFile_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x44\x88\x44\x24\x00\x53\x55\x56\x57"), "xxxx?xxxx");
inline void (*PakFile_Init)(char* buffer, char* source, char vpk_file) = (void (*)(char*, char*, char))p_PakFile_Init.GetPtr(); /*44 88 44 24 ?? 53 55 56 57*/
inline auto PakFile_Init = p_PakFile_Init.RCast<void (*)(char* buffer, char* source, char vpk_file)>(); /*44 88 44 24 ?? 53 55 56 57*/
inline ADDRESS p_CEngineAPI_MainLoop = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\x48\x8B\x15\x00\x00\x00\x00\x84\xC0\xB9\x00\x00\x00\x00"), "x????xxx????xxx????").FollowNearCallSelf();
inline bool (*CEngineAPI_MainLoop)() = (bool(*)())p_CEngineAPI_MainLoop.GetPtr(); /*E8 ? ? ? ? 48 8B 15 ? ? ? ? 84 C0 B9 ? ? ? ?*/
inline auto CEngineAPI_MainLoop = p_CEngineAPI_MainLoop.RCast<bool(*)(void)>(); /*E8 ? ? ? ? 48 8B 15 ? ? ? ? 84 C0 B9 ? ? ? ?*/
#endif
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)

View File

@ -5,10 +5,10 @@
//-------------------------------------------------------------------------
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CVideoMode_Common__CreateGameWindow = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x56\x57\x48\x83\xEC\x38\x48\x8B\xF9\xE8\x00\x00\x00\x00"), "xxxxxxxxxxx????");
inline bool (*CVideoMode_Common__CreateGameWindow)(int* pnRect) = (bool (*)(int*))p_CVideoMode_Common__CreateGameWindow.GetPtr(); /*40 56 57 48 83 EC 38 48 8B F9 E8 ? ? ? ?*/
inline auto CVideoMode_Common__CreateGameWindow = p_CVideoMode_Common__CreateGameWindow.RCast<bool (*)(int* pnRect)>(); /*40 56 57 48 83 EC 38 48 8B F9 E8 ? ? ? ?*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CVideoMode_Common__CreateGameWindow = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x56\x57\x48\x83\xEC\x28\x48\x8B\xF9\xE8\x00\x00\x00\x00\x48\x8B\xF0"), "xxxxxxxxxxx????xxx");
inline bool (*CVideoMode_Common__CreateGameWindow)(int* pnRect) = (bool (*)(int*))p_CVideoMode_Common__CreateGameWindow.GetPtr(); /*40 56 57 48 83 EC 28 48 8B F9 E8 ? ? ? ? 48 8B F0*/
inline auto CVideoMode_Common__CreateGameWindow = p_CVideoMode_Common__CreateGameWindow.RCast<bool (*)(int* pnRect)>(); /*40 56 57 48 83 EC 28 48 8B F9 E8 ? ? ? ? 48 8B F0*/
#endif
void HCVideoMode_Common_Attach();

View File

@ -2,25 +2,26 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline ADDRESS p_Sys_Error = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x08\x48\x89\x54\x24\x10\x4C\x89\x44\x24\x18\x4C\x89\x4C\x24\x20\x53\x55\x41\x54\x41\x56\xB8\x58\x10\x00\x00\xE8"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
inline void (*Sys_Error)(char* fmt, ...) = (void (*)(char* fmt, ...))p_Sys_Error.GetPtr(); /*48 89 4C 24 08 48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 55 41 54 41 56 B8 58 10 00 00 E8*/
inline auto Sys_Error = p_Sys_Error.RCast<void (*)(char* fmt, ...)>(); /*48 89 4C 24 08 48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 55 41 54 41 56 B8 58 10 00 00 E8*/
inline ADDRESS p_Warning = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x54\x24\x00\x4C\x89\x44\x24\x00\x4C\x89\x4C\x24\x00\x48\x83\xEC\x28\x4C\x8D\x44\x24\x00\xE8\x00\x00\x00\x00\x48\x83\xC4\x28\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x8B\x05\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxxxxxx?x????xxxxxxxxxxxxxxxxxxxxxxx?xxxx?xxxx?xx????");
inline void* (*Sys_Warning)(int level, char* fmt, ...) = (void* (*)(int, char* fmt, ...))p_Warning.GetPtr(); /*48 89 54 24 ? 4C 89 44 24 ? 4C 89 4C 24 ? 48 83 EC 28 4C 8D 44 24 ? E8 ? ? ? ? 48 83 C4 28 C3 CC CC CC CC CC CC CC CC CC CC CC CC CC CC 48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 8B 05 ? ? ? ?*/
inline auto Sys_Warning = p_Warning.RCast<void* (*)(int, char* fmt, ...)>(); /*48 89 54 24 ? 4C 89 44 24 ? 4C 89 4C 24 ? 48 83 EC 28 4C 8D 44 24 ? E8 ? ? ? ? 48 83 C4 28 C3 CC CC CC CC CC CC CC CC CC CC CC CC CC CC 48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 8B 05 ? ? ? ?*/
inline ADDRESS p_Sys_LoadAssetHelper = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x74\x24\x10\x48\x89\x7C\x24\x18\x41\x56\x48\x83\xEC\x40\x33"), "xxxxxxxxxxxxxxxxx");
inline void*(*Sys_LoadAssetHelper)(const CHAR* lpFileName, std::int64_t a2, LARGE_INTEGER* a3) = (void*(*)(const CHAR*, std::int64_t, LARGE_INTEGER*))p_Sys_LoadAssetHelper.GetPtr();/*48 89 74 24 10 48 89 7C 24 18 41 56 48 83 EC 40 33*/
inline ADDRESS p_Con_NPrintf = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x00\x48\x89\x54\x24\x00\x4C\x89\x44\x24\x00\x4C\x89\x4C\x24\x00\xC3"), "xxxx?xxxx?xxxx?xxxx?x");
inline void (*Con_NPrintf)(int pos, const char* fmt, ...) = (void (*)(int, const char*, ...))p_Con_NPrintf.GetPtr(); /*48 89 4C 24 ? 48 89 54 24 ? 4C 89 44 24 ? 4C 89 4C 24 ? C3*/
inline auto Con_NPrintf = p_Con_NPrintf.RCast<void (*)(int pos, const char* fmt, ...)>(); /*48 89 4C 24 ? 48 89 54 24 ? 4C 89 44 24 ? 4C 89 4C 24 ? C3*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_MemAlloc_Wrapper = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\x05\x00\x00\x00\x00\x48\x8B\xD9\x48\x85\xC0\x75\x0C\xE8\x16"), "xxxxxxxxx????xxxxxxxxxx");
inline void* (*MemAlloc_Wrapper)(std::int64_t size) = (void* (*)(std::int64_t))p_MemAlloc_Wrapper.GetPtr(); /*40 53 48 83 EC 20 48 8B 05 ?? ?? ?? ?? 48 8B D9 48 85 C0 75 0C E8 16*/
inline auto MemAlloc_Wrapper = p_MemAlloc_Wrapper.RCast<void* (*)(size_t)>(); /*40 53 48 83 EC 20 48 8B 05 ?? ?? ?? ?? 48 8B D9 48 85 C0 75 0C E8 16*/
#elif defined (GAMEDLL_S2)
inline ADDRESS p_MemAlloc_Wrapper = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\x05\x00\x00\x00\x00\x48\x8B\xD9\x48\x85\xC0\x75\x0C\xE8\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x4C\x8B\x00\x48\x8B\xD3\x48\x8B\xC8\x48\x83\xC4\x20\x5B\x49\xFF\x60\x08"), "xxxxxxxxx????xxxxxxxxx????xxx????xxxxxxxxxxxxxxxxxx");
inline void* (*MemAlloc_Wrapper)(std::int64_t size) = (void* (*)(std::int64_t))p_MemAlloc_Wrapper.GetPtr(); /*40 53 48 83 EC 20 48 8B 05 ? ? ? ? 48 8B D9 48 85 C0 75 0C E8 ? ? ? ? 48 89 05 ? ? ? ? 4C 8B 00 48 8B D3 48 8B C8 48 83 C4 20 5B 49 FF 60 08 */
inline auto MemAlloc_Wrapper = p_MemAlloc_Wrapper.RCast<void* (*)(size_t)>(); /*40 53 48 83 EC 20 48 8B 05 ? ? ? ? 48 8B D9 48 85 C0 75 0C E8 ? ? ? ? 48 89 05 ? ? ? ? 4C 8B 00 48 8B D3 48 8B C8 48 83 C4 20 5B 49 FF 60 08 */
#elif defined (GAMEDLL_S3)
inline ADDRESS p_MemAlloc_Wrapper = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\x05\x6B\x83\x25\x0D\x48\x8B\xD9"), "xxxxxxxxxxxxxxxx");
inline void* (*MemAlloc_Wrapper)(std::int64_t size) = (void* (*)(std::int64_t))p_MemAlloc_Wrapper.GetPtr(); /*40 53 48 83 EC 20 48 8B 05 6B 83 25 0D 48 8B D9*/
inline auto MemAlloc_Wrapper = p_MemAlloc_Wrapper.RCast<void* (*)(size_t)>(); /*40 53 48 83 EC 20 48 8B 05 6B 83 25 0D 48 8B D9*/
#endif
/* ==== ------- ========================================================================================================================================================= */

View File

@ -109,7 +109,7 @@ void CBaseFileSystem::Warning(CBaseFileSystem* pFileSystem, FileWarningLevel_t l
// *pszFilePath -
// Output : Handle to file on success, NULL on failure
//---------------------------------------------------------------------------------
FileHandle_t CBaseFileSystem::ReadFromVPK(CBaseFileSystem* pVpk, std::int64_t* pResults, char* pszFilePath)
FileHandle_t CBaseFileSystem::ReadFromVPK(CBaseFileSystem* pFileSystem, std::int64_t* pResults, char* pszFilePath)
{
std::string svFilePath = ConvertToWinPath(pszFilePath);
@ -127,7 +127,7 @@ FileHandle_t CBaseFileSystem::ReadFromVPK(CBaseFileSystem* pVpk, std::int64_t* p
*pResults = -1;
return (void*)pResults;
}
return CBaseFileSystem_LoadFromVPK(pVpk, pResults, pszFilePath);
return CBaseFileSystem_LoadFromVPK(pFileSystem, pResults, pszFilePath);
}
//---------------------------------------------------------------------------------

View File

@ -16,13 +16,13 @@ public:
/* ==== CBASEFILESYSTEM ================================================================================================================================================= */
inline ADDRESS p_CBaseFileSystem_Warning = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x4C\x24\x20\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48"), "xxxxxx??????????x");
inline auto CBaseFileSystem_Warning = p_CBaseFileSystem_Warning.RCast<void(*)(void* thisptr, FileWarningLevel_t level, const char* fmt, ...)>(); /*4C 89 4C 24 20 C3 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48*/
inline auto CBaseFileSystem_Warning = p_CBaseFileSystem_Warning.RCast<void(*)(CBaseFileSystem* thisptr, FileWarningLevel_t level, const char* fmt, ...)>(); /*4C 89 4C 24 20 C3 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48*/
inline ADDRESS p_CBaseFileSystem_LoadFromVPK = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x49\x8B\xC0\x4C\x8D\x8C\x24\x00\x00\x00\x00"), "xxxx?xxxx????xxxxxxx????");
inline FileHandle_t(*CBaseFileSystem_LoadFromVPK)(void* pVpk, std::int64_t* pResults, char* pszAssetName) = (FileHandle_t(*)(void*, std::int64_t*, char*))p_CBaseFileSystem_LoadFromVPK.GetPtr(); /*48 89 5C 24 ? 57 48 81 EC ? ? ? ? 49 8B C0 4C 8D 8C 24 ? ? ? ?*/
inline auto CBaseFileSystem_LoadFromVPK = p_CBaseFileSystem_LoadFromVPK.RCast<FileHandle_t(*)(CBaseFileSystem* thisptr, void* pResults, char* pszAssetName)>(); /*48 89 5C 24 ? 57 48 81 EC ? ? ? ? 49 8B C0 4C 8D 8C 24 ? ? ? ?*/
inline ADDRESS p_CBaseFileSystem_LoadFromCache = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x81\xEC\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x49\x8B\xD8"), "xxxxx????xx?????xxx");
inline bool(*CBaseFileSystem_LoadFromCache)(void* pFileSystem, char* pszAssetName, void* pResults) = (bool(*)(void*, char*, void*))p_CBaseFileSystem_LoadFromCache.GetPtr(); /*40 53 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 49 8B D8*/
inline auto CBaseFileSystem_LoadFromCache = p_CBaseFileSystem_LoadFromCache.RCast<bool(*)(CBaseFileSystem* thisptr, char* pszAssetName, void* pResults)>(); /*40 53 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 49 8B D8*/
inline CBaseFileSystem* g_pFileSystem = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\xE8\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00"), "xxxxx????xxx????")
.Offset(0x20).FindPatternSelf("48 89 05", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CBaseFileSystem*>();

View File

@ -48,7 +48,7 @@ void CAI_Network_Attach();
void CAI_Network_Detach();
inline ADDRESS p_CAI_Network__DebugConnectMsg = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x4C\x24\x00\x48\x83\xEC\x18"), "xxxx?xxxx");
inline void (*v_CAI_Network__DebugConnectMsg)(int node1, int node2, const char* pszFormat, ...) = (void (*)(int, int, const char*, ...))p_CAI_Network__DebugConnectMsg.GetPtr(); /*4C 89 4C 24 ? 48 83 EC 18*/
inline auto v_CAI_Network__DebugConnectMsg = p_CAI_Network__DebugConnectMsg.RCast<void (*)(int node1, int node2, const char* pszformat, ...)>(); /*4C 89 4C 24 ? 48 83 EC 18*/
///////////////////////////////////////////////////////////////////////////////
class HAI_Network : public IDetour

View File

@ -12,7 +12,7 @@ const int AINETWORK_OFFSET = 2808;
const int AINETWORK_OFFSET = 2840;
#endif
const std::string HULL_SIZE[5] =
const string HULL_SIZE[5] =
{
"small",
"med_short",
@ -23,21 +23,22 @@ const std::string HULL_SIZE[5] =
/* ==== CAI_NETWORKMANAGER ============================================================================================================================================== */
inline ADDRESS p_CAI_NetworkManager__ShouldRebuild = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\x48\x8B\x0D\x00\x00\x00\x00\x8B\x41\x6C"), "xxxxxxxxxxxx????xxx");
inline void* (*CAI_NetworkManager__ShouldRebuild)(void* thisptr, CAI_Network* pNetWork, void* a3, int a4) = (void* (*)(void*, CAI_Network*, void*, int))p_CAI_NetworkManager__ShouldRebuild.GetPtr(); /*40 53 48 83 EC 20 48 8B D9 48 8B 0D ? ? ? ? 8B 41 6C*/
inline auto CAI_NetworkManager__ShouldRebuild = p_CAI_NetworkManager__ShouldRebuild.RCast<void* (*)(void* thisptr, CAI_Network* pNetwork, void* a3, int a4)>(); /*40 53 48 83 EC 20 48 8B D9 48 8B 0D ? ? ? ? 8B 41 6C*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CAI_NetworkManager__LoadNetworkGraph = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x44\x24\x00\x48\x89\x4C\x24\x00\x55\x53\x57\x41\x54\x41\x55\x41\x56"), "xxxx?xxxx?xxxxxxxxx");
inline void* (*CAI_NetworkManager__LoadNetworkGraph)(void* thisptr, void* pBuffer, const char* pszFileName, int a4) = (void* (*)(void*, void*, const char*, int))p_CAI_NetworkManager__LoadNetworkGraph.GetPtr(); /*4C 89 44 24 ? 48 89 4C 24 ? 55 53 57 41 54 41 55 41 56*/
inline auto CAI_NetworkManager__LoadNetworkGraph = p_CAI_NetworkManager__LoadNetworkGraph.RCast<void* (*)(void* thisptr, void* pBuffer, const char* pszFileName, int a4)>(); /*4C 89 44 24 ? 48 89 4C 24 ? 55 53 57 41 54 41 55 41 56*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CAI_NetworkManager__LoadNetworkGraph = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x44\x24\x00\x48\x89\x4C\x24\x00\x55\x53\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\x6C\x24\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xFA"), "xxxx?xxxx?xxxxxxxxxxxxxxxx?xxx????xxx");
inline void* (*CAI_NetworkManager__LoadNetworkGraph)(void* thisptr, void* pBuffer, const char* pszFileName) = (void* (*)(void*, void*, const char*))p_CAI_NetworkManager__LoadNetworkGraph.GetPtr(); /*4C 89 44 24 ? 48 89 4C 24 ? 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B FA*/
inline auto CAI_NetworkManager__LoadNetworkGraph = p_CAI_NetworkManager__LoadNetworkGraph.RCast<void* (*)(void* thisptr, void* pBuffer, const char* pszFileName)>(); /*4C 89 44 24 ? 48 89 4C 24 ? 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B FA*/
#endif
/* ==== CAI_NETWORKBUILDER ============================================================================================================================================== */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CAI_NetworkBuilder__Build = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x4C\x24\x00\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x30\x48\x63\xBA\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxx????");
inline void* (*CAI_NetworkBuilder__Build)(void* thisptr, CAI_Network* pNetWork, void* a3, int a4) = (void* (*)(void*, CAI_Network*, void*, int))p_CAI_NetworkBuilder__Build.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 4C 24 ? 57 41 54 41 55 41 56 41 57 48 83 EC 30 48 63 BA ? ? ? ?*/
inline auto CAI_NetworkBuilder__Build = p_CAI_NetworkBuilder__Build.RCast<void* (*)(void* thisptr, CAI_Network* pNetwork, void* a3, int a4)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 4C 24 ? 57 41 54 41 55 41 56 41 57 48 83 EC 30 48 63 BA ? ? ? ?*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CAI_NetworkBuilder__Build = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x54\x24\x00\x48\x89\x4C\x24\x00\x53\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x38\x8B\xB2\x00\x00\x00\x00"), "xxxx?xxxx?xxxxxxxxxxxxxxxxxx????");
inline void* (*CAI_NetworkBuilder__Build)(void* thisptr, CAI_Network* pNetWork, void* a3, int a4) = (void* (*)(void*, CAI_Network*, void*, int))p_CAI_NetworkBuilder__Build.GetPtr(); /*48 89 54 24 ? 48 89 4C 24 ? 53 55 56 57 41 54 41 55 41 56 41 57 48 83 EC 38 8B B2 ? ? ? ?*/
inline auto CAI_NetworkBuilder__Build = p_CAI_NetworkBuilder__Build.RCast<void* (*)(void* thisptr, CAI_Network* pNetwork, void* a3, int a4)>(); /*48 89 54 24 ? 48 89 4C 24 ? 53 55 56 57 41 54 41 55 41 56 41 57 48 83 EC 38 8B B2 ? ? ? ?*/
#endif
void CAI_NetworkManager_Attach();

View File

@ -6,14 +6,13 @@
// RUNTIME: DETOUR
//-------------------------------------------------------------------------
inline ADDRESS p_dtNavMesh__Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x44\x24\x00\x53\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x0F\x10\x11"), "xxxx?xxxxxx????xxx");
inline dtStatus (*dtNavMesh__Init)(dtNavMesh* thisptr, unsigned char* data, int flags) = (dtStatus(*)(dtNavMesh*, unsigned char*, int))p_dtNavMesh__Init.GetPtr(); /*4C 89 44 24 ? 53 41 56 48 81 EC ? ? ? ? 0F 10 11*/
inline auto dtNavMesh__Init = p_dtNavMesh__Init.RCast<dtStatus(*)(dtNavMesh* thisptr, unsigned char* data, int flags)>(); /*4C 89 44 24 ? 53 41 56 48 81 EC ? ? ? ? 0F 10 11*/
inline ADDRESS p_dtNavMesh__addTile = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x44\x89\x4C\x24\x00\x41\x55"), "xxxx?xx");/*44 89 4C 24 ? 41 55*/
inline dtStatus(*dtNavMesh__addTile)(dtNavMesh* thisptr, unsigned char* data, dtMeshHeader* header, int datasize, int flags, dtTileRef lastRef) = (dtStatus(*)(dtNavMesh*, unsigned char*, dtMeshHeader*, int, int, dtTileRef))p_dtNavMesh__addTile.GetPtr();
inline ADDRESS p_dtNavMesh__isPolyReachable = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x49\x63\xF1"), "xxxx?xxxx?xxxx?xxxxx"); /*48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 49 63 F1*/
inline bool(*dtNavMesh__isPolyReachable)(dtNavMesh* thisptr, dtPolyRef poly_1, dtPolyRef poly_2, int hull_type) = (bool(*)(dtNavMesh*, dtPolyRef, dtPolyRef, int))p_dtNavMesh__isPolyReachable.GetPtr();
inline auto dtNavMesh__addTile = p_dtNavMesh__addTile.RCast<dtStatus(*)(dtNavMesh* thisptr, unsigned char* data, dtMeshHeader* header, int dataSize, int flags, dtTileRef lastRef)>();
inline ADDRESS p_dtNavMesh__isPolyReachable = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x49\x63\xF1"), "xxxx?xxxx?xxxx?xxxxx");
inline auto dtNavMesh__isPolyReachable = p_dtNavMesh__isPolyReachable.RCast<bool(*)(dtNavMesh* thisptr, dtPolyRef poly_1, dtPolyRef poly_2, int hull_type)>(); /*48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 49 63 F1*/
///////////////////////////////////////////////////////////////////////////////
class HRecast : public IDetour
{

View File

@ -1,6 +1,39 @@
//===========================================================================//
//
// Purpose:
//
//===========================================================================//
#include "core/stdafx.h"
#include "vpc/IAppSystem.h"
#include "inputsystem/inputsystem.h"
//-----------------------------------------------------------------------------
// Enables/disables input
//-----------------------------------------------------------------------------
void CInputSystem::EnableInput(bool bEnabled)
{
static int index = 10;
CallVFunc<void>(index, this, bEnabled);
}
//-----------------------------------------------------------------------------
// Enables/disables the inputsystem windows message pump
//-----------------------------------------------------------------------------
void CInputSystem::EnableMessagePump(bool bEnabled)
{
static int index = 11;
CallVFunc<void>(index, this, bEnabled);
}
//-----------------------------------------------------------------------------
// Poll current state
//-----------------------------------------------------------------------------
bool CInputSystem::IsButtonDown(ButtonCode_t Button)
{
static int index = 13;
return CallVFunc<bool>(index, this, Button);
}
///////////////////////////////////////////////////////////////////////////////
CInputSystem* g_pInputSystem = reinterpret_cast<CInputSystem*>(p_IAppSystem_LoadLibrary.FindPatternSelf("48 89 05", ADDRESS::Direction::DOWN, 40).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr());
CInputSystem* g_pInputSystem = reinterpret_cast<CInputSystem*>(p_IAppSystem_LoadLibrary.FindPatternSelf("48 89 05", ADDRESS::Direction::DOWN, 40).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr());

View File

@ -5,23 +5,9 @@
class CInputSystem
{
public:
void EnableInput(bool bEnabled)// @0x14039F100 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
{
static int index = 10;
CallVFunc<void>(index, this, bEnabled);
}
void EnableMessagePump(bool bEnabled) // @0x14039F110 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
{
static int index = 11;
CallVFunc<void>(index, this, bEnabled);
}
bool IsButtonDown(ButtonCode_t Button) // @0x1403A0140 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
{
static int index = 13;
return CallVFunc<bool>(index, this, Button);
}
void EnableInput(bool bEnabled); // @0x14039F100 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
void EnableMessagePump(bool bEnabled); // @0x14039F110 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
bool IsButtonDown(ButtonCode_t Button); // @0x1403A0140 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
private:
char pad_0000[16]; //0x0000

View File

@ -18,7 +18,7 @@
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
int HModAppSystemGroup_Main(CModAppSystemGroup* modAppSystemGroup)
int HModAppSystemGroup_Main(CModAppSystemGroup* pModAppSystemGroup)
{
int nRunResult = RUN_OK;
HEbisuSDK_Init(); // Not here in retail. We init EbisuSDK here though.
@ -26,7 +26,7 @@ int HModAppSystemGroup_Main(CModAppSystemGroup* modAppSystemGroup)
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) // !TODO: rebuild does not work for S1 (CModAppSystemGroup and CEngine member offsets do align with all other builds).
return CModAppSystemGroup_Main(modAppSystemGroup);
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
if (modAppSystemGroup->m_bIsServerOnly()) // This will never be true anyway but we implement it for the sake of it.
if (pModAppSystemGroup->m_bIsServerOnly()) // This will never be true anyway but we implement it for the sake of it.
{
if (g_pEngine->Load(true, g_pEngineParms->baseDirectory))
{
@ -55,7 +55,7 @@ int HModAppSystemGroup_Main(CModAppSystemGroup* modAppSystemGroup)
//-----------------------------------------------------------------------------
// Purpose: Instantiate all main libraries
//-----------------------------------------------------------------------------
bool HModAppSystemGroup_Create(CModAppSystemGroup* modAppSystemGroup)
bool HModAppSystemGroup_Create(CModAppSystemGroup* pModAppSystemGroup)
{
#ifdef DEDICATED
* g_bDedicated = true;
@ -69,7 +69,7 @@ bool HModAppSystemGroup_Create(CModAppSystemGroup* modAppSystemGroup)
}
g_bAppSystemInit = true;
return CModAppSystemGroup_Create(modAppSystemGroup);
return CModAppSystemGroup_Create(pModAppSystemGroup);
}
///////////////////////////////////////////////////////////////////////////////

View File

@ -31,22 +31,22 @@ public:
/* ==== CAPPSYSTEMGROUP ================================================================================================================================================= */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CModAppSystemGroup_Main = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x80\xB9\x00\x00\x00\x00\x00\x48\x8B\x15\x00\x00\x00\x00"), "xxxxxx?????xxx????");
inline int (*CModAppSystemGroup_Main)(CModAppSystemGroup* modAppSystemGroup) = (int (*)(CModAppSystemGroup*))p_CModAppSystemGroup_Main.GetPtr(); /*48 83 EC 28 80 B9 ?? ?? ?? ?? ?? 48 8B 15 ?? ?? ?? ??*/
inline auto CModAppSystemGroup_Main = p_CModAppSystemGroup_Main.RCast<int(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 83 EC 28 80 B9 ?? ?? ?? ?? ?? 48 8B 15 ?? ?? ?? ??*/
inline ADDRESS p_CModAppSystemGroup_Create = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x60\x48\xC7\x40\x00\x00\x00\x00\x00\x48\x89\x58\x08"), "xxxxxxxxxxxxxxxxxxx?????xxxx");
inline bool (*CModAppSystemGroup_Create)(void* modAppSystemGroup) = (bool(*)(void*))p_CModAppSystemGroup_Create.GetPtr(); /*48 8B C4 57 41 54 41 55 41 56 41 57 48 83 EC 60 48 C7 40 ?? ?? ?? ?? ?? 48 89 58 08*/
inline auto CModAppSystemGroup_Create = p_CModAppSystemGroup_Create.RCast<bool(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 8B C4 57 41 54 41 55 41 56 41 57 48 83 EC 60 48 C7 40 ?? ?? ?? ?? ?? 48 89 58 08*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CModAppSystemGroup_Main = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x80\xB9\x00\x00\x00\x00\x00\xBB\x00\x00\x00\x00"), "xxxxxxxx?????x????");
inline int (*CModAppSystemGroup_Main)(CModAppSystemGroup* modAppSystemGroup) = (int(*)(CModAppSystemGroup*))p_CModAppSystemGroup_Main.GetPtr(); /*40 53 48 83 EC 20 80 B9 ?? ?? ?? ?? ?? BB ?? ?? ?? ??*/
inline auto CModAppSystemGroup_Main = p_CModAppSystemGroup_Main.RCast<int(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*40 53 48 83 EC 20 80 B9 ?? ?? ?? ?? ?? BB ?? ?? ?? ??*/
inline ADDRESS p_CModAppSystemGroup_Create = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8B\xEC\x48\x83\xEC\x60"), "xxxxxxxxxxxxxxxxxxx");
inline bool (*CModAppSystemGroup_Create)(void* modAppSystemGroup) = (bool(*)(void*))p_CModAppSystemGroup_Create.GetPtr(); /*48 8B C4 55 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 60*/
inline auto CModAppSystemGroup_Create = p_CModAppSystemGroup_Create.RCast<bool(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 8B C4 55 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 60*/
#endif
inline ADDRESS p_CSourceAppSystemGroup__PreInit = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x74\x24\x00\x55\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00"), "xxxx?xxxxx????xxx????xxx????");
inline bool (*CSourceAppSystemGroup__PreInit)(void* modAppSystemGroup) = (bool(*)(void*))p_CSourceAppSystemGroup__PreInit.GetPtr(); /*48 89 74 24 ? 55 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ?*/
inline auto CSourceAppSystemGroup__PreInit = p_CSourceAppSystemGroup__PreInit.RCast<bool(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 89 74 24 ? 55 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ?*/
inline ADDRESS p_CSourceAppSystemGroup__Create = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xF9\xE8\x00\x00\x00\x00\x33\xC9"), "xxxx?xxxx?xxxxxxxxx????xx");
inline bool (*CSourceAppSystemGroup__Create)(void* modAppSystemGroup) = (bool(*)(void*))p_CSourceAppSystemGroup__Create.GetPtr(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B F9 E8 ? ? ? ? 33 C9*/
inline auto CSourceAppSystemGroup__Create = p_CSourceAppSystemGroup__Create.RCast<bool(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B F9 E8 ? ? ? ? 33 C9*/
///////////////////////////////////////////////////////////////////////////////
int HModAppSystemGroup_Main(CModAppSystemGroup* modAppSystemGroup);

View File

@ -47,7 +47,7 @@ static_assert(sizeof(CMaterialGlue) == 0x130);
/* ==== CMATERIALGLUE ================================================================================================================================================== */
inline ADDRESS p_GetMaterialAtCrossHair = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x83\xEC\x58\x48\x83\x3D\x00\x00\x00\x00\x00"), "xxxxxxxxxx?????");
inline CMaterialGlue* (*GetMaterialAtCrossHair)(void) = (CMaterialGlue*(*)(void))p_GetMaterialAtCrossHair.GetPtr(); /*48 8B C4 48 83 EC 58 48 83 3D ? ? ? ? ?*/
inline auto GetMaterialAtCrossHair = p_GetMaterialAtCrossHair.RCast<CMaterialGlue* (*)(void)>(); /*48 8B C4 48 83 EC 58 48 83 3D ? ? ? ? ?*/
void CMaterialGlue_Attach();
void CMaterialGlue_Detach();

View File

@ -4,19 +4,18 @@
inline ADDRESS CMaterialSystem__Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x70\x48\x83\x3D\x00\x00\x00\x00\x00"), "xxxx?xxxxxxxxxxxxxxxxxx?????");
// 0x1403BBFD0 // 48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 83 EC 70 48 83 3D ? ? ? ? ? //
inline ADDRESS p_DrawStreamOverlay = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x41\x56\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x2B\xE0\xC6\x02\x00"), "xxx????x????xxxxxx"); // 41 56 B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 C6 02 00 //
inline const char* (*DrawStreamOverlay)(void* thisptr, std::uint8_t* a2, void* unused, void* a4) = (const char* (*)(void*, std::uint8_t*, void*, void*))p_DrawStreamOverlay.GetPtr();
#ifndef DEDICATED
inline ADDRESS p_DrawStreamOverlay = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x41\x56\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x2B\xE0\xC6\x02\x00"), "xxx????x????xxxxxx");
inline auto DrawStreamOverlay = p_DrawStreamOverlay.RCast<const char* (*)(void* thisptr, uint8_t* a2, void* unused, void* a4)>(); // 41 56 B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 C6 02 00 //
inline ADDRESS p_StreamDB_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x54\x41\x56\x41\x57\x48\x83\xEC\x40\x48\x8B\xE9"), "xxxx?xxxx?xxxx?xxxx?xxxxxxxxxxxxx");
inline void (*StreamDB_Init)(const char* pszStreamDbFile) = (void (*)(const char* pszStreamDbFile))p_StreamDB_Init.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 54 41 56 41 57 48 83 EC 40 48 8B E9*/
#endif // !DEDICATED
inline auto StreamDB_Init = p_StreamDB_Init.RCast<void (*)(const char* pszStreamDbFile)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 54 41 56 41 57 48 83 EC 40 48 8B E9*/
inline void* g_pMaterialSystem = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x74\x11\x48\x8B\x01\x48\x8D\x15\x00\x00\x00\x00"), "xxx????xxxxxxxxxxx????").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void*>();
inline int* total_streaming_tex_memory = p_DrawStreamOverlay.Offset(0x0).FindPatternSelf("48 8B 05", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
inline int* unfree_streaming_tex_memory = p_DrawStreamOverlay.Offset(0x20).FindPatternSelf("48 8B 05", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
inline int* unusable_streaming_tex_memory = p_DrawStreamOverlay.Offset(0x50).FindPatternSelf("48 8B 05", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
#endif // !DEDICATED
void CMaterialSystem_Attach();
void CMaterialSystem_Detach();
@ -26,11 +25,11 @@ class HMaterialSystem : public IDetour
virtual void debugp()
{
std::cout << "| FUN: CMaterialSystem::Init : 0x" << std::hex << std::uppercase << CMaterialSystem__Init.GetPtr() << std::setw(npad) << " |" << std::endl;
std::cout << "| FUN: DrawStreamOverlay : 0x" << std::hex << std::uppercase << p_DrawStreamOverlay.GetPtr() << std::setw(npad) << " |" << std::endl;
#ifndef DEDICATED
std::cout << "| FUN: DrawStreamOverlay : 0x" << std::hex << std::uppercase << p_DrawStreamOverlay.GetPtr() << std::setw(npad) << " |" << std::endl;
std::cout << "| FUN: StreamDB_Init : 0x" << std::hex << std::uppercase << p_StreamDB_Init.GetPtr() << std::setw(npad) << " |" << std::endl;
#endif // !DEDICATED
std::cout << "| VAR: g_pMaterialSystem : 0x" << std::hex << std::uppercase << g_pMaterialSystem << std::setw(0) << " |" << std::endl;
#endif // !DEDICATED
std::cout << "+----------------------------------------------------------------+" << std::endl;
}
};

View File

@ -23,35 +23,36 @@ enum class ePakStatus : int
/* ==== RTECH_GAME ====================================================================================================================================================== */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_RTech_UnloadAsset = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x48\x85\xC9\x0F\x84\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00"), "xxxxxxxxx????xxx????");
inline void (*RTech_UnloadAsset)(std::int64_t a1) = (void (*)(std::int64_t))p_RTech_UnloadAsset.GetPtr(); /*48 83 EC 28 48 85 C9 0F 84 ? ? ? ? 48 8B 05 ? ? ? ? */
inline auto RTech_UnloadAsset = p_RTech_UnloadAsset.RCast<void (*)(int64_t a1)>(); /*48 83 EC 28 48 85 C9 0F 84 ? ? ? ? 48 8B 05 ? ? ? ? */
inline ADDRESS p_JT_HelpWithAnything = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x48\x83\xEC\x30\x80\x3D\x00\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxx?xxxxxxxx?????");
inline void* (*JT_HelpWithAnything)(bool bShouldLoadPak) = (void* (*)(bool))p_JT_HelpWithAnything.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC 30 80 3D ? ? ? ? ?*/
inline auto JT_HelpWithAnything = p_JT_HelpWithAnything.RCast<void* (*)(bool bShouldLoadPak)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC 30 80 3D ? ? ? ? ?*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_RTech_UnloadAsset = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x48\x85\xD2\x74\x40\x48\x8B\x05\x00\x00\x00\x00"), "xxxxxxxxxxxx????");
inline void (*RTech_UnloadAsset)(std::int64_t a1, std::int64_t a2) = (void (*)(std::int64_t, std::int64_t))p_RTech_UnloadAsset.GetPtr(); /*48 83 EC 28 48 85 D2 74 40 48 8B 05 ? ? ? ?*/
inline auto RTech_UnloadAsset = p_RTech_UnloadAsset.RCast<void (*)(int64_t a1, int64_t a2)>(); /*48 83 EC 28 48 85 D2 74 40 48 8B 05 ? ? ? ?*/
inline ADDRESS p_RTech_LoadPak = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x00\x56\x41\x55"), "xxxx?xxx"); /*48 89 4C 24 ? 56 41 55*/
inline unsigned int (*RTech_LoadPak)(void* thisptr, void* a2, std::uint64_t a3) = (unsigned int (*)(void*, void*, std::uint64_t))p_RTech_LoadPak.GetPtr();
inline auto RTech_LoadPak = p_RTech_LoadPak.RCast<unsigned int (*)(void* thisptr, void* a2, uint64_t a3)>();
inline ADDRESS p_RTech_LoadMapPak = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x81\xEC\x00\x00\x00\x00\x0F\xB6\x05\x00\x00\x00\x00\x4C\x8D\x05\x00\x00\x00\x00\x84\xC0"), "xxx????xxx????xxx????xx");
inline bool (*RTech_LoadMapPak)(const char* szPakFile) = (bool (*)(const char*))p_RTech_LoadMapPak.GetPtr(); /*48 81 EC ? ? ? ? 0F B6 05 ? ? ? ? 4C 8D 05 ? ? ? ? 84 C0*/
inline auto RTech_LoadMapPak = p_RTech_LoadMapPak.RCast<bool (*)(const char* szPakFile)>(); /*48 81 EC ? ? ? ? 0F B6 05 ? ? ? ? 4C 8D 05 ? ? ? ? 84 C0*/
inline ADDRESS p_JT_HelpWithAnything = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x80\x3D\x00\x00\x00\x00\x00"), "xxxx?xxxx?xxxxxxx?????");
inline void* (*JT_HelpWithAnything)(bool bShouldLoadPak) = (void* (*)(bool))p_JT_HelpWithAnything.GetPtr(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 30 80 3D ? ? ? ? ?*/
inline auto JT_HelpWithAnything = p_JT_HelpWithAnything.RCast<void* (*)(bool bShouldLoadPak)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 30 80 3D ? ? ? ? ?*/
#endif
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) || defined (GAMEDLL_S2)
inline ADDRESS p_RTech_AsyncLoad = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x40\x48\x89\x6C\x24\x00\x41\x8B\xE8"), "xxxxxxxxxx?xxx"); /*40 53 48 83 EC 40 48 89 6C 24 ? 41 8B E8*/
inline int (*RTech_AsyncLoad)(void* Src, std::uintptr_t pMalloc, int nIdx, char szPakFile) = (int (*)(void*, std::uintptr_t, int, char))p_RTech_AsyncLoad.GetPtr();
inline ADDRESS p_RTech_AsyncLoad = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x40\x48\x89\x6C\x24\x00\x41\x8B\xE8"), "xxxxxxxxxx?xxx");
inline auto RTech_AsyncLoad = p_RTech_AsyncLoad.RCast<int (*)(void* Src, uintptr_t pMalloc, int nIdx, char szPakfile)>(); /*40 53 48 83 EC 40 48 89 6C 24 ? 41 8B E8*/
#elif defined (GAMEDLL_S3)
inline ADDRESS p_RTech_AsyncLoad = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x40\x48\x89\x6C\x24\x00\x41\x0F\xB6\xE9"), "xxxxxxxxxx?xxxx"); /*40 53 48 83 EC 40 48 89 6C 24 ? 41 0F B6 E9*/
inline int (*RTech_AsyncLoad)(void* Src, std::uintptr_t pMalloc, int nIdx, char szPakFile) = (int (*)(void*, std::uintptr_t, int, char))p_RTech_AsyncLoad.GetPtr();
inline ADDRESS p_RTech_AsyncLoad = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x40\x48\x89\x6C\x24\x00\x41\x0F\xB6\xE9"), "xxxxxxxxxx?xxxx");
inline auto RTech_AsyncLoad = p_RTech_AsyncLoad.RCast<int (*)(void* Src, uintptr_t pMalloc, int nIdx, char szPakfile)>(); /*40 53 48 83 EC 40 48 89 6C 24 ? 41 0F B6 E9*/
#endif
inline ADDRESS p_RTech_UnloadPak = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x8B\xC1"), "xxxx?xxxx?xxxxxxx");
inline void* (*RTech_UnloadPak)(int nPakId) = (void* (*)(int nPakId))p_RTech_UnloadPak.GetPtr();/*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 30 8B C1*/
inline auto RTech_UnloadPak = p_RTech_UnloadPak.RCast<void* (*)(int nPakId)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 30 8B C1*/
void HRTech_UnloadAsset(std::int64_t a1, std::int64_t a2);
void HRTech_AsyncLoad(std::string svPakFileName);
void HRTech_UnloadAsset(int64_t a1, int64_t a2);
void HRTech_AsyncLoad(string svPakFileName);
void RTech_Game_Attach();
void RTech_Game_Detach();

View File

@ -14,19 +14,19 @@ struct user_creds
/* ==== CSERVER ========================================================================================================================================================= */
inline ADDRESS p_CServer_Think = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00"), "xxxx?xxxx?xxxx????xx?????");
inline void (*CServer_Think)(bool check_clock_drift, bool bIsSimulating) = (void (*)(bool, bool))p_CServer_Think.GetPtr(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 80 3D ? ? ? ? ?*/
inline auto CServer_Think = p_CServer_Think.RCast<void (*)(bool bCheckClockDrift, bool bIsSimulating)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 80 3D ? ? ? ? ?*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CServer_Authenticate = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x44\x89\x44\x24\x00\x55\x56\x57\x48\x8D\xAC\x24\x00\x00\x00\x00"), "xxxx?xxxxxxx????");
inline void* (*CServer_Authenticate)(void* cserver, user_creds* creds) = (void* (*)(void* cserver, user_creds * creds))p_CServer_Authenticate.GetPtr(); /*44 89 44 24 ?? 55 56 57 48 8D AC 24 ?? ?? ?? ??*/
inline auto CServer_Authenticate = p_CServer_Authenticate.RCast<void* (*)(void* pServer, user_creds* pCreds)>(); /*44 89 44 24 ?? 55 56 57 48 8D AC 24 ?? ?? ?? ??*/
#elif defined (GAMEDLL_S2)
inline ADDRESS p_CServer_Authenticate = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x44\x89\x44\x24\x00\x56\x57\x48\x81\xEC\x00\x00\x00\x00"), "xxxx?xxxxx????");
inline void* (*CServer_Authenticate)(void* cserver, user_creds* creds) = (void* (*)(void* cserver, user_creds * creds))p_CServer_Authenticate.GetPtr(); /*44 89 44 24 ?? 56 57 48 81 EC ?? ?? ?? ??*/
inline auto CServer_Authenticate = p_CServer_Authenticate.RCast<void* (*)(void* pServer, user_creds* pCreds)>(); /*44 89 44 24 ?? 56 57 48 81 EC ?? ?? ?? ??*/
#else
inline ADDRESS p_CServer_Authenticate = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x57\x41\x55\x41\x57\x48\x8D\xAC\x24\x00\x00\x00\x00"), "xxxxxxxxxxx????");
inline void* (*CServer_Authenticate)(void* cserver, user_creds* creds) = (void* (*)(void* cserver, user_creds * creds))p_CServer_Authenticate.GetPtr(); /*40 55 57 41 55 41 57 48 8D AC 24 ?? ?? ?? ??*/
inline auto CServer_Authenticate = p_CServer_Authenticate.RCast<void* (*)(void* pServer, user_creds* pCreds)>(); /*40 55 57 41 55 41 57 48 8D AC 24 ?? ?? ?? ??*/
#endif
inline ADDRESS p_CServer_RejectConnection = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x4C\x24\x00\x53\x55\x56\x57\x48\x81\xEC\x00\x00\x00\x00\x49\x8B\xD9"), "xxxx?xxxxxxx????xxx");
inline void* (*CServer_RejectConnection)(void* pServer, unsigned int a2, user_creds* pCreds, const char* szMessage) = (void* (*)(void*, unsigned int, user_creds*, const char*))p_CServer_RejectConnection.GetPtr(); /*4C 89 4C 24 ?? 53 55 56 57 48 81 EC ?? ?? ?? ?? 49 8B D9*/
inline auto CServer_RejectConnection = p_CServer_RejectConnection.RCast<void* (*)(void* pServer, unsigned int a2, user_creds* pCreds, const char* szMessage)>(); /*4C 89 4C 24 ?? 53 55 56 57 48 81 EC ?? ?? ?? ?? 49 8B D9*/
inline int* sv_m_nTickCount = p_CServer_Think.Offset(0xB0).FindPatternSelf("8B 15", ADDRESS::Direction::DOWN).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();

View File

@ -2,16 +2,16 @@
/* ==== CVENGINESERVER ================================================================================================================================================== */
inline ADDRESS p_IVEngineServer__PersistenceAvailable = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x3B\x15\x00\x00\x00\x00\x7D\x33"), "xx????xx");
inline bool (*IVEngineServer__PersistenceAvailable)(void* entidx, int clientidx) = (bool (*)(void*, int))p_IVEngineServer__PersistenceAvailable.GetPtr(); /*3B 15 ?? ?? ?? ?? 7D 33*/
inline auto IVEngineServer__PersistenceAvailable = p_IVEngineServer__PersistenceAvailable.RCast<bool (*)(void* entidx, int clientidx)>(); /*3B 15 ?? ?? ?? ?? 7D 33*/
inline ADDRESS p_IVEngineServer__IsDedicatedServer = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x0F\xB6\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x8B\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x40\x53"), "xxx????xxxxxxxxxxxx????xxxxxxxxxxx");
inline bool (*IVEngineServer__IsDedicatedServer)(void) = (bool (*)(void))p_IVEngineServer__IsDedicatedServer.GetPtr(); /*0F B6 05 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 8B 05 ? ? ? ? C3 CC CC CC CC CC CC CC CC 40 53*/
inline auto IVEngineServer__IsDedicatedServer = p_IVEngineServer__IsDedicatedServer.RCast<bool (*)(void)>(); /*0F B6 05 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 8B 05 ? ? ? ? C3 CC CC CC CC CC CC CC CC 40 53*/
inline ADDRESS p_IVEngineServer__GetNumHumanPlayers = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x8B\x15\x00\x00\x00\x00\x33\xC0\x85\xD2\x7E\x24"), "xx????xxxxxx");
inline int64_t(*IVEngineServer__GetNumHumanPlayers)(void) = (int64_t(*)(void))p_IVEngineServer__GetNumHumanPlayers.GetPtr(); /*8B 15 ? ? ? ? 33 C0 85 D2 7E 24*/
inline auto IVEngineServer__GetNumHumanPlayers = p_IVEngineServer__GetNumHumanPlayers.RCast<int64_t(*)(void)>(); /*8B 15 ? ? ? ? 33 C0 85 D2 7E 24*/
inline ADDRESS p_IVEngineServer__GetNumFakeClients = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x8B\x05\x00\x00\x00\x00\x33\xC9\x85\xC0\x7E\x2D"), "xx????xxxxxx");
inline int64_t(*IVEngineServer__GetNumFakeClients)(void) = (int64_t(*)(void))p_IVEngineServer__GetNumFakeClients.GetPtr(); /*8B 05 ? ? ? ? 33 C9 85 C0 7E 2D*/
inline auto IVEngineServer__GetNumFakeClients = p_IVEngineServer__GetNumFakeClients.RCast<int64_t(*)(void)>(); /*8B 05 ? ? ? ? 33 C9 85 C0 7E 2D*/
inline bool* g_bDedicated = p_IVEngineServer__IsDedicatedServer.Offset(0x0).ResolveRelativeAddress(0x3, 0x7).RCast<bool*>();

View File

@ -3,46 +3,47 @@
/* ==== SQUIRREL ======================================================================================================================================================== */
inline ADDRESS p_sq_pushroottable = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x8B\x51\x00\x44\x8B\xC2"), "xxxxxx?xxx");
inline SQRESULT(*v_sq_pushroottable)(HSQUIRRELVM v) = (SQRESULT(*)(HSQUIRRELVM))p_sq_pushroottable.GetPtr(); /*48 83 EC 28 8B 51 ?? 44 8B C2*/
inline auto v_sq_pushroottable = p_sq_pushroottable.RCast<SQRESULT(*)(HSQUIRRELVM v)>(); /*48 83 EC 28 8B 51 ?? 44 8B C2*/
inline ADDRESS p_sq_pushbool = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x38\x33\xC0\x48\xC7\x44\x24\x20\x08\x00\x00\x01\x48"), "xxxxxxxxxxxxxxxx");
inline void (*v_sq_pushbool)(HSQUIRRELVM v, SQBool b) = (void (*)(HSQUIRRELVM, SQBool))p_sq_pushbool.GetPtr(); /*48 83 EC 38 33 C0 48 C7 44 24 20 08 00 00 01 48*/
inline auto v_sq_pushbool = p_sq_pushbool.RCast<void (*)(HSQUIRRELVM v, SQBool b)>(); /*48 83 EC 38 33 C0 48 C7 44 24 20 08 00 00 01 48*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) || defined (GAMEDLL_S2)
inline ADDRESS p_sq_pushstring = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x56\x48\x83\xEC\x30\x48\x8B\xF1\x48\x85\xD2\x0F\x84\x8C\x00"), "xxxxxxxxxxxxxxxx");
inline void (*v_sq_pushstring)(HSQUIRRELVM v, const SQChar* string, SQInteger len) = (void (*)(HSQUIRRELVM, const SQChar*, SQInteger))p_sq_pushstring.GetPtr(); /*40 56 48 83 EC 30 48 8B F1 48 85 D2 0F 84 8C 00*/
inline auto v_sq_pushstring = p_sq_pushstring.RCast<void (*)(HSQUIRRELVM v, const SQChar* string, SQInteger len)>(); /*40 56 48 83 EC 30 48 8B F1 48 85 D2 0F 84 8C 00*/
#elif defined (GAMEDLL_S3)
inline ADDRESS p_sq_pushstring = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x56\x48\x83\xEC\x30\x48\x8B\xF1\x48\x85\xD2\x0F\x84\x8F\x00"), "xxxxxxxxxxxxxxxx");
inline void (*v_sq_pushstring)(HSQUIRRELVM v, const SQChar* string, SQInteger len) = (void (*)(HSQUIRRELVM, const SQChar*, SQInteger))p_sq_pushstring.GetPtr(); /*40 56 48 83 EC 30 48 8B F1 48 85 D2 0F 84 8F 00*/
inline auto v_sq_pushstring = p_sq_pushstring.RCast<void (*)(HSQUIRRELVM v, const SQChar* string, SQInteger len)>(); /*40 56 48 83 EC 30 48 8B F1 48 85 D2 0F 84 8F 00*/
#endif
inline ADDRESS p_sq_pushinteger = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x38\x33\xC0\x48\xC7\x44\x24\x20\x02\x00\x00\x05\x48"), "xxxxxxxxxxxxxxxx");
inline void (*v_sq_pushinteger)(HSQUIRRELVM v, SQInteger val) = (void (*)(HSQUIRRELVM, SQInteger))p_sq_pushinteger.GetPtr(); /*48 83 EC 38 33 C0 48 C7 44 24 20 02 00 00 05 48*/
inline auto v_sq_pushinteger = p_sq_pushinteger.RCast<void (*)(HSQUIRRELVM v, SQInteger val)>(); /*48 83 EC 38 33 C0 48 C7 44 24 20 02 00 00 05 48*/
inline ADDRESS p_sq_pushconstant = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x4C\x8B"), "xxxx?xxxx?xxxx?xxxxxxx");
inline void (*v_sq_pushconstant)(HSQUIRRELVM v, const SQChar* name, SQInteger val) = (void (*)(HSQUIRRELVM, const SQChar*, SQInteger))p_sq_pushconstant.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 30 4C 8B*/
inline auto v_sq_pushconstant = p_sq_pushconstant.RCast<void (*)(HSQUIRRELVM v, const SQChar* name, SQInteger val)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 30 4C 8B*/
inline ADDRESS p_sq_newarray = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x08\x57\x48\x83\xEC\x30\x48\x8B\xD9\x48\xC7\x44\x24\x20\x40"), "xxxxxxxxxxxxxxxxxxx");
inline void (*v_sq_newarray)(HSQUIRRELVM v, SQInteger size) = (void (*)(HSQUIRRELVM, SQInteger))p_sq_newarray.GetPtr(); /*48 89 5C 24 08 57 48 83 EC 30 48 8B D9 48 C7 44 24 20 40*/
inline auto v_sq_newarray = p_sq_newarray.RCast<void (*)(HSQUIRRELVM v, SQInteger size)>(); /*48 89 5C 24 08 57 48 83 EC 30 48 8B D9 48 C7 44 24 20 40*/
inline ADDRESS p_sq_newtable = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x08\x57\x48\x83\xEC\x30\x48\x8B\xD9\x48\xC7\x44\x24\x20\x20"), "xxxxxxxxxxxxxxxxxxx");
inline void (*v_sq_newtable)(HSQUIRRELVM v) = (void (*)(HSQUIRRELVM))p_sq_newtable.GetPtr(); /*48 89 5C 24 08 57 48 83 EC 30 48 8B D9 48 C7 44 24 20 20*/
inline auto v_sq_newtable = p_sq_newtable.RCast<void (*)(HSQUIRRELVM v)>(); /*48 89 5C 24 08 57 48 83 EC 30 48 8B D9 48 C7 44 24 20 20*/
inline ADDRESS p_sq_newslot = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x30\x44\x8B\x49\x00\x48\x8B\xD9\x41\x8B\xC1"), "xxxxxxxxx?xxxxxx");
inline SQRESULT(*v_sq_newslot)(HSQUIRRELVM v, SQInteger idx) = (SQRESULT(*)(HSQUIRRELVM, SQInteger))p_sq_newslot.GetPtr(); /*40 53 48 83 EC 20 8B 41 ?? 48 8B D9 2B 41 ?? 83 F8 02 7D*/
inline auto v_sq_newslot = p_sq_newslot.RCast<SQRESULT(*)(HSQUIRRELVM v, SQInteger idx)>(); /*40 53 48 83 EC 20 8B 41 ?? 48 8B D9 2B 41 ?? 83 F8 02 7D*/
inline ADDRESS p_sq_arrayappend = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x8B\x41\x00\x48\x8B\xD9\x2B\x41\x00\x83\xF8\x02\x7D"), "xxxxxxxx?xxxxx?xxxx");
inline SQRESULT(*v_sq_arrayappend)(HSQUIRRELVM v, SQInteger idx) = (SQRESULT(*)(HSQUIRRELVM, SQInteger))p_sq_arrayappend.GetPtr(); /*40 53 48 83 EC 20 8B 41 ?? 48 8B D9 2B 41 ?? 83 F8 02 7D*/
inline auto v_sq_arrayappend = p_sq_arrayappend.RCast<SQRESULT(*)(HSQUIRRELVM v, SQInteger idx)>(); /*40 53 48 83 EC 20 8B 41 ?? 48 8B D9 2B 41 ?? 83 F8 02 7D*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) || defined (GAMEDLL_S2)
inline ADDRESS p_sq_pushstructure = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x4C\x89\x4C\x24\x00\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8B\xEC"), "xxxx?xxxx?xxxx?xxxx?xxxxxxxxxxxx");
inline SQRESULT(*v_sq_pushstructure)(HSQUIRRELVM v, const SQChar* name, const SQChar* member, const SQChar* codeclass1, const SQChar* codeclass2) = (SQRESULT(*)(HSQUIRRELVM, const SQChar*, const SQChar*, const SQChar*, const SQChar*))p_sq_pushstructure.GetPtr(); /*48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 4C 89 4C 24 ? 55 41 54 41 55 41 56 41 57 48 8B EC*/
inline auto v_sq_pushstructure = p_sq_pushstructure.RCast<SQRESULT(*)(HSQUIRRELVM v, const SQChar* name, const SQChar* member, const SQChar* codeclass1, const SQChar* codeclass2)>(); /*48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 4C 89 4C 24 ? 55 41 54 41 55 41 56 41 57 48 8B EC*/
#elif defined (GAMEDLL_S3)
inline ADDRESS p_sq_pushstructure = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8B\xEC\x48\x83\xEC\x60\x48\x8B\x59\x60"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxxxxxx");
inline SQRESULT (*v_sq_pushstructure)(HSQUIRRELVM v, const SQChar* name, const SQChar* member, const SQChar* codeclass1, const SQChar* codeclass2) = (SQRESULT(*)(HSQUIRRELVM, const SQChar*, const SQChar*, const SQChar*, const SQChar*))p_sq_pushstructure.GetPtr(); /*48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 55 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 60 48 8B 59 60*/
inline auto v_sq_pushstructure = p_sq_pushstructure.RCast<SQRESULT(*)(HSQUIRRELVM v, const SQChar* name, const SQChar* member, const SQChar* codeclass1, const SQChar* codeclass2)>(); /*48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 55 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 60 48 8B 59 60*/
#endif
inline ADDRESS p_sq_compilebuffer = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x41\x56\x41\x57\x48\x83\xEC\x50\x41\x8B\xE9\x49\x8B\xF8"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxx");
inline SQRESULT (*v_sq_compilebuffer)(HSQUIRRELVM v, SQBufState* bufferState, const SQChar* buffer, SQInteger level) = (SQRESULT (*)(HSQUIRRELVM, SQBufState*, const SQChar*, SQInteger))p_sq_compilebuffer.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 56 41 57 48 83 EC 50 41 8B E9 49 8B F8*/
inline auto v_sq_compilebuffer = p_sq_compilebuffer.RCast<SQRESULT(*)(HSQUIRRELVM v, SQBufState* bufferstate, const SQChar* buffer, SQInteger level)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 56 41 57 48 83 EC 50 41 8B E9 49 8B F8*/
inline ADDRESS p_sq_call = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x8B\xDC\x49\x89\x5B\x08\x49\x89\x6B\x10\x49\x89\x73\x18\x57\x48\x83\xEC\x50\x8B\xF2"), "xxxxxxxxxxxxxxxxxxxxxx");
inline SQRESULT (*v_sq_call)(HSQUIRRELVM v, SQInteger params, SQBool retval, SQBool raiseerror) = (SQRESULT (*)(HSQUIRRELVM, SQInteger, SQBool, SQBool))p_sq_call.GetPtr(); /*4C 8B DC 49 89 5B 08 49 89 6B 10 49 89 73 18 57 48 83 EC 50 8B F2*/
inline auto v_sq_call = p_sq_call.RCast<SQRESULT(*)(HSQUIRRELVM v, SQInteger params, SQBool retval, SQBool raiseerror)>(); /*4C 8B DC 49 89 5B 08 49 89 6B 10 49 89 73 18 57 48 83 EC 50 8B F2*/
///////////////////////////////////////////////////////////////////////////////
SQRESULT sq_pushroottable(HSQUIRRELVM v);

View File

@ -2,10 +2,10 @@
#include "squirrel/sqapi.h"
inline ADDRESS p_Script_Remote_BeginRegisteringFunctions = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x83\x3D\x00\x00\x00\x00\x00\x74\x10"), "xxxxxx?????xx");
inline void* Script_Remote_BeginRegisteringFunctions = (void*)p_Script_Remote_BeginRegisteringFunctions.GetPtr(); /*48 83 EC 28 83 3D ?? ?? ?? ?? ?? 74 10*/
inline auto Script_Remote_BeginRegisteringFunctions = p_Script_Remote_BeginRegisteringFunctions.RCast<void* (*)(void)>(); /*48 83 EC 28 83 3D ?? ?? ?? ?? ?? 74 10*/
inline ADDRESS p_RestoreRemoteChecksumsFromSaveGame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x00\x41\x54\x48\x83\xEC\x40"), "xxxx?xxxxxx");
inline void* (*RestoreRemoteChecksumsFromSaveGame)(void* a1, void* a2) = (void* (*)(void*, void*))p_RestoreRemoteChecksumsFromSaveGame.GetPtr(); /*48 89 4C 24 ? 41 54 48 83 EC 40*/
inline auto RestoreRemoteChecksumsFromSaveGame = p_RestoreRemoteChecksumsFromSaveGame.RCast<void* (*)(void* a1, void* a2)>(); /*48 89 4C 24 ? 41 54 48 83 EC 40*/
/* CHANGE THESE WHEN SWITCHING TO PYLONV2 TO UNSIGNED AGAIN!*/
#ifndef CLIENT_DLL
@ -57,8 +57,12 @@ class HSqInit : public IDetour
{
std::cout << "| FUN: Remote_BeginRegisteringFunctions : 0x" << std::hex << std::uppercase << p_Script_Remote_BeginRegisteringFunctions.GetPtr() << std::setw(npad) << " |" << std::endl;
std::cout << "| FUN: RestoreRemoteChecksumsFromSaveGame : 0x" << std::hex << std::uppercase << p_RestoreRemoteChecksumsFromSaveGame.GetPtr() << std::setw(npad) << " |" << std::endl;
#ifndef CLIENT_DLL
std::cout << "| VAR: g_nServerRemoteChecksum : 0x" << std::hex << std::uppercase << g_nServerRemoteChecksum << std::setw(0) << " |" << std::endl;
#endif // !CLIENT_DLL
#ifndef DEDICATED
std::cout << "| VAR: g_nClientRemoteChecksum : 0x" << std::hex << std::uppercase << g_nClientRemoteChecksum << std::setw(0) << " |" << std::endl;
#endif // !DEDICATED
std::cout << "+----------------------------------------------------------------+" << std::endl;
}
};

View File

@ -6,60 +6,60 @@
/* ==== SQUIRREL ======================================================================================================================================================== */
inline ADDRESS p_SQVM_PrintFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x89\x50\x10\x4C\x89\x40\x18\x4C\x89\x48\x20\x53\x56\x57\x48\x81\xEC\x30\x08\x00\x00\x48\x8B\xDA\x48\x8D\x70\x18\x48\x8B\xF9\xE8\x00\x00\x00\xFF\x48\x89\x74\x24\x28\x48\x8D\x54\x24\x30\x33"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx???xxxxxxxxxxxx");
inline SQRESULT (*SQVM_PrintFunc)(HSQUIRRELVM v, SQChar* fmt, ...) = (SQRESULT (*)(HSQUIRRELVM, SQChar*, ...))p_SQVM_PrintFunc.GetPtr(); /*48 8B C4 48 89 50 10 4C 89 40 18 4C 89 48 20 53 56 57 48 81 EC 30 08 00 00 48 8B DA 48 8D 70 18 48 8B F9 E8 ?? ?? ?? FF 48 89 74 24 28 48 8D 54 24 30 33*/
inline auto SQVM_PrintFunc = p_SQVM_PrintFunc.RCast<SQRESULT(*)(HSQUIRRELVM v, SQChar* fmt, ...)>(); /*48 8B C4 48 89 50 10 4C 89 40 18 4C 89 48 20 53 56 57 48 81 EC 30 08 00 00 48 8B DA 48 8D 70 18 48 8B F9 E8 ?? ?? ?? FF 48 89 74 24 28 48 8D 54 24 30 33*/
inline ADDRESS p_SQVM_WarningFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x4C\x24\x20\x44\x89\x44\x24\x18\x89\x54\x24\x10\x53\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x00\x48\x8B"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx?xx");
inline SQRESULT (*SQVM_WarningFunc)(HSQUIRRELVM v, SQInteger a2, SQInteger a3, SQInteger* nStringSize, SQChar** ppString) = (SQRESULT (*)(HSQUIRRELVM, SQInteger, SQInteger, SQInteger*, SQChar**))p_SQVM_WarningFunc.GetPtr(); /*4C 89 4C 24 20 44 89 44 24 18 89 54 24 10 53 55 56 57 41 54 41 55 41 56 41 57 48 83 EC ?? 48 8B*/
inline auto SQVM_WarningFunc = p_SQVM_WarningFunc.RCast<SQRESULT(*)(HSQUIRRELVM v, SQInteger a2, SQInteger a3, SQInteger* nStringSize, SQChar** ppString)>(); /*4C 89 4C 24 20 44 89 44 24 18 89 54 24 10 53 55 56 57 41 54 41 55 41 56 41 57 48 83 EC ?? 48 8B*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_SQVM_GetErrorLine = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x83\x65\x90\xFC"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxx????xxx????xxxx");
inline size_t (*SQVM_GetErrorLine)(const SQChar* pszFile, SQInteger nLine, SQChar* pszContextBuf, SQInteger nBufLen) = (size_t (*)(const SQChar*, SQInteger, SQChar*, SQInteger))p_SQVM_GetErrorLine.GetPtr(); /*48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 55 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 83 65 90 FC*/
inline auto SQVM_GetErrorLine = p_SQVM_GetErrorLine.RCast<size_t(*)(const SQChar* pszFile, SQInteger nLine, SQChar* pszContextBuf, SQInteger nBufLen)>(); /*48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 55 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 83 65 90 FC*/
inline ADDRESS p_SQVM_LoadScript = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x10\x48\x89\x74\x24\x18\x48\x89\x7C\x24\x20\x48\x89\x4C\x24\x08\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\x6C"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
inline SQBool (*SQVM_LoadScript)(HSQUIRRELVM v, const SQChar* szScriptPath, const SQChar* szScriptName, SQInteger nFlag) = (SQBool (*)(HSQUIRRELVM, const SQChar*, const SQChar*, SQInteger))p_SQVM_LoadScript.GetPtr(); /*48 89 5C 24 10 48 89 74 24 18 48 89 7C 24 20 48 89 4C 24 08 55 41 54 41 55 41 56 41 57 48 8D 6C*/
inline auto SQVM_LoadScript = p_SQVM_LoadScript.RCast<SQBool(*)(HSQUIRRELVM v, const SQChar* szScriptPath, const SQChar* szScriptName, SQInteger nFlag)>(); /*48 89 5C 24 10 48 89 74 24 18 48 89 7C 24 20 48 89 4C 24 08 55 41 54 41 55 41 56 41 57 48 8D 6C*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_SQVM_GetErrorLine = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x55\x56\x48\x8D\xA8\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x83\x65\x90\xFC"), "xxxxxxxx????xxx????xxxx");
inline size_t (*SQVM_GetErrorLine)(const SQChar* pszFile, SQInteger nLine, SQChar* pszContextBuf, SQInteger nBufLen) = (size_t (*)(const SQChar*, SQInteger, SQChar*, SQInteger))p_SQVM_GetErrorLine.GetPtr(); /*48 8B C4 55 56 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 83 65 90 FC*/
inline auto SQVM_GetErrorLine = p_SQVM_GetErrorLine.RCast<size_t(*)(const SQChar* pszFile, SQInteger nLine, SQChar* pszContextBuf, SQInteger nBufLen)>(); /*48 8B C4 55 56 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 83 65 90 FC*/
inline ADDRESS p_SQVM_LoadScript = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x89\x48\x08\x55\x41\x56\x48\x8D\x68"), "xxxxxxxxxxxxx"); /*48 8B C4 48 89 48 08 55 41 56 48 8D 68*/
inline SQBool (*SQVM_LoadScript)(HSQUIRRELVM v, const SQChar* szScriptPath, const SQChar* szScriptName, SQInteger nFlag) = (SQBool (*)(HSQUIRRELVM, const SQChar*, const SQChar*, SQInteger))p_SQVM_LoadScript.GetPtr();
inline ADDRESS p_SQVM_LoadScript = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x89\x48\x08\x55\x41\x56\x48\x8D\x68"), "xxxxxxxxxxxxx");
inline auto SQVM_LoadScript = p_SQVM_LoadScript.RCast<SQBool(*)(HSQUIRRELVM v, const SQChar* szScriptPath, const SQChar* szScriptName, SQInteger nFlag)>(); /*48 8B C4 48 89 48 08 55 41 56 48 8D 68*/
#endif
inline ADDRESS p_SQVM_LoadRson = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x8B\xDC\x49\x89\x5B\x08\x57\x48\x81\xEC\xA0\x00\x00\x00\x33"), "xxxxxxxxxxxxxxxx");
inline SQInteger (*SQVM_LoadRson)(const SQChar* szRsonName) = (SQInteger (*)(const SQChar*))p_SQVM_LoadRson.GetPtr(); /*4C 8B DC 49 89 5B 08 57 48 81 EC A0 00 00 00 33*/
inline auto SQVM_LoadRson = p_SQVM_LoadRson.RCast<SQInteger(*)(const SQChar* szRsonName)>(); /*4C 8B DC 49 89 5B 08 57 48 81 EC A0 00 00 00 33*/
inline ADDRESS p_SQVM_WarningCmd = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x30\x33\xDB\x48\x8D\x44\x24\x00\x4C\x8D\x4C\x24\x00"), "xxxxxxxxxxxx?xxxx?");
inline SQRESULT (*SQVM_WarningCmd)(HSQUIRRELVM v, SQInteger a2) = (SQRESULT (*)(HSQUIRRELVM, SQInteger))p_SQVM_WarningCmd.GetPtr(); /*40 53 48 83 EC 30 33 DB 48 8D 44 24 ?? 4C 8D 4C 24 ??*/
inline auto SQVM_WarningCmd = p_SQVM_WarningCmd.RCast<SQRESULT(*)(HSQUIRRELVM v, SQInteger a2)>(); /*40 53 48 83 EC 30 33 DB 48 8D 44 24 ?? 4C 8D 4C 24 ??*/
inline ADDRESS p_SQVM_RegisterFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x38\x45\x0F\xB6\xC8"), "xxxxxxxx"); /*48 83 EC 38 45 0F B6 C8*/
inline SQRESULT (*SQVM_RegisterFunc)(HSQUIRRELVM v, SQFuncRegistration* sqFunc, SQInteger a1) = (SQRESULT (*)(HSQUIRRELVM, SQFuncRegistration*, SQInteger))p_SQVM_RegisterFunc.GetPtr();
inline ADDRESS p_SQVM_RegisterFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x38\x45\x0F\xB6\xC8"), "xxxxxxxx");
inline auto SQVM_RegisterFunc = p_SQVM_RegisterFunc.RCast<SQRESULT(*)(HSQUIRRELVM v, SQFuncRegistration* sqFunc, SQInteger a1)>(); /*48 83 EC 38 45 0F B6 C8*/
inline ADDRESS p_SQVM_CompileError = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xD9\x4C\x8B\xF2"), "xxxx?xxxx?xxxx?xxxx?xxxxx????xxxxxx");
inline void (*SQVM_CompileError)(HSQUIRRELVM v, const SQChar* pszError, const SQChar* pszFile, SQUnsignedInteger nLine, SQInteger nColumn) = (void (*)(HSQUIRRELVM, const SQChar*, const SQChar*, SQUnsignedInteger, SQInteger))p_SQVM_CompileError.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 81 EC ? ? ? ? 48 8B D9 4C 8B F2*/
inline auto SQVM_CompileError = p_SQVM_CompileError.RCast<void (*)(HSQUIRRELVM v, const SQChar* pszError, const SQChar* pszFile, SQUnsignedInteger nLine, SQInteger nColumn)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 81 EC ? ? ? ? 48 8B D9 4C 8B F2*/
#if !defined (CLIENT_DLL)
inline ADDRESS p_SQVM_InitializeSVGlobalScriptStructs = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x48\x8B\x3D\x00\x00\x00\x00\x48\x8B\xF1"), "xxxx?xxxxxxxx????xxx");
inline void (*SQVM_InitializeSVGlobalScriptStructs)(SQVM* vtable) = (void (*)(SQVM*))p_SQVM_InitializeSVGlobalScriptStructs.GetPtr(); /*48 89 74 24 ? 57 48 83 EC 30 48 8B 3D ? ? ? ? 48 8B F1*/
inline auto SQVM_InitializeSVGlobalScriptStructs = p_SQVM_InitializeSVGlobalScriptStructs.RCast<SQRESULT(*)(SQVM* vtable)>(); /*48 89 74 24 ? 57 48 83 EC 30 48 8B 3D ? ? ? ? 48 8B F1*/
#endif // !CLIENT_DLL
#if !defined (DEDICATED)
inline ADDRESS p_SQVM_InitializeCLGlobalScriptStructs = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x48\x83\xEC\x30\x48\x63\xC2\x48\x8D\x3D\x00\x00\x00\x00"), "xxxx?xxxx?xxxxxxxxxxxx????");
inline SQRESULT (*SQVM_InitializeCLGlobalScriptStructs)(SQVM* vtable, SQCONTEXT context) = (SQRESULT (*)(SQVM*, SQCONTEXT))p_SQVM_InitializeCLGlobalScriptStructs.GetPtr(); /*48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC 30 48 63 C2 48 8D 3D ? ? ? ?*/
inline auto SQVM_InitializeCLGlobalScriptStructs = p_SQVM_InitializeCLGlobalScriptStructs.RCast<SQRESULT(*)(SQVM* vtable, SQCONTEXT context)>(); /*48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC 30 48 63 C2 48 8D 3D ? ? ? ?*/
#endif // !DEDICATED
#if !defined (CLIENT_DLL) && defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_SQVM_CreateServerVM = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x50\x48\x8D\x0D\x00\x00\x00\x00"), "xxxxxxxxx????");
inline SQBool (*SQVM_CreateServerVM)() = (SQBool(*)())p_SQVM_CreateServerVM.GetPtr(); /*40 53 48 83 EC 50 48 8D 0D ? ? ? ?*/
inline auto SQVM_CreateServerVM = p_SQVM_CreateServerVM.RCast<SQBool(*)(void)>(); /*40 53 48 83 EC 50 48 8D 0D ? ? ? ?*/
#elif !defined (CLIENT_DLL) && defined (GAMEDLL_S3) || defined (GAMEDLL_S2)
inline ADDRESS p_SQVM_CreateServerVM = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x56\x48\x83\xEC\x48\x48\x8D\x0D\x00\x00\x00\x00"), "xxxxxxxxxx????");
inline SQBool(*SQVM_CreateServerVM)() = (SQBool(*)())p_SQVM_CreateServerVM.GetPtr(); /*40 53 56 48 83 EC 48 48 8D 0D ? ? ? ?*/
inline auto SQVM_CreateServerVM = p_SQVM_CreateServerVM.RCast<SQBool(*)(void)>(); /*40 53 56 48 83 EC 48 48 8D 0D ? ? ? ?*/
#endif
#if !defined (DEDICATED) && defined (GAMEDLL_S0) || defined (GAMEDLL_S1) || defined (GAMEDLL_S2)
inline ADDRESS p_SQVM_CreateClientVM = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x58\x48\x83\x3D\x00\x00\x00\x00\x00\x74\x05"), "xxxxxxx?????xx");
inline SQBool(*SQVM_CreateClientVM)(CHLClient* hlclient) = (SQBool(*)(CHLClient*))p_SQVM_CreateClientVM.GetPtr(); /*48 83 EC 58 48 83 3D ? ? ? ? ? 74 05*/
inline auto SQVM_CreateClientVM = p_SQVM_CreateClientVM.RCast<SQBool(*)(CHLClient* pClient)>(); /*48 83 EC 58 48 83 3D ? ? ? ? ? 74 05*/
#elif !defined (DEDICATED) && defined (GAMEDLL_S3)
inline ADDRESS p_SQVM_CreateClientVM = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x41\x57\x48\x83\xEC\x68\x48\x83\x3D\x00\x00\x00\x00\x00"), "xxxxxxxxxxx?????");
inline SQBool(*SQVM_CreateClientVM)(CHLClient* hlclient) = (SQBool(*)(CHLClient*))p_SQVM_CreateClientVM.GetPtr(); /*40 53 41 57 48 83 EC 68 48 83 3D ? ? ? ? ?*/
inline auto SQVM_CreateClientVM = p_SQVM_CreateClientVM.RCast<SQBool(*)(CHLClient* pClient)>(); /*40 53 41 57 48 83 EC 68 48 83 3D ? ? ? ? ?*/
#endif
#if !defined (DEDICATED)
inline ADDRESS p_SQVM_CreateUIVM = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\x1D\x00\x00\x00\x00\xC6\x05\x00\x00\x00\x00\x00"), "xxxxxxxxx????xx?????");
inline SQBool(*SQVM_CreateUIVM)() = (SQBool(*)())p_SQVM_CreateUIVM.GetPtr(); /*40 53 48 83 EC 20 48 8B 1D ? ? ? ? C6 05 ? ? ? ? ?*/
inline auto SQVM_CreateUIVM = p_SQVM_CreateUIVM.RCast<SQBool(*)(void)>(); /*40 53 48 83 EC 20 48 8B 1D ? ? ? ? C6 05 ? ? ? ? ?*/
#endif // !DEDICATED
#if !defined (CLIENT_DLL)

View File

@ -154,23 +154,20 @@ public:
/* ==== ICONVAR ========================================================================================================================================================= */
inline ADDRESS p_IConVar_IsFlagSet = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x41\x48\x85\x50\x38"), "xxxxxxx");
inline bool (*IConVar_IsFlagSet)(ConVar* pConVar, int nFlag) = (bool (*)(ConVar*, int))p_IConVar_IsFlagSet.GetPtr(); /*48 8B 41 48 85 50 38*/
inline auto IConVar_IsFlagSet = p_IConVar_IsFlagSet.RCast<bool (*)(ConVar* pConVar, int nFlag)>(); /*48 8B 41 48 85 50 38*/
inline ADDRESS p_ConVar_SetInfo = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x60\x48\x8B\xD9\xC6\x41\x10\x00\x33\xC9\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x4C\x24\x00\x0F\x57\xC0\x48\x89\x4C\x24\x00\x48\x89\x03\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x43\x40"), "xxxxxxxxxxxxxxxxxx????xxxx?xxxxxxx?xxxxxx????xxxx");
inline void* (*ConVar_SetInfo)(void* a1, int a2, int a3, int a4, void* a5) = (void* (*)(void* a1, int a2, int a3, int a4, void* a5))p_ConVar_SetInfo.GetPtr(); /*40 53 48 83 EC 60 48 8B D9 C6 41 10 00 33 C9 48 8D 05 ? ? ? ? 48 89 4C 24 ? 0F 57 C0 48 89 4C 24 ? 48 89 03 48 8D 05 ? ? ? ? 48 89 43 40*/
inline auto ConVar_SetInfo = p_ConVar_SetInfo.RCast<void* (*)(ConVar* thisptr, int a2, int a3, int a4, void* a5)>(); /*40 53 48 83 EC 60 48 8B D9 C6 41 10 00 33 C9 48 8D 05 ? ? ? ? 48 89 4C 24 ? 0F 57 C0 48 89 4C 24 ? 48 89 03 48 8D 05 ? ? ? ? 48 89 43 40*/
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_ConVar_Register = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x48\x83\xEC\x30\xF3\x0F\x10\x44\x24\x00"), "xxxx?xxxx?xxxx?xxxx?xxxxxxxxxxx?"); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC 30 F3 0F 10 44 24 ?*/
inline void* (*ConVar_Register)(ConVar* allocatedConvar, const char* szName, const char* szDefaultValue, int nFlags, const char* szHelpString, bool bMin, float fMin, bool bMax, float fMax, void* pCallback, const char* pszUsageString) = (void* (*)(ConVar*, const char*, const char*, int, const char*, bool, float, bool, float, void*, const char*))p_ConVar_Register.GetPtr();
inline auto ConVar_Register = p_ConVar_Register.RCast<void* (*)(ConVar* thisptr, const char* szName, const char* szDefaultValue, int nFlags, const char* szHelpString, bool bMin, float fMin, bool bMax, float fMax, void* pCallback, const char* pszUsageString)>();
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_ConVar_Register = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x40\xF3\x0F\x10\x84\x24\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxxxxxxxx????"); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 40 F3 0F 10 84 24 ? ? ? ?*/
inline void* (*ConVar_Register)(ConVar* allocatedConvar, const char* szName, const char* szDefaultValue, int nFlags, const char* szHelpString, bool bMin, float fMin, bool bMax, float fMax, void* pCallback, const char* pszUsageString) = (void* (*)(ConVar*, const char*, const char*, int, const char*, bool, float, bool, float, void*, const char*))p_ConVar_Register.GetPtr();
inline auto ConVar_Register = p_ConVar_Register.RCast<void* (*)(ConVar* thisptr, const char* szName, const char* szDefaultValue, int nFlags, const char* szHelpString, bool bMin, float fMin, bool bMax, float fMax, void* pCallback, const char* pszUsageString)>();
#endif
namespace
{
ADDRESS g_pConVarVtable = p_ConVar_SetInfo.Offset(0x00).FindPatternSelf("48 8D 05", ADDRESS::Direction::DOWN, 100).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr(); // Get vtable ptr for ConVar table.
ADDRESS g_pIConVarVtable = p_ConVar_SetInfo.Offset(0x16).FindPatternSelf("48 8D 05", ADDRESS::Direction::DOWN, 100).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr(); // Get vtable ptr for ICvar table.
}
inline ADDRESS g_pConVarVtable = p_ConVar_SetInfo.Offset(0x00).FindPatternSelf("48 8D 05", ADDRESS::Direction::DOWN, 100).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr(); // Get vtable ptr for ConVar table.
inline ADDRESS g_pIConVarVtable = p_ConVar_SetInfo.Offset(0x16).FindPatternSelf("48 8D 05", ADDRESS::Direction::DOWN, 100).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr(); // Get vtable ptr for ICvar table.
///////////////////////////////////////////////////////////////////////////////
void IConVar_Attach();

View File

@ -16,7 +16,7 @@
#define MAX_PLAYERS 128 // Max R5 players.
#define SDK_VERSION "beta 1.6"
#define SDK_VERSION "VGameSDK024"
// #define COMPILETIME_MAX and COMPILETIME_MIN for max/min in constant expressions
#define COMPILETIME_MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )

View File

@ -132,26 +132,26 @@ public:
/* ==== COMMAND_BUFFER ================================================================================================================================================== */
inline ADDRESS p_Cbuf_AddText = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x48\x63\xD9\x41\x8B\xF8\x48\x8D\x0D\x00\x00\x00\x00\x48\x8B\xF2\xFF\x15\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x41\xB9\x00\x00\x00\x00"), "xxxx?xxxx?xxxxxxxxxxxxxx????xxxxx????xxx????xx????");
inline void (*Cbuf_AddText)(ECommandTarget_t eTarget, const char* pText, cmd_source_t cmdSource) = (void (*)(ECommandTarget_t, const char*, cmd_source_t))p_Cbuf_AddText.GetPtr(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 63 D9 41 8B F8 48 8D 0D ? ? ? ? 48 8B F2 FF 15 ? ? ? ? 48 8D 05 ? ? ? ? 41 B9 ? ? ? ?*/
inline auto Cbuf_AddText = p_Cbuf_AddText.RCast<void (*)(ECommandTarget_t eTarget, const char* pText, cmd_source_t cmdSource)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 63 D9 41 8B F8 48 8D 0D ? ? ? ? 48 8B F2 FF 15 ? ? ? ? 48 8D 05 ? ? ? ? 41 B9 ? ? ? ?*/
inline ADDRESS p_Cbuf_Execute = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\xFF\x15\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxxxxx????");
inline void (*Cbuf_Execute)(void) = (void (*)(void))p_Cbuf_Execute.GetPtr(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 FF 15 ? ? ? ?*/
inline auto Cbuf_Execute = p_Cbuf_Execute.RCast<void (*)(void)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 FF 15 ? ? ? ?*/
/* ==== CONCOMMAND ====================================================================================================================================================== */
inline ADDRESS p_ConCommandBase_IsFlagSet = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x85\x51\x38\x0F\x95\xC0\xC3"), "xxxxxxx");
inline bool (*ConCommandBase_IsFlagSet)(ConCommandBase* cmd, int flag) = (bool (*)(ConCommandBase*, int))p_ConCommandBase_IsFlagSet.GetPtr(); /*85 51 38 0F 95 C0 C3*/
inline auto ConCommandBase_IsFlagSet = p_ConCommandBase_IsFlagSet.RCast<bool (*)(ConCommandBase* pCommand, int nFlag)>(); /*85 51 38 0F 95 C0 C3*/
inline ADDRESS p_ConCommand_CMaterialSystemCmdInit = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8B\xEC\x48\x83\xEC\x50\x48\x8B\x15\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxxxxx????");
inline ConCommand*(*ConCommand_CMaterialSystemCmdInit)() = (ConCommand* (*)())p_ConCommand_CMaterialSystemCmdInit.GetPtr();
inline auto ConCommand_CMaterialSystemCmdInit = p_ConCommand_CMaterialSystemCmdInit.RCast<ConCommand* (*)(void)>();
inline ADDRESS p_ConCommand_RegisterConCommand = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xD1\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x74\x06"), "xxxxxx????xxxxx");
inline void* (*ConCommand_RegisterConCommand)(ConCommand* pCommand) = (void* (*)(ConCommand*))p_ConCommand_RegisterConCommand.GetPtr(); /*48 8B D1 48 8B 0D ?? ?? ?? ?? 48 85 C9 74 06*/
inline auto ConCommand_RegisterConCommand = p_ConCommand_RegisterConCommand.RCast<void* (*)(ConCommand* pCommand)>(); /*48 8B D1 48 8B 0D ?? ?? ?? ?? 48 85 C9 74 06*/
inline ADDRESS p_NullSub = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xC2\x00\x00\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x40\x53\x48\x83\xEC\x20\x48\x8D\x05\x00\x00\x00\x00"), "xxxxxxxxxxxxxxxxxxxxxxxxx????");
inline void (*NullSub)() = (void (*)())p_NullSub.GetPtr(); /*C2 00 00 CC CC CC CC CC CC CC CC CC CC CC CC CC 40 53 48 83 EC 20 48 8D 05 ?? ?? ?? ??*/
inline auto NullSub = p_NullSub.RCast<void(*)(void)>(); /*C2 00 00 CC CC CC CC CC CC CC CC CC CC CC CC CC 40 53 48 83 EC 20 48 8D 05 ?? ?? ?? ??*/
inline ADDRESS p_CallbackStub = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x33\xC0\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x80\x49\x68\x08"), "xxxxxxxxxxxxxxxxxxxx");
inline void* (*CallbackStub)(struct _exception* _exc) = (void* (*)(struct _exception*))p_CallbackStub.GetPtr(); /*33 C0 C3 CC CC CC CC CC CC CC CC CC CC CC CC CC 80 49 68 08*/ /*UserMathErrorFunction*/
inline auto CallbackStub = p_CallbackStub.RCast<void* (*)(struct _exception* _exc)>(); /*33 C0 C3 CC CC CC CC CC CC CC CC CC CC CC CC CC 80 49 68 08*/ /*UserMathErrorFunction*/
inline ADDRESS g_pConCommandVtable = p_ConCommand_CMaterialSystemCmdInit.FindPatternSelf("4C 8D 25", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7);

View File

@ -4,13 +4,13 @@
/* ==== CONCOMMANDCALLBACK ============================================================================================================================================== */
#if defined (GAMEDLL_S1)
inline ADDRESS p_Host_Map_f_CompletionFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x18\x55\x41\x56\x41\x00\x00\x00\x00\x40\x02"), "xxxxxxxxx????xx");
inline void (*Host_Map_f_CompletionFunc)(CCommand* cmd, char a2) = (void (*)(CCommand*, char))p_Host_Map_f_CompletionFunc.GetPtr(); /*48 89 5C 24 18 55 41 56 41 ?? ?? ?? ?? 40 02*/
inline auto Host_Map_f_CompletionFunc = p_Host_Map_f_CompletionFunc.RCast<void (*)(CCommand* pCommand, char a2)>(); /*48 89 5C 24 18 55 41 56 41 ?? ?? ?? ?? 40 02*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_Host_Map_f_CompletionFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x83\x3D"), "xxxxxxxxx????xx");
inline void (*Host_Map_f_CompletionFunc)(CCommand* cmd, char a2) = (void (*)(CCommand*, char))p_Host_Map_f_CompletionFunc.GetPtr(); /*40 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 83 3D*/
inline auto Host_Map_f_CompletionFunc = p_Host_Map_f_CompletionFunc.RCast<void (*)(CCommand* pCommand, char a2)>(); /*40 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 83 3D*/
#endif
inline ADDRESS p_DownloadPlaylists_f_CompletionFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x33\xC9\xC6\x05\x00\x00\x00\x00\x00\xE9\x00\x00\x00\x00"), "xxxx?????x????");
inline void (*DownloadPlaylists_f_CompletionFunc)() = (void(*)())p_DownloadPlaylists_f_CompletionFunc.GetPtr(); /*33 C9 C6 05 ?? ?? ?? ?? ?? E9 ?? ?? ?? ??*/
inline auto DownloadPlaylists_f_CompletionFunc = p_DownloadPlaylists_f_CompletionFunc.RCast<void(*)(void)>(); /*33 C9 C6 05 ?? ?? ?? ?? ?? E9 ?? ?? ?? ??*/
///////////////////////////////////////////////////////////////////////////////
#ifndef DEDICATED

View File

@ -1,17 +1,6 @@
#pragma once
#include "tier0/IConVar.h"
/* ==== CCVAR =========================================================================================================================================================== */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CCVar_Disconnect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x57\x41\x56\x48\x83\xEC\x38\x4C\x8B\x35"), "xxxxxxxxxxx");
inline void* (*CCVar_Disconnect)() = (void* (*)())p_CCVar_Disconnect.GetPtr(); /*40 57 41 56 48 83 EC 38 4C 8B 35 ? ? ? ?*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CCVar_Disconnect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x74\x26\x80\x3D\x00\x00\x00\x00\x00\x74\x1D\x48\x8B\x01\x8B\x15\x00\x00\x00\x00\xFF\x50\x58\xC7\x05\x00\x00\x00\x00\x00\x00\x00\x00\xC6\x05\x00\x00\x00\x00\x00\x48\xC7\x05\x00\x00\x00"), "xxxxxxx????xxxxxxx?????xxxxxxx????xxxxx????????xx");
inline void* (*CCVar_Disconnect)() = (void* (*)())p_CCVar_Disconnect.GetPtr(); /*48 83 EC 28 48 8B 0D ? ? ? ? 48 85 C9 74 26 80 3D ? ? ? ? ? 74 1D 48 8B 01 8B 15 ? ? ? ? FF 50 58 C7 05 ? ? ? ? ? ? ? ? C6 05 ? ? ? ? ? 48 C7 05 ? ? ? ? ? ? ? ?*/
#endif
inline ADDRESS p_CCVar_GetCommandLineValue = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x48\x83\xEC\x20\x48\x8D\x6C\x24\x00\x48\x89\x5D\x10\x49\xC7\xC0\x00\x00\x00\x00"), "xxxxxxxxxx?xxxxxxx????");
inline const char* (*CCVar_GetCommandLineValue)(void* thisptr, const char* pVariableName) = (const char* (*)(void*, const char*))p_CCVar_GetCommandLineValue.GetPtr(); /*40 55 48 83 EC 20 48 8D 6C 24 ? 48 89 5D 10 49 C7 C0 ? ? ? ?*/
//-------------------------------------------------------------------------
// ENGINE |
extern ConVar* cm_debug_cmdquery;
@ -137,6 +126,16 @@ public:
extern vector<string> g_vsvCommandBases;
extern CCVar* g_pCVar;
/* ==== CCVAR =========================================================================================================================================================== */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CCVar_Disconnect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x57\x41\x56\x48\x83\xEC\x38\x4C\x8B\x35"), "xxxxxxxxxxx");
inline auto CCVar_Disconnect = p_CCVar_Disconnect.RCast<void* (*)(void)>(); /*40 57 41 56 48 83 EC 38 4C 8B 35 ? ? ? ?*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CCVar_Disconnect = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x74\x26\x80\x3D\x00\x00\x00\x00\x00\x74\x1D\x48\x8B\x01\x8B\x15\x00\x00\x00\x00\xFF\x50\x58\xC7\x05\x00\x00\x00\x00\x00\x00\x00\x00\xC6\x05\x00\x00\x00\x00\x00\x48\xC7\x05\x00\x00\x00"), "xxxxxxx????xxxxxxx?????xxxxxxx????xxxxx????????xx");
inline auto CCVar_Disconnect = p_CCVar_Disconnect.RCast<void* (*)(void)>(); /*48 83 EC 28 48 8B 0D ? ? ? ? 48 85 C9 74 26 80 3D ? ? ? ? ? 74 1D 48 8B 01 8B 15 ? ? ? ? FF 50 58 C7 05 ? ? ? ? ? ? ? ? C6 05 ? ? ? ? ? 48 C7 05 ? ? ? ? ? ? ? ?*/
#endif
inline ADDRESS p_CCVar_GetCommandLineValue = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x48\x83\xEC\x20\x48\x8D\x6C\x24\x00\x48\x89\x5D\x10\x49\xC7\xC0\x00\x00\x00\x00"), "xxxxxxxxxx?xxxxxxx????");
inline auto CCVar_GetCommandLineValue = p_CCVar_GetCommandLineValue.RCast<const char* (*)(CCVar* thisptr, const char* pVariableName)>(); /*40 55 48 83 EC 20 48 8D 6C 24 ? 48 89 5D 10 49 C7 C0 ? ? ? ?*/
///////////////////////////////////////////////////////////////////////////////
class HCvar : public IDetour

View File

@ -10,16 +10,17 @@ enum class PaintMode_t
/* ==== CENGINEVGUI ===================================================================================================================================================== */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CEngineVGui_Paint = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x89\x54\x24\x10\x55\x56\x41\x55\x48\x81\xEC\x00\x00\x00\x00"), "xxxxxxxxxxx????");
inline int (*CEngineVGui_Paint)(void* thisptr, PaintMode_t mode) = (int (*)(void*, PaintMode_t))p_CEngineVGui_Paint.GetPtr(); /*41 55 41 56 48 83 EC 78 44 8B EA*/
inline auto CEngineVGui_Paint = p_CEngineVGui_Paint.RCast<int (*)(void* thisptr, PaintMode_t mode)>(); /*41 55 41 56 48 83 EC 78 44 8B EA*/
inline ADDRESS p_CEngineVGui_Unknown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x8B\x81\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x4C\x3B\xC0\x74\x1F"), "xxx????xxx????xxxxx");
inline void** (*CEngineVGui_Unknown)(void* thisptr) = (void** (*)(void*))p_CEngineVGui_Unknown.GetPtr(); /*4C 8B 81 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 4C 3B C0 74 1F*/
inline auto CEngineVGui_Unknown = p_CEngineVGui_Unknown.RCast<void** (*)(void* thisptr)>(); /*4C 8B 81 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 4C 3B C0 74 1F*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CEngineVGui_Paint = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x41\x55\x41\x56\x48\x83\xEC\x78\x44\x8B\xEA"), "xxxxxxxxxxx");
inline int (*CEngineVGui_Paint)(void* thisptr, PaintMode_t mode) = (int (*)(void*, PaintMode_t))p_CEngineVGui_Paint.GetPtr(); /*41 55 41 56 48 83 EC 78 44 8B EA*/
inline auto CEngineVGui_Paint = p_CEngineVGui_Paint.RCast<int (*)(void* thisptr, PaintMode_t mode)>(); /*41 55 41 56 48 83 EC 78 44 8B EA*/
inline ADDRESS p_CEngineVGui_Unknown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8D\x05\x00\x00\x00\x00\x48\x8B\xD9\x48\x39\x81\x00\x00\x00\x00\x74\x29"), "xxxxxxxxx????xxxxxx????xx");
inline void** (*CEngineVGui_Unknown)(void* thisptr) = (void** (*)(void*))p_CEngineVGui_Unknown.GetPtr(); /*40 53 48 83 EC 20 48 8D 05 ?? ?? ?? ?? 48 8B D9 48 39 81 ?? ?? ?? ?? 74 29*/
inline auto CEngineVGui_Unknown = p_CEngineVGui_Unknown.RCast<void** (*)(void* thisptr)>(); /*40 53 48 83 EC 20 48 8D 05 ?? ?? ?? ?? 48 8B D9 48 39 81 ?? ?? ?? ?? 74 29*/
#endif
inline void* g_pEngineVGui = CGameServer__SpawnServer.Offset(0x18).FindPatternSelf("48 ?? ?? ?? ?? ?? 01", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast<void*>();

View File

@ -3,7 +3,7 @@
/* ==== CFPSPANEL ======================================================================================================================================================= */
inline ADDRESS p_CFPSPanel_Paint = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x55\x56\x41\x00\x48\x8D\xA8\x00\xFD\xFF\xFF\x48\x81\xEC\x80"), "xxxxxx?xxx?xxxxxxx");
inline ConVar* (*CFPSPanel_Paint)(void* thisptr) = (ConVar* (*)(void*))p_CFPSPanel_Paint.GetPtr(); /*48 8B C4 55 56 41 ?? 48 8D A8 ?? FD FF FF 48 81 EC 80*/
inline auto CFPSPanel_Paint = p_CFPSPanel_Paint.RCast<ConVar* (*)(void* thisptr)>(); /*48 8B C4 55 56 41 ?? 48 8D A8 ?? FD FF FF 48 81 EC 80*/
void CFPSPanel_Attach();
void CFPSPanel_Detach();

View File

@ -3,18 +3,10 @@
/* ==== CMATSYSTEMSURFACE =============================================================================================================================================== */
inline ADDRESS p_CMatSystemSurface_DrawColoredText = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x8B\xDC\x48\x83\xEC\x68\x49\x8D\x43\x58\x0F\x57\xC0"), "xxxxxxxxxxxxxx"); /*4C 8B DC 48 83 EC 68 49 8D 43 58 0F 57 C0*/
inline void* (*CMatSystemSurface_DrawColoredText)(void* thisptr, int font, int fontHeight, int offsetX, int offsetY, int red, int green, int blue, int alpha, const char* text, ...) = (void* (*)(void*, int, int, int, int, int, int, int, int, const char*, ...))p_CMatSystemSurface_DrawColoredText.GetPtr();
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_CMatSystemSurface_Unknown0 = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x0D\x00\x00\x00\x00\x48\x8B\x01\x48\xFF\xA0\x18\x01\x00\x00"), "xxx????xxxxxxxxxx"); /*48 8B 0D ?? ?? ?? ?? 48 8B 01 48 FF A0 18 01 00 00*/
inline std::int64_t(*CMatSystemSurface_Unknown0)() = (std::int64_t(*)())p_CMatSystemSurface_Unknown0.GetPtr(); // [ AMOS ] DELETE
inline ADDRESS g_pMatSystemSurface = p_CHLClient_PostInit.Offset(0x0).ResolveRelativeAddressSelf(0x3, 0x8).GetPtr();
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_CMatSystemSurface_Unknown0 = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x0D\x00\x00\x00\x00\x48\x8B\x01\x48\xFF\xA0\x20\x01\x00\x00"), "xxx????xxxxxxxxxx"); /*48 8B 0D ?? ?? ?? ?? 48 8B 01 48 FF A0 20 01 00 00*/
inline void*(*CMatSystemSurface_Unknown0)() = (void*(*)())p_CMatSystemSurface_Unknown0.GetPtr(); // [ AMOS ] DELETE
inline auto CMatSystemSurface_DrawColoredText = p_CMatSystemSurface_DrawColoredText.RCast<void* (*)(void* thisptr, int font, int fontHeight, int offsetX, int offsetY, int red, int green, int blue, int alpha, const char* text, ...)>();
inline ADDRESS g_pMatSystemSurface = p_CHLClient_PostInit.Offset(0x0).FindPatternSelf("48 83 3D", ADDRESS::Direction::DOWN, 40).ResolveRelativeAddressSelf(0x3, 0x8).GetPtr();
#endif
///////////////////////////////////////////////////////////////////////////////
class HMatSystemSurface : public IDetour
@ -22,7 +14,6 @@ class HMatSystemSurface : public IDetour
virtual void debugp()
{
std::cout << "| FUN: CMatSystemSurface::DrawColoredText : 0x" << std::hex << std::uppercase << p_CMatSystemSurface_DrawColoredText.GetPtr() << std::setw(npad) << " |" << std::endl;
std::cout << "| FUN: CMatSystemSurface::Unknown0 : 0x" << std::hex << std::uppercase << p_CMatSystemSurface_Unknown0.GetPtr() << std::setw(npad) << " |" << std::endl;
std::cout << "| VAR: g_pMatSystemSurface : 0x" << std::hex << std::uppercase << g_pMatSystemSurface.GetPtr() << std::setw(npad) << " |" << std::endl;
std::cout << "+----------------------------------------------------------------+" << std::endl;
}

View File

@ -2,7 +2,7 @@
/* ==== IAPPSYSTEM ============================================================================================================================================== */
inline ADDRESS p_IAppSystem_LoadLibrary = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x48\x8B\x0D\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x85\xC9\x74\x11"), "xxxxxxx????xxx????xxx????xxxxx");
inline void* (*IAppSystem_LoadLibrary)() = (void * (*)())p_IAppSystem_LoadLibrary.GetPtr(); /*48 83 EC 28 48 8B 0D ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 85 C9 74 11*/ // C initializers/terminators
inline auto IAppSystem_LoadLibrary = p_IAppSystem_LoadLibrary.RCast<void* (*)(void)>(); /*48 83 EC 28 48 8B 0D ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 85 C9 74 11*/ // C initializers/terminators
///////////////////////////////////////////////////////////////////////////////
class HAppSystem : public IDetour

View File

@ -4,6 +4,40 @@
extern std::vector<std::string> g_szAllPlaylists;
typedef int HKeySymbol;
//---------------------------------------------------------------------------------
// Purpose: Forward declarations
//---------------------------------------------------------------------------------
class KeyValues;
class CKeyValuesSystem;
/* ==== KEYVALUES ======================================================================================================================================================= */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_KeyValues_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\xC7\x44\x24\x30\xFF\xFF\xFF"), "xxxxxxxxxxxxxxxx");
inline auto KeyValues_Init = p_KeyValues_Init.RCast<void* (*)(KeyValues* thisptr, const char* pSymbol, int64_t a3, bool bCreate)>(); /*40 53 48 83 EC 20 48 8B D9 C7 44 24 30 FF FF FF*/
inline ADDRESS p_KeyValues_FindKey = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x10\x48\x89\x6C\x24\x18\x48\x89\x74\x24\x20\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x81\xEC\x20\x01\x00\x00\x45"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
inline auto KeyValues_FindKey = p_KeyValues_FindKey.RCast<void* (*)(KeyValues* thisptr, const char* pkeyName, bool bCreate)>(); /*48 89 5C 24 10 48 89 6C 24 18 48 89 74 24 20 57 41 54 41 55 41 56 41 57 48 81 EC 20 01 00 00 45*/
inline ADDRESS p_KeyValues_GetCurrentPlaylist = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x75\x08\x48\x8D\x05\x00\x00\x00\x00"), "xxx????xxxxxxxx????");
inline auto KeyValues_GetCurrentPlaylist = p_KeyValues_GetCurrentPlaylist.RCast<const char* (*)(void)>(); /*48 8B 0D ? ? ? ? 48 85 C9 75 08 48 8D 05 ? ? ? ?*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_KeyValues_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\x05\x00\x00\x00\x01\x48\x8B\xD9\x4C\x8B\xC2"), "xxxxxxxxx???xxxxxxx"); /*40 53 48 83 EC 20 48 8B 05 ?? ?? ?? 01 48 8B D9 4C 8B C2*/
inline auto KeyValues_Init = p_KeyValues_Init.RCast<void* (*)(KeyValues* thisptr, const char* pSymbol, int64_t a3, bool bCreate)>();
inline ADDRESS p_KeyValues_FindKey = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x56\x57\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x45"), "xxxxxxxx????x");
inline auto KeyValues_FindKey = p_KeyValues_FindKey.RCast<void* (*)(KeyValues* thisptr, const char* pkeyName, bool bCreate)>(); /*40 56 57 41 57 48 81 EC 30 01 00 00 45 0F B6 F8*/
inline ADDRESS p_KeyValues_GetCurrentPlaylist = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x05\x00\x00\x00\x00\x48\x85\xC0\x75\x08\x48\x8D\x05\x00\x00\x00\x00\xC3\x0F\xB7\x50\x2A"), "xxx????xxxxxxxx????xxxxx");
inline auto KeyValues_GetCurrentPlaylist = p_KeyValues_GetCurrentPlaylist.RCast<const char* (*)(void)>(); /*48 8B 05 ? ? ? ? 48 85 C0 75 08 48 8D 05 ? ? ? ? C3 0F B7 50 2A*/
#endif
inline ADDRESS p_KeyValues_LoadPlaylist = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x74\x0C"), "x????xx?????xx").FollowNearCallSelf().GetPtr();
inline auto KeyValues_LoadPlaylist = p_KeyValues_LoadPlaylist.RCast<bool (*)(const char* pszPlaylist)>(); /*E8 ?? ?? ?? ?? 80 3D ?? ?? ?? ?? ?? 74 0C*/
inline ADDRESS p_KeyValues_GetMemPool = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x85\xD2"), "xxx????xxxxxxxxxxxx");
inline auto KeyValues_GetMemPool = p_KeyValues_GetMemPool.RCast<void* (*)(void)>(); /*48 8B 05 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 48 85 D2*/
inline uintptr_t g_pKeyValuesMemPool = p_KeyValues_GetMemPool.ResolveRelativeAddressSelf(0x3, 0x7).GetPtr();
enum KeyValuesTypes
{
TYPE_NONE = 0x0,
@ -20,34 +54,6 @@ enum KeyValuesTypes
TYPE_NUMTYPES = 0xB,
};
/* ==== KEYVALUES ======================================================================================================================================================= */
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
inline ADDRESS p_KeyValues_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\xC7\x44\x24\x30\xFF\xFF\xFF"), "xxxxxxxxxxxxxxxx"); /*40 53 48 83 EC 20 48 8B D9 C7 44 24 30 FF FF FF*/
inline std::int64_t(*KeyValues_Init)(std::int64_t a1, std::int64_t a2, std::int64_t a3, std::int64_t a4) = (std::int64_t(*)(std::int64_t, std::int64_t, std::int64_t, std::int64_t))p_KeyValues_Init.GetPtr();
inline ADDRESS p_KeyValues_FindKey = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x10\x48\x89\x6C\x24\x18\x48\x89\x74\x24\x20\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x81\xEC\x20\x01\x00\x00\x45"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
inline void* (*KeyValues_FindKey)(void* a1, const char* a2, bool a3) = (void* (*)(void*, const char*, bool))p_KeyValues_FindKey.GetPtr(); /*48 89 5C 24 10 48 89 6C 24 18 48 89 74 24 20 57 41 54 41 55 41 56 41 57 48 81 EC 20 01 00 00 45*/
inline ADDRESS p_KeyValues_GetCurrentPlaylist = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x75\x08\x48\x8D\x05\x00\x00\x00\x00"), "xxx????xxxxxxxx????");
inline const char* (*KeyValues_GetCurrentPlaylist)() = (const char* (*)())p_KeyValues_GetCurrentPlaylist.GetPtr(); /*48 8B 0D ? ? ? ? 48 85 C9 75 08 48 8D 05 ? ? ? ?*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
inline ADDRESS p_KeyValues_Init = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\x05\x00\x00\x00\x01\x48\x8B\xD9\x4C\x8B\xC2"), "xxxxxxxxx???xxxxxxx"); /*40 53 48 83 EC 20 48 8B 05 ?? ?? ?? 01 48 8B D9 4C 8B C2*/
inline void* (*KeyValues_Init)(std::int64_t a1, std::int64_t a2, std::int64_t a3, std::int64_t a4) = (void* (*)(std::int64_t, std::int64_t, std::int64_t, std::int64_t))p_KeyValues_Init.GetPtr();
inline ADDRESS p_KeyValues_FindKey = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x56\x57\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x45"), "xxxxxxxx????x");
inline void* (*KeyValues_FindKey)(void* a1, const char* a2, bool a3) = (void* (*)(void*, const char*, bool))p_KeyValues_FindKey.GetPtr(); /*40 56 57 41 57 48 81 EC 30 01 00 00 45 0F B6 F8*/
inline ADDRESS p_KeyValues_GetCurrentPlaylist = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x05\x00\x00\x00\x00\x48\x85\xC0\x75\x08\x48\x8D\x05\x00\x00\x00\x00\xC3\x0F\xB7\x50\x2A"), "xxx????xxxxxxxx????xxxxx");
inline const char* (*KeyValues_GetCurrentPlaylist)() = (const char* (*)())p_KeyValues_GetCurrentPlaylist.GetPtr(); /*48 8B 05 ? ? ? ? 48 85 C0 75 08 48 8D 05 ? ? ? ? C3 0F B7 50 2A*/
#endif
inline ADDRESS p_KeyValues_GetMemPool = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x85\xD2"), "xxx????xxxxxxxxxxxx");
inline void* (*KeyValues_GetMemPool)() = (void* (*)())p_KeyValues_GetMemPool.GetPtr(); /*48 8B 05 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 48 85 D2*/
inline ADDRESS p_KeyValues_LoadPlaylist = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x74\x0C"), "x????xx?????xx").FollowNearCallSelf().GetPtr();
inline bool (*KeyValues_LoadPlaylist)(const char* source) = (bool (*)(const char*))p_KeyValues_LoadPlaylist.GetPtr(); /*E8 ?? ?? ?? ?? 80 3D ?? ?? ?? ?? ?? 74 0C*/
inline uintptr_t g_pKeyValuesMemPool = p_KeyValues_GetMemPool.ResolveRelativeAddressSelf(0x3, 0x7).GetPtr();
class CKeyValuesSystem // VTABLE @ 0x1413AA1E8 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
{
public:

View File

@ -1,10 +1,10 @@
#pragma once
inline ADDRESS p_QHull_PrintFunc = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x08\x48\x89\x54\x24\x10\x4C\x89\x44\x24\x18\x4C\x89\x4C\x24\x20\x53\xB8\x40\x27\x00\x00\x00\x00\x00\x00\x00\x48"), "xxxxxxxxxxxxxxxxxxxxxxxxxx????xx");
inline int (*QHull_PrintFunc)(const char* fmt, ...) = (int (*)(const char* fmt, ...))p_QHull_PrintFunc.GetPtr(); /*48 89 4C 24 08 48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 B8 40 27 00 00 ?? ?? ?? ?? 00 48*/
inline auto QHull_PrintFunc = p_QHull_PrintFunc.RCast<int (*)(const char* fmt, ...)>(); /*48 89 4C 24 08 48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 B8 40 27 00 00 ?? ?? ?? ?? 00 48*/
//inline ADDRESS p_speex_warning_int = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x54\x24\x10\x4C\x89\x44\x24\x18\x4C\x89\x4C\x24\x20\x53\x56\x57\x48\x83\xEC\x30\x48\x8B\xFA\x48\x8D\x74\x24\x60\x48\x8B"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
//inline int (*speex_warning_int)(int a1, const char* fmt, ...) = (int (*)(int a1, const char* fmt, ...))p_speex_warning_int.GetPtr(); /*48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 56 57 48 83 EC 30 48 8B FA 48 8D 74 24 60 48 8B*/
//inline auto speex_warning_int = p_speex_warning_int.RCast<int (*)(FILE* stream, const char* format, ...)>(); /*48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 56 57 48 83 EC 30 48 8B FA 48 8D 74 24 60 48 8B*/
///////////////////////////////////////////////////////////////////////////////
int HQHull_PrintFunc(const char* fmt, ...);