mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Major cleanup (see description)
* Fix all compiler error for GameSDK on S0 and S1. * Remove some unused patterns and globals (launch performance gains of 100ms). * Remove most duplicate patterns. * Relocate globals from engine to a more appropriate location. * Renamed some unknown vars to a more appropriate name (most of these where obtained a while back, but as we reversed more parts of the engine, some of these vars become known). * Renamed some vars to fit the naming convention used in the SDK. * Fixed pattern debug logging using the wrong pointer, thus displaying the wrong address.
This commit is contained in:
parent
9019e5cb70
commit
5548a74d59
@ -58,8 +58,6 @@ inline auto CHLClient_FrameStageNotify = p_CHLClient_FrameStageNotify.RCast<void
|
||||
|
||||
inline CMemory p_CHLClient_GetAllClasses;
|
||||
inline auto CHLClient_GetAllClasses = p_CHLClient_GetAllClasses.RCast<ClientClass*(*)()>();
|
||||
|
||||
inline bool* cl_time_use_host_tickcount = nullptr;
|
||||
#endif // !DEDICATED
|
||||
|
||||
inline CHLClient* gHLClient = nullptr;
|
||||
@ -85,7 +83,6 @@ class VDll_Engine_Int : public IDetour
|
||||
#ifndef DEDICATED
|
||||
spdlog::debug("| FUN: CHLClient::FrameStageNotify : {:#18x} |\n", p_CHLClient_FrameStageNotify.GetPtr());
|
||||
spdlog::debug("| FUN: CHLClient::GetAllClasses : {:#18x} |\n", p_CHLClient_GetAllClasses.GetPtr());
|
||||
spdlog::debug("| VAR: cl_time_use_host_tickcount : {:#18x} |\n", reinterpret_cast<uintptr_t>(cl_time_use_host_tickcount));
|
||||
#endif // !DEDICATED
|
||||
spdlog::debug("| VAR: gHLClient : {:#18x} |\n", reinterpret_cast<uintptr_t>(gHLClient));
|
||||
spdlog::debug("| VAR: g_pHLClient : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pHLClient));
|
||||
@ -119,9 +116,6 @@ class VDll_Engine_Int : public IDetour
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
#ifndef DEDICATED
|
||||
cl_time_use_host_tickcount = g_GameDll.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*>();
|
||||
#endif // !DEDICATED
|
||||
gHLClient = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>
|
||||
("\x48\x8D\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x30\x48\x8B\xF9"),
|
||||
"xxx????xxxxxxxxxxxxx?xxxxxxxx").ResolveRelativeAddressSelf(0x3, 0x7).RCast<CHLClient*>();
|
||||
|
@ -11,12 +11,6 @@ public:
|
||||
};
|
||||
|
||||
/* ==== CVENGINECLIENT ================================================================================================================================================== */
|
||||
inline CMemory p_CEngineClient_CommandExecute;
|
||||
inline auto CEngineClient_CommandExecute = p_CEngineClient_CommandExecute.RCast<void(*)(void* thisptr, const char* pCmd)>();
|
||||
|
||||
inline CMemory p_CEngineClient_GetLocalPlayer;
|
||||
inline auto CEngineClient_GetLocalPlayer = p_CEngineClient_GetLocalPlayer.RCast<void*(*)()>();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline CMemory g_pEngineClientVFTable = nullptr;
|
||||
inline CEngineClient* g_pEngineClient = nullptr;
|
||||
@ -26,22 +20,10 @@ class HVEngineClient : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| FUN: IVEngineClient::CommandExecute : {:#18x} |\n", p_CEngineClient_CommandExecute.GetPtr());
|
||||
spdlog::debug("| FUN: IVEngineClient::GetLocalPlayer : {:#18x} |\n", p_CEngineClient_GetLocalPlayer.GetPtr());
|
||||
spdlog::debug("| CON: g_pEngineClientVFTable : {:#18x} |\n", g_pEngineClientVFTable.GetPtr());
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
p_CEngineClient_CommandExecute = g_GameDll.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");
|
||||
CEngineClient_CommandExecute = p_CEngineClient_CommandExecute.RCast<void(*)(void* thisptr, const char* pCmd)>(); /*48 89 5C 24 ?? 57 48 83 EC 20 48 8D 0D ?? ?? ?? ?? 41 8B D8*/
|
||||
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
p_CEngineClient_GetLocalPlayer = g_pEngineClient_VTable.WalkVTable(35).Deref().RCast<void*(*)()>();
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
p_CEngineClient_GetLocalPlayer = g_pEngineClientVFTable.WalkVTable(36).Deref().RCast<void*(*)()>();
|
||||
#endif
|
||||
}
|
||||
virtual void GetFun(void) const { }
|
||||
virtual void GetVar(void) const { }
|
||||
virtual void GetCon(void) const
|
||||
{
|
||||
|
@ -205,10 +205,10 @@ void Dedicated_Init()
|
||||
// RUNTIME: HOST_INIT
|
||||
//-------------------------------------------------------------------------
|
||||
{
|
||||
gHost_Init_0.Offset(0xC2).Patch({ 0xEB, 0x34 }); // CAL --> NOP | Disable 'vpk/client_common.bsp' loading.
|
||||
gHost_Init_0.Offset(0x182).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> JMP | Disable UI material asset initialization.
|
||||
gHost_Init_0.Offset(0x859).Patch({ 0xE9, 0x19, 0x04, 0x00, 0x00 }); // LEA --> RET | Disable 'client.dll' library initialization.
|
||||
gHost_Init_0.Offset(0xC77).Patch({ 0xE8, 0x44, 0xCF, 0xFF, 0xFF }); // CAL --> CAL | Disable user config loading and call entitlements.rson initialization instead.
|
||||
p_Host_Init.Offset(0xC2).Patch({ 0xEB, 0x34 }); // CAL --> NOP | Disable 'vpk/client_common.bsp' loading.
|
||||
p_Host_Init.Offset(0x182).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> JMP | Disable UI material asset initialization.
|
||||
p_Host_Init.Offset(0x859).Patch({ 0xE9, 0x19, 0x04, 0x00, 0x00 }); // LEA --> RET | Disable 'client.dll' library initialization.
|
||||
p_Host_Init.Offset(0xC77).Patch({ 0xE8, 0x44, 0xCF, 0xFF, 0xFF }); // CAL --> CAL | Disable user config loading and call entitlements.rson initialization instead.
|
||||
|
||||
gHost_Init_1.Offset(0x564).Patch({ 0xEB }); // JNZ --> JMP | Skip chat room and discord presence thread creation [!TODO: set global boolean instead].
|
||||
gHost_Init_1.Offset(0x609).Patch({ 0xEB, 0x2B }); // JE --> JMP | Skip client.dll 'Init_PostVideo()' validation code.
|
||||
|
@ -45,7 +45,6 @@ inline CMemory Sys_InitGame;
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: HOST_INIT
|
||||
//-------------------------------------------------------------------------
|
||||
inline CMemory gHost_Init_0;// main Host_Init()?
|
||||
inline CMemory gHost_Init_1; // server Host_Init()?
|
||||
inline CMemory gHost_Init_2; // client Host_Init()?
|
||||
|
||||
@ -113,7 +112,6 @@ class VOpcodes : public IDetour
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
spdlog::debug("| FUN: Sys_InitGame : {:#18x} |\n", Sys_InitGame.GetPtr());
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
spdlog::debug("| FUN: Host_Init_0 : {:#18x} |\n", gHost_Init_0.GetPtr());
|
||||
spdlog::debug("| FUN: Host_Init_1 : {:#18x} |\n", gHost_Init_1.GetPtr());
|
||||
spdlog::debug("| FUN: Host_Init_2 : {:#18x} |\n", gHost_Init_2.GetPtr());
|
||||
spdlog::debug("| FUN: Host_Disconnect : {:#18x} |\n", Host_Disconnect.GetPtr());
|
||||
@ -186,9 +184,6 @@ class VOpcodes : public IDetour
|
||||
// 0x1402958D0 // 48 89 5C 24 ? 57 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 41 8B D8 //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
gHost_Init_0 = g_GameDll.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"); // main Host_Init()?
|
||||
// 0x140236E40 // 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 //
|
||||
|
||||
gHost_Init_1 = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x45\x33\xF6"), "xxxxxxxx????xxx"); // server Host_Init()?
|
||||
// 0x140237B00 // 48 8B C4 41 56 48 81 EC ? ? ? ? 45 33 F6 //
|
||||
|
||||
|
@ -9,7 +9,7 @@ void HEbisuSDK_Init()
|
||||
#ifdef DEDICATED
|
||||
*(char*)g_bEbisuSDKInitialized = (char)0x1; // <- 1st EbisuSDK
|
||||
*(char*)g_bEbisuSDKCvarInitialized = (char)0x1; // <- 2nd EbisuSDK
|
||||
*(char*)g_qEbisuSDKCvarInitialized = (char)0x1; // <- 3rd EbisuSDK
|
||||
*(char*)g_NucleusID = (char)0x1; // <- 3rd EbisuSDK
|
||||
#endif // DEDICATED
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include "public/utility/utility.h"
|
||||
|
||||
//#ifdef DEDICATED
|
||||
inline CMemory p_EbisuSDK_Init_Tier0;
|
||||
inline auto EbisuSDK_Init_Tier0 = p_EbisuSDK_Init_Tier0.RCast<void(*)(void)>();
|
||||
inline CMemory p_EbisuSDK_Tier0_Init;
|
||||
inline auto EbisuSDK_Tier0_Init = p_EbisuSDK_Tier0_Init.RCast<void(*)(void)>();
|
||||
|
||||
inline CMemory p_EbisuSDK_CVar_Init;
|
||||
inline auto EbisuSDK_CVar_Init = p_EbisuSDK_CVar_Init.RCast<void(*)(void)>();
|
||||
@ -12,12 +12,11 @@ inline auto EbisuSDK_CVar_Init = p_EbisuSDK_CVar_Init.RCast<void(*)(void)>();
|
||||
inline CMemory p_EbisuSDK_SetState;
|
||||
inline auto EbisuSDK_SetState = p_EbisuSDK_SetState.RCast<void(*)(void)>();
|
||||
|
||||
inline uint64_t* g_NucleusID = nullptr;
|
||||
inline bool* g_bEbisuSDKInitialized = nullptr;
|
||||
inline bool* g_bEbisuSDKCvarInitialized = nullptr;
|
||||
inline bool* g_qEbisuSDKCvarInitialized = nullptr;
|
||||
//#endif // DEDICATED
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void HEbisuSDK_Init();
|
||||
|
||||
@ -30,18 +29,18 @@ class VEbisuSDK : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| FUN: EbisuSDK_Init_Tier0 : {:#18x} |\n", p_EbisuSDK_Init_Tier0.GetPtr());
|
||||
spdlog::debug("| FUN: EbisuSDK_Tier0_Init : {:#18x} |\n", p_EbisuSDK_Tier0_Init.GetPtr());
|
||||
spdlog::debug("| FUN: EbisuSDK_CVar_Init : {:#18x} |\n", p_EbisuSDK_CVar_Init.GetPtr());
|
||||
spdlog::debug("| FUN: EbisuSDK_SetState : {:#18x} |\n", p_EbisuSDK_SetState.GetPtr());
|
||||
spdlog::debug("| VAR: g_NucleusID : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_NucleusID));
|
||||
spdlog::debug("| VAR: g_bEbisuSDKInitialized : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_bEbisuSDKInitialized));
|
||||
spdlog::debug("| VAR: g_bEbisuSDKCvarInitialized : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_bEbisuSDKCvarInitialized));
|
||||
spdlog::debug("| VAR: g_qEbisuSDKCvarInitialized : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_qEbisuSDKCvarInitialized));
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
p_EbisuSDK_Init_Tier0 = g_GameDll.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");
|
||||
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*/
|
||||
p_EbisuSDK_Tier0_Init = g_GameDll.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");
|
||||
EbisuSDK_Tier0_Init = p_EbisuSDK_Tier0_Init.RCast<void(*)(void)>(); /*48 83 EC 28 80 3D ?? ?? ?? ?? 00 0F 85 ?? 02 00 00 48 89 5C 24 20*/
|
||||
|
||||
p_EbisuSDK_CVar_Init = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x57\x48\x83\xEC\x40\x83\x3D"), "xxxxxxxx");
|
||||
EbisuSDK_CVar_Init = p_EbisuSDK_CVar_Init.RCast<void(*)(void)>(); /*40 57 48 83 EC 40 83 3D*/
|
||||
@ -51,9 +50,9 @@ class VEbisuSDK : public IDetour
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
g_bEbisuSDKInitialized = p_EbisuSDK_Init_Tier0.Offset(0x0).FindPatternSelf("80 3D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
|
||||
g_NucleusID = p_EbisuSDK_CVar_Init.Offset(0x20).FindPatternSelf("4C 89 05", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast<uint64_t*>();
|
||||
g_bEbisuSDKInitialized = p_EbisuSDK_Tier0_Init.Offset(0x0).FindPatternSelf("80 3D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
|
||||
g_bEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.Offset(0x12A).FindPatternSelf("C6 05", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
|
||||
g_qEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.Offset(0x20).FindPatternSelf("4C 89 05", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast<bool*>();
|
||||
}
|
||||
virtual void GetCon(void) const { }
|
||||
virtual void Attach(void) const { }
|
||||
|
@ -108,10 +108,10 @@ class VClient : public IDetour
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
p_CClient_Connect = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x41\x56\x41\x57\x48\x83\xEC\x20\x48\x8B\xD9\x48\x89\x74"), "xxxxxxxxxxxxxxxx");
|
||||
p_CClient_Connect = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x56\x57\x41\x56\x48\x83\xEC\x20\x41\x0F\xB6\xE9"), "xxxx?xxxx?xxxxxxxxxxxx");
|
||||
p_CClient_Clear = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x41\x56\x41\x57\x48\x83\xEC\x20\x48\x8B\xD9\x48\x89\x74"), "xxxxxxxxxxxxxxxx");
|
||||
|
||||
v_CClient_Connect = p_CClient_Connect.RCast<bool (*)(CClient*, const char*, void*, bool, void*, char*, int)>(); /*40 53 41 56 41 57 48 83 EC 20 48 8B D9 48 89 74*/
|
||||
v_CClient_Connect = p_CClient_Connect.RCast<bool (*)(CClient*, const char*, void*, bool, void*, char*, int)>(); /*48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 56 48 83 EC 20 41 0F B6 E9*/
|
||||
v_CClient_Clear = p_CClient_Clear.RCast<void (*)(CClient*)>(); /*40 53 41 56 41 57 48 83 EC 20 48 8B D9 48 89 74*/
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
|
@ -10,7 +10,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "core/stdafx.h"
|
||||
#include "client/cdll_engine_int.h"
|
||||
#include "engine/debugoverlay.h"
|
||||
#include "engine/host.h"
|
||||
#include "engine/client/clientstate.h"
|
||||
|
||||
|
||||
@ -28,13 +28,13 @@ bool CClientState::IsPaused()
|
||||
//------------------------------------------------------------------------------
|
||||
float CClientState::GetClientTime()
|
||||
{
|
||||
if (*cl_time_use_host_tickcount)
|
||||
if (m_bClockCorrectionEnabled)
|
||||
{
|
||||
return (float)(int)m_ClockDriftMgr.m_nClientTick * (float)*client_debugdraw_int_unk;
|
||||
return (float)m_ClockDriftMgr.m_nSimulationTick * (*(float*)&interval_per_tick); // VERIFY DEREF
|
||||
}
|
||||
else
|
||||
{
|
||||
return *(float*)client_debugdraw_float_unk;
|
||||
return m_flClockDriftUnknown_TIME; // VERIFY OFS
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,3 +80,4 @@ void CClientState::SetClientTickCount(int tick)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
CClientState* g_pClientState = nullptr;
|
||||
CClientState** g_pClientState_Shifted = nullptr;
|
||||
|
@ -105,7 +105,7 @@ public:
|
||||
_QWORD qword18CB0;
|
||||
CFrameSnapshot* current_frame_maybe;
|
||||
_BYTE gap18CC0[8];
|
||||
char IsClockCorrectionEnabled_MAYBE;
|
||||
char m_bClockCorrectionEnabled;
|
||||
char m_b_unknown;
|
||||
bool m_bLocalPredictionInitialized_MAYBE;
|
||||
int field_18CCC;
|
||||
@ -175,6 +175,7 @@ public:
|
||||
#pragma pack(pop)
|
||||
#ifndef DEDICATED
|
||||
extern CClientState* g_pClientState;
|
||||
extern CClientState** g_pClientState_Shifted; // Shifted by 0x10 forward!
|
||||
#endif // DEDICATED
|
||||
|
||||
/* ==== CCLIENTSTATE ==================================================================================================================================================== */
|
||||
@ -194,6 +195,7 @@ class VClientState : public IDetour
|
||||
spdlog::debug("| FUN: CClientState::Disconnect : {:#18x} |\n", p_CClientState__Disconnect.GetPtr());
|
||||
#ifndef DEDICATED
|
||||
spdlog::debug("| VAR: g_pClientState : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pClientState));
|
||||
spdlog::debug("| VAR: g_pClientState_Shifted : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pClientState_Shifted));
|
||||
#endif // DEDICATED
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
@ -217,6 +219,7 @@ class VClientState : public IDetour
|
||||
{
|
||||
#ifndef DEDICATED
|
||||
g_pClientState = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x0F\x84\x00\x00\x00\x00\x48\x8D\x0D\x00\x00\x00\x00\x48\x83\xC4\x28"), "xx????xxx????xxxx").FindPatternSelf("48 8D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<CClientState*>(); /*0F 84 ? ? ? ? 48 8D 0D ? ? ? ? 48 83 C4 28*/
|
||||
g_pClientState_Shifted = g_GameDll.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<CClientState**>();
|
||||
#endif // DEDICATED
|
||||
}
|
||||
virtual void GetCon(void) const { }
|
||||
|
@ -257,22 +257,22 @@ void MOD_ProcessPakQueue()
|
||||
{
|
||||
if (*qword_167ED7BC0 || WORD2(*qword_167ED7C68) != HIWORD(*qword_167ED7C68))
|
||||
{
|
||||
if (!JT_AcquireFifoLock((JobFifoLock_s*)&*qword_167ED7BE0)
|
||||
&& !(unsigned __int8)sub_14045BAC0((__int64(__fastcall*)(__int64, _DWORD*, __int64, _QWORD*))qword_14045C070, (__int64)&*qword_167ED7BE0, -1i64, 0i64))
|
||||
if (!JT_AcquireFifoLock(&*g_pPakFifoLock)
|
||||
&& !(unsigned __int8)sub_14045BAC0((__int64(__fastcall*)(__int64, _DWORD*, __int64, _QWORD*))g_pPakFifoLockWrapper, &*g_pPakFifoLock, -1i64, 0i64))
|
||||
{
|
||||
sub_14045A1D0((unsigned __int8(__fastcall*)(_QWORD))qword_14045C070, (__int64)&*qword_167ED7BE0, -1i64, 0i64, 0i64, 1);
|
||||
sub_14045A1D0((unsigned __int8(__fastcall*)(_QWORD))g_pPakFifoLockWrapper, &*g_pPakFifoLock, -1i64, 0i64, 0i64, 1);
|
||||
}
|
||||
|
||||
sub_140441220(v25, v24);
|
||||
if (GetCurrentThreadId() == *dword_1641E443C)
|
||||
{
|
||||
if (*byte_167208B0C)
|
||||
if (*g_bPakFifoLockAcquired)
|
||||
{
|
||||
*byte_167208B0C = 0;
|
||||
JT_ReleaseFifoLock((JobFifoLock_s*)&*qword_167ED7BE0);
|
||||
*g_bPakFifoLockAcquired = 0;
|
||||
JT_ReleaseFifoLock(&*g_pPakFifoLock);
|
||||
}
|
||||
}
|
||||
JT_ReleaseFifoLock((JobFifoLock_s*)&*qword_167ED7BE0);
|
||||
JT_ReleaseFifoLock(&*g_pPakFifoLock);
|
||||
}
|
||||
FileSystem()->ResetItemCacheSize(256);
|
||||
FileSystem()->PrecacheTaskItem(*g_pMTVFTaskItem);
|
||||
|
@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
inline CMemory p_CollisionBSPData_LinkPhysics;
|
||||
inline auto CollisionBSPData_LinkPhysics = p_CollisionBSPData_LinkPhysics.RCast<uint64_t(*)(void* thisptr)>();
|
||||
#include "tier0/jobthread.h"
|
||||
|
||||
inline CMemory p_MOD_LoadPakForMap;
|
||||
inline auto v_MOD_LoadPakForMap = p_MOD_LoadPakForMap.RCast<bool(*)(const char* szLevelName)>();
|
||||
@ -20,13 +18,10 @@ inline void** unk_1418749B0;
|
||||
inline void** unk_141874550;
|
||||
inline int64_t* qword_167ED7BC0;
|
||||
inline int64_t* qword_167ED7C68;
|
||||
inline int64_t* qword_167ED7BE0;
|
||||
inline int64_t* qword_14045C070;
|
||||
inline DWORD* dword_1641E443C;
|
||||
inline bool* byte_167208B0C;
|
||||
|
||||
inline auto sub_14045BAC0 = p_MOD_ProcessPakQueue.RCast<__int64(*)(__int64(__fastcall* a1)(__int64, _DWORD*, __int64, _QWORD*), __int64 a2, __int64 a3, __int64 a4)>();
|
||||
inline auto sub_14045A1D0 = p_MOD_ProcessPakQueue.RCast<__int64(*)(unsigned __int8(__fastcall* a1)(_QWORD), __int64 a2, __int64 a3, __int64 a4, volatile signed __int64* a5, char a6)>();
|
||||
inline auto sub_14045BAC0 = p_MOD_ProcessPakQueue.RCast<__int64(*)(__int64(__fastcall* a1)(__int64, _DWORD*, __int64, _QWORD*), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4)>();
|
||||
inline auto sub_14045A1D0 = p_MOD_ProcessPakQueue.RCast<__int64(*)(unsigned __int8(__fastcall* a1)(_QWORD), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4, volatile signed __int64* a5, char a6)>();
|
||||
inline auto sub_140441220 = p_MOD_ProcessPakQueue.RCast<void(*)(__int64 a1, __int64 a2)>();
|
||||
|
||||
extern bool s_bBasePaksInitialized;
|
||||
@ -45,7 +40,6 @@ class VModel_BSP : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| FUN: CollisionBSPData_LinkPhysics : {:#18x} |\n", p_CollisionBSPData_LinkPhysics.GetPtr());
|
||||
spdlog::debug("| FUN: MOD_LoadPakForMap : {:#18x} |\n", p_MOD_LoadPakForMap.GetPtr());
|
||||
spdlog::debug("| FUN: MOD_ProcessPakQueue : {:#18x} |\n", p_MOD_ProcessPakQueue.GetPtr());
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
@ -63,32 +57,23 @@ class VModel_BSP : public IDetour
|
||||
spdlog::debug("| VAR: unk_141874550 : {:#18x} |\n", reinterpret_cast<uintptr_t>(unk_141874550));
|
||||
spdlog::debug("| VAR: qword_167ED7BC0 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_167ED7BC0));
|
||||
spdlog::debug("| VAR: qword_167ED7C68 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_167ED7C68));
|
||||
spdlog::debug("| VAR: qword_167ED7BE0 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_167ED7BE0));
|
||||
spdlog::debug("| VAR: qword_14045C070 : {:#18x} |\n", reinterpret_cast<uintptr_t>(qword_14045C070));
|
||||
spdlog::debug("| VAR: dword_1641E443C : {:#18x} |\n", reinterpret_cast<uintptr_t>(dword_1641E443C));
|
||||
spdlog::debug("| VAR: byte_167208B0C : {:#18x} |\n", reinterpret_cast<uintptr_t>(byte_167208B0C));
|
||||
spdlog::debug("| VAR: dword_1641E443C : {:#18x} |\n", reinterpret_cast<uintptr_t>(dword_1641E443C)); // TODO: ThreadInMainThread() (g_ThreadMainThreadID) threadtools.cpp
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
p_CollisionBSPData_LinkPhysics = g_GameDll.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");
|
||||
CollisionBSPData_LinkPhysics = p_CollisionBSPData_LinkPhysics.RCast<uint64_t(*)(void*)>(); /*48 89 5C 24 ?? 48 89 6C 24 ?? 57 48 81 EC ?? ?? ?? ?? 48 8B F9 33 ED*/
|
||||
|
||||
p_MOD_LoadPakForMap = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x81\xEC\x00\x00\x00\x00\x4C\x8B\xC1\x48\x8D\x15\x00\x00\x00\x00\x48\x8D\x4C\x24\x00\xE8\x00\x00\x00\x00\x4C\x8D\x0D\x00\x00\x00\x00"), "xxx????xxxxxx????xxxx?x????xxx????");
|
||||
v_MOD_LoadPakForMap = p_MOD_LoadPakForMap.RCast<bool(*)(const char*)>(); /*48 81 EC ? ? ? ? 4C 8B C1 48 8D 15 ? ? ? ? 48 8D 4C 24 ? E8 ? ? ? ? 4C 8D 0D ? ? ? ?*/
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
p_CollisionBSPData_LinkPhysics = g_GameDll.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");
|
||||
CollisionBSPData_LinkPhysics = p_CollisionBSPData_LinkPhysics.RCast<uint64_t(*)(void*)>(); /*48 89 5C 24 ?? 48 89 6C 24 ?? 57 48 81 EC ?? ?? ?? ?? 48 8B F9 33 ED*/
|
||||
|
||||
p_MOD_LoadPakForMap = g_GameDll.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");
|
||||
v_MOD_LoadPakForMap = p_MOD_LoadPakForMap.RCast<bool(*)(const char*)>(); /*48 81 EC ? ? ? ? 0F B6 05 ? ? ? ? 4C 8D 05 ? ? ? ? 84 C0*/
|
||||
#endif
|
||||
p_MOD_ProcessPakQueue = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x00\xF3\x0F\x10\x05\x00\x00\x00\x00\x32\xDB"), "xxxxx?xxxx????xx");
|
||||
v_MOD_ProcessPakQueue = p_MOD_ProcessPakQueue.RCast<void(*)(void)>(); /*40 53 48 83 EC ?? F3 0F 10 05 ? ? ? ? 32 DB*/
|
||||
|
||||
sub_14045BAC0 = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x4C\x89\x4C\x24\x00\x4C\x89\x44\x24\x00\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x60"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxx").RCast<__int64(*)(__int64(__fastcall* a1)(__int64, _DWORD*, __int64, _QWORD*), __int64 a2, __int64 a3, __int64 a4)>();
|
||||
sub_14045A1D0 = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x4C\x24\x00\x4C\x89\x44\x24\x00\x48\x89\x54\x24\x00\x48\x89\x4C\x24\x00\x55\x53\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\x6C\x24\x00"), "xxxx?xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxx?").RCast<__int64(*)(unsigned __int8(__fastcall* a1)(_QWORD), __int64 a2, __int64 a3, __int64 a4, volatile signed __int64* a5, char a6)>();
|
||||
sub_14045BAC0 = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x4C\x89\x4C\x24\x00\x4C\x89\x44\x24\x00\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x60"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxx").RCast<__int64(*)(__int64(__fastcall* a1)(__int64, _DWORD*, __int64, _QWORD*), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4)>();
|
||||
sub_14045A1D0 = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x4C\x24\x00\x4C\x89\x44\x24\x00\x48\x89\x54\x24\x00\x48\x89\x4C\x24\x00\x55\x53\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\x6C\x24\x00"), "xxxx?xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxx?").RCast<__int64(*)(unsigned __int8(__fastcall* a1)(_QWORD), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4, volatile signed __int64* a5, char a6)>();
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
sub_140441220 = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x55\x48\x83\xEC\x20\x33\xED\x48\x39\x2D\x00\x00\x00\x00"), "xxxx?xxxxxxxxxx????").RCast<void(*)(__int64 a1, __int64 a2)>();
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
@ -99,19 +84,16 @@ class VModel_BSP : public IDetour
|
||||
{
|
||||
dword_14B383420 = p_MOD_ProcessPakQueue.FindPattern("F3 0F 10").ResolveRelativeAddressSelf(0x4, 0x8).RCast<float*>();
|
||||
dword_1634F445C = p_MOD_ProcessPakQueue.FindPattern("8B 05").ResolveRelativeAddressSelf(0x2, 0x6).RCast<int32_t*>();
|
||||
qword_167ED7BB8 = p_MOD_ProcessPakQueue.Offset(0x10).FindPattern("48 83").ResolveRelativeAddressSelf(0x3, 0x8).RCast<void**>();
|
||||
qword_14180A098 = p_MOD_ProcessPakQueue.Offset(0x20).FindPattern("83 3D").ResolveRelativeAddressSelf(0x2, 0x7).RCast<void**>();
|
||||
byte_16709DDDF = p_MOD_ProcessPakQueue.Offset(0x20).FindPattern("88 1D").ResolveRelativeAddressSelf(0x2, 0x6).RCast<bool*>();
|
||||
off_141874660 = p_MOD_ProcessPakQueue.Offset(0x40).FindPattern("4C 8D 15").ResolveRelativeAddressSelf(0x3, 0x7).RCast<char**>();
|
||||
unk_141874555 = p_MOD_ProcessPakQueue.Offset(0x40).FindPattern("4C 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
unk_1418749B0 = p_MOD_ProcessPakQueue.Offset(0xA0).FindPattern("48 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
unk_141874550 = p_MOD_ProcessPakQueue.Offset(0x150).FindPattern("48 8D 2D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
qword_167ED7BC0 = p_MOD_ProcessPakQueue.Offset(0x200).FindPattern("48 83 3D").ResolveRelativeAddressSelf(0x3, 0x8).RCast<int64_t*>();
|
||||
qword_167ED7C68 = p_MOD_ProcessPakQueue.Offset(0x200).FindPattern("0F B7 05").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||
qword_167ED7BE0 = p_MOD_ProcessPakQueue.Offset(0x250).FindPattern("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||
qword_14045C070 = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPattern("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||
dword_1641E443C = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPattern("3B 05").ResolveRelativeAddressSelf(0x2, 0x6).RCast<DWORD*>();
|
||||
byte_167208B0C = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPattern("C6 05").ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
|
||||
qword_167ED7BB8 = p_MOD_ProcessPakQueue.Offset(0x10).FindPatternSelf("48 83").ResolveRelativeAddressSelf(0x3, 0x8).RCast<void**>();
|
||||
qword_14180A098 = p_MOD_ProcessPakQueue.Offset(0x20).FindPatternSelf("83 3D").ResolveRelativeAddressSelf(0x2, 0x7).RCast<void**>();
|
||||
byte_16709DDDF = p_MOD_ProcessPakQueue.Offset(0x20).FindPatternSelf("88 1D").ResolveRelativeAddressSelf(0x2, 0x6).RCast<bool*>();
|
||||
off_141874660 = p_MOD_ProcessPakQueue.Offset(0x40).FindPatternSelf("4C 8D 15").ResolveRelativeAddressSelf(0x3, 0x7).RCast<char**>();
|
||||
unk_141874555 = p_MOD_ProcessPakQueue.Offset(0x40).FindPatternSelf("4C 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
unk_1418749B0 = p_MOD_ProcessPakQueue.Offset(0xA0).FindPatternSelf("48 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
unk_141874550 = p_MOD_ProcessPakQueue.Offset(0x150).FindPatternSelf("48 8D 2D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
qword_167ED7BC0 = p_MOD_ProcessPakQueue.Offset(0x200).FindPatternSelf("48 83 3D").ResolveRelativeAddressSelf(0x3, 0x8).RCast<int64_t*>();
|
||||
qword_167ED7C68 = p_MOD_ProcessPakQueue.Offset(0x200).FindPatternSelf("0F B7 05").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||
dword_1641E443C = p_MOD_ProcessPakQueue.Offset(0x2A0).FindPatternSelf("3B 05").ResolveRelativeAddressSelf(0x2, 0x6).RCast<DWORD*>();
|
||||
|
||||
(*((char**)(&qword_167ED7C68))) -= 6;
|
||||
}
|
||||
|
@ -50,13 +50,13 @@ bool OverlayBase_t::IsDead() const
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_nOverlayTick < *overlay_tickcount;
|
||||
return m_nOverlayTick < *g_nOverlayTickCount;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_nCreationTick < *render_tickcount;
|
||||
return m_nCreationTick < *g_nRenderTickCount;
|
||||
}
|
||||
return g_pClientState->GetClientTime() >= m_flEndTime;
|
||||
}
|
||||
@ -288,7 +288,7 @@ void DrawAllOverlays(bool bDraw)
|
||||
bool bDraw{ };
|
||||
if (pCurrOverlay->m_nCreationTick == -1)
|
||||
{
|
||||
if (pCurrOverlay->m_nOverlayTick == *overlay_tickcount)
|
||||
if (pCurrOverlay->m_nOverlayTick == *g_nOverlayTickCount)
|
||||
{
|
||||
// Draw overlay if unk0 == *overlay_tickcount
|
||||
bDraw = true;
|
||||
@ -301,7 +301,7 @@ void DrawAllOverlays(bool bDraw)
|
||||
}
|
||||
else
|
||||
{
|
||||
bDraw = pCurrOverlay->m_nCreationTick == *render_tickcount;
|
||||
bDraw = pCurrOverlay->m_nCreationTick == *g_nRenderTickCount;
|
||||
}
|
||||
if (bDraw)
|
||||
{
|
||||
|
@ -164,6 +164,9 @@ void DebugOverlays_Detach();
|
||||
inline CMemory p_DrawAllOverlays;
|
||||
inline auto v_DrawAllOverlays = p_DrawAllOverlays.RCast<void (*)(bool bDraw)>();
|
||||
|
||||
inline CMemory p_DestroyOverlay;
|
||||
inline auto v_DestroyOverlay = p_DestroyOverlay.RCast<void (*)(OverlayBase_t* pOverlay)>();
|
||||
|
||||
inline CMemory p_RenderLine;
|
||||
inline auto v_RenderLine = p_RenderLine.RCast<void* (*)(const Vector3D& vOrigin, const Vector3D& vDest, Color color, bool bZBuffer)>();
|
||||
|
||||
@ -173,17 +176,11 @@ inline auto v_RenderBox = p_RenderBox.RCast<void* (*)(const OverlayBox_t::Transf
|
||||
inline CMemory p_RenderWireframeSphere;
|
||||
inline auto v_RenderWireframeSphere = p_RenderWireframeSphere.RCast<void* (*)(const Vector3D& vCenter, float flRadius, int nTheta, int nPhi, Color color, bool bZBuffer)>();
|
||||
|
||||
inline CMemory p_DestroyOverlay;
|
||||
inline auto v_DestroyOverlay = p_DestroyOverlay.RCast<void (*)(OverlayBase_t* pOverlay)>();
|
||||
|
||||
inline int* client_debugdraw_int_unk = nullptr;
|
||||
inline float* client_debugdraw_float_unk = nullptr;
|
||||
|
||||
inline OverlayBase_t** s_pOverlays = nullptr;
|
||||
inline LPCRITICAL_SECTION s_OverlayMutex = nullptr;
|
||||
|
||||
inline int* render_tickcount = nullptr;
|
||||
inline int* overlay_tickcount = nullptr;
|
||||
inline int* g_nRenderTickCount = nullptr;
|
||||
inline int* g_nOverlayTickCount = nullptr;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class VDebugOverlay : public IDetour
|
||||
@ -191,23 +188,21 @@ class VDebugOverlay : public IDetour
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| FUN: DrawAllOverlays : {:#18x} |\n", p_DrawAllOverlays.GetPtr());
|
||||
spdlog::debug("| FUN: DestroyOverlay : {:#18x} |\n", p_DestroyOverlay.GetPtr());
|
||||
spdlog::debug("| FUN: RenderLine : {:#18x} |\n", p_RenderLine.GetPtr());
|
||||
spdlog::debug("| FUN: RenderBox : {:#18x} |\n", p_RenderBox.GetPtr());
|
||||
spdlog::debug("| FUN: RenderWireframeSphere : {:#18x} |\n", p_RenderWireframeSphere.GetPtr());
|
||||
spdlog::debug("| FUN: DestroyOverlay : {:#18x} |\n", p_DestroyOverlay.GetPtr());
|
||||
spdlog::debug("| VAR: s_pOverlays : {:#18x} |\n", reinterpret_cast<uintptr_t>(s_pOverlays));
|
||||
spdlog::debug("| VAR: s_OverlayMutex : {:#18x} |\n", reinterpret_cast<uintptr_t>(s_OverlayMutex));
|
||||
spdlog::debug("| VAR: client_debugdraw_int_unk : {:#18x} |\n", reinterpret_cast<uintptr_t>(client_debugdraw_int_unk));
|
||||
spdlog::debug("| VAR: client_debugdraw_float_unk : {:#18x} |\n", reinterpret_cast<uintptr_t>(client_debugdraw_float_unk));
|
||||
spdlog::debug("| VAR: overlay_tickcount : {:#18x} |\n", reinterpret_cast<uintptr_t>(overlay_tickcount));
|
||||
spdlog::debug("| VAR: render_tickcount : {:#18x} |\n", reinterpret_cast<uintptr_t>(render_tickcount));
|
||||
spdlog::debug("| VAR: g_nOverlayTickCount : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_nOverlayTickCount));
|
||||
spdlog::debug("| VAR: g_nRenderTickCount : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_nRenderTickCount));
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
p_DrawAllOverlays = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x48\x83\xEC\x50\x48\x8B\x05\x00\x00\x00\x00"), "xxxxxxxxx????");
|
||||
p_RenderWireframeBox = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x44\x89\x4C\x24\x00"), "xxxx?xxxx?xxxx?");
|
||||
p_RenderBox = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x44\x89\x4C\x24\x00\x55\x41\x56"), "xxxx?xxxx?xxxx?xxxx?xxx");
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
p_DrawAllOverlays = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x48\x83\xEC\x30\x48\x8B\x05\x00\x00\x00\x00\x0F\xB6\xE9"), "xxxxxxxxx????xxx");
|
||||
p_RenderBox = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x44\x89\x4C\x24\x00"), "xxxx?xxxx?xxxx?");
|
||||
@ -224,18 +219,15 @@ class VDebugOverlay : public IDetour
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
client_debugdraw_int_unk = p_DrawAllOverlays.Offset(0xC0).FindPatternSelf("F3 0F 59", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x4, 0x8).RCast<int*>();
|
||||
client_debugdraw_float_unk = p_DrawAllOverlays.Offset(0xD0).FindPatternSelf("F3 0F 10", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x4, 0x8).RCast<float*>();
|
||||
|
||||
s_pOverlays = p_DrawAllOverlays.Offset(0x10).FindPatternSelf("48 8B 3D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast<OverlayBase_t**>();
|
||||
s_OverlayMutex = p_DrawAllOverlays.Offset(0x10).FindPatternSelf("48 8D 0D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast<LPCRITICAL_SECTION>();
|
||||
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
render_tickcount = p_DrawAllOverlays.Offset(0x80).FindPatternSelf("3B 0D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();
|
||||
overlay_tickcount = p_DrawAllOverlays.Offset(0x70).FindPatternSelf("3B 0D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();
|
||||
g_nRenderTickCount = p_DrawAllOverlays.Offset(0x80).FindPatternSelf("3B 0D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();
|
||||
g_nOverlayTickCount = p_DrawAllOverlays.Offset(0x70).FindPatternSelf("3B 0D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
render_tickcount = p_DrawAllOverlays.Offset(0x50).FindPatternSelf("3B 05", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();
|
||||
overlay_tickcount = p_DrawAllOverlays.Offset(0x70).FindPatternSelf("3B 05", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();
|
||||
g_nRenderTickCount = p_DrawAllOverlays.Offset(0x50).FindPatternSelf("3B 05", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();
|
||||
g_nOverlayTickCount = p_DrawAllOverlays.Offset(0x70).FindPatternSelf("3B 05", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast<int*>();
|
||||
#endif
|
||||
}
|
||||
virtual void GetCon(void) const { }
|
||||
|
@ -15,6 +15,8 @@ inline auto VCR_EnterPausedState = p_VCR_EnterPausedState.RCast<void(*)(void)>()
|
||||
inline bool* g_bAbortServerSet = nullptr;
|
||||
inline jmp_buf* host_abortserver = nullptr;
|
||||
|
||||
inline float* interval_per_tick = nullptr;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class VHost : public IDetour
|
||||
{
|
||||
@ -24,6 +26,7 @@ class VHost : public IDetour
|
||||
spdlog::debug("| FUN: _Host_RunFrame_Render : {:#18x} |\n", p_Host_RunFrame_Render.GetPtr());
|
||||
spdlog::debug("| FUN: Host_Error : {:#18x} |\n", p_Host_Error.GetPtr());
|
||||
spdlog::debug("| FUN: VCR_EnterPausedState : {:#18x} |\n", p_VCR_EnterPausedState.GetPtr());
|
||||
spdlog::debug("| VAR: interval_per_tick : {:#18x} |\n", reinterpret_cast<uintptr_t>(interval_per_tick));
|
||||
spdlog::debug("| VAR: host_abortserver : {:#18x} |\n", reinterpret_cast<uintptr_t>(host_abortserver));
|
||||
spdlog::debug("| VAR: g_bAbortServerSet : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_bAbortServerSet));
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
@ -46,6 +49,7 @@ class VHost : public IDetour
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
interval_per_tick = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x8B\xDC\x4D\x89\x4B\x20\x55\x56\x41\x54"), "xxxxxxxxxxx").FindPatternSelf("F3 0F 5E", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x4, 0x8).RCast<float*>();
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
g_bAbortServerSet = p_Host_Error.FindPattern("40 38 3D", CMemory::Direction::DOWN, 512, 2).ResolveRelativeAddress(3, 7).RCast<bool*>();
|
||||
host_abortserver = p_Host_Error.FindPattern("48 8D 0D", CMemory::Direction::DOWN, 512, 3).ResolveRelativeAddress(3, 7).RCast<jmp_buf*>();
|
||||
|
@ -33,7 +33,7 @@ class VSys_Utils : public IDetour
|
||||
spdlog::debug("| FUN: Sys_Error : {:#18x} |\n", p_Sys_Error.GetPtr());
|
||||
spdlog::debug("| FUN: Sys_Warning : {:#18x} |\n", p_Sys_Warning.GetPtr());
|
||||
spdlog::debug("| FUN: Sys_LoadAssetHelper : {:#18x} |\n", p_Sys_LoadAssetHelper.GetPtr());
|
||||
spdlog::debug("| FUN: Sys_GetProcessUpTime : {:#18x} |\n", p_Sys_LoadAssetHelper.GetPtr());
|
||||
spdlog::debug("| FUN: Sys_GetProcessUpTime : {:#18x} |\n", p_Sys_GetProcessUpTime.GetPtr());
|
||||
#ifndef DEDICATED
|
||||
spdlog::debug("| FUN: Con_NPrintf : {:#18x} |\n", p_Con_NPrintf.GetPtr());
|
||||
#endif // !DEDICATED
|
||||
|
@ -106,36 +106,11 @@ bool CBaseFileSystem::VReadFromCache(CBaseFileSystem* pFileSystem, char* pszFile
|
||||
return CBaseFileSystem_VLoadFromCache(pFileSystem, pszFilePath, pResults);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create the search path.
|
||||
// Input : *pPath -
|
||||
// *pPathID -
|
||||
// addType -
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseFileSystem::VAddSearchPath(CBaseFileSystem* pFileSystem, const char* pPath, const char* pPathID, SearchPathAdd_t addType)
|
||||
{
|
||||
CBaseFileSystem_VAddSearchPath(pFileSystem, pPath, pPathID, addType);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: remove the search path.
|
||||
// Input : *pPath -
|
||||
// *pPathID -
|
||||
// addType -
|
||||
// Output : true on success, false otherwise.
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CBaseFileSystem::VRemoveSearchPath(CBaseFileSystem* pFileSystem, const char* pPath, const char* pPathID)
|
||||
{
|
||||
return CBaseFileSystem_VRemoveSearchPath(pFileSystem, pPath, pPathID);
|
||||
}
|
||||
|
||||
void CBaseFileSystem_Attach()
|
||||
{
|
||||
DetourAttach((LPVOID*)&CBaseFileSystem_Warning, &CBaseFileSystem::Warning);
|
||||
DetourAttach((LPVOID*)&CBaseFileSystem_VLoadFromVPK, &CBaseFileSystem::VReadFromVPK);
|
||||
DetourAttach((LPVOID*)&CBaseFileSystem_VLoadFromCache, &CBaseFileSystem::VReadFromCache);
|
||||
DetourAttach((LPVOID*)&CBaseFileSystem_VAddSearchPath, &CBaseFileSystem::VAddSearchPath);
|
||||
DetourAttach((LPVOID*)&CBaseFileSystem_VRemoveSearchPath, &CBaseFileSystem::VRemoveSearchPath);
|
||||
}
|
||||
|
||||
void CBaseFileSystem_Detach()
|
||||
@ -143,7 +118,5 @@ void CBaseFileSystem_Detach()
|
||||
DetourDetach((LPVOID*)&CBaseFileSystem_Warning, &CBaseFileSystem::Warning);
|
||||
DetourDetach((LPVOID*)&CBaseFileSystem_VLoadFromVPK, &CBaseFileSystem::VReadFromVPK);
|
||||
DetourDetach((LPVOID*)&CBaseFileSystem_VLoadFromCache, &CBaseFileSystem::VReadFromCache);
|
||||
DetourDetach((LPVOID*)&CBaseFileSystem_VAddSearchPath, &CBaseFileSystem::VAddSearchPath);
|
||||
DetourDetach((LPVOID*)&CBaseFileSystem_VRemoveSearchPath, &CBaseFileSystem::VRemoveSearchPath);
|
||||
}
|
||||
CBaseFileSystem* g_pFileSystem = nullptr;
|
@ -10,8 +10,6 @@ public:
|
||||
static void Warning(CBaseFileSystem* pFileSystem, FileWarningLevel_t level, const char* fmt, ...);
|
||||
static FileHandle_t VReadFromVPK(CBaseFileSystem* pVpk, FileHandle_t pResults, char* pszFilePath);
|
||||
static bool VReadFromCache(CBaseFileSystem* pFileSystem, char* pszFilePath, void* pResults);
|
||||
static void VAddSearchPath(CBaseFileSystem* pFileSystem, const char* pPath, const char* pPathID, SearchPathAdd_t addType);
|
||||
static bool VRemoveSearchPath(CBaseFileSystem* pFileSystem, const char* pPath, const char* pPathID);
|
||||
|
||||
protected:
|
||||
//----------------------------------------------------------------------------
|
||||
@ -48,12 +46,6 @@ inline auto CBaseFileSystem_VLoadFromVPK = p_CBaseFileSystem_LoadFromVPK.RCast<F
|
||||
inline CMemory p_CBaseFileSystem_LoadFromCache;
|
||||
inline auto CBaseFileSystem_VLoadFromCache = p_CBaseFileSystem_LoadFromCache.RCast<bool(*)(CBaseFileSystem* thisptr, char* pszAssetName, void* pResults)>();
|
||||
|
||||
inline CMemory p_CBaseFileSystem_AddSearchPath;
|
||||
inline auto CBaseFileSystem_VAddSearchPath = p_CBaseFileSystem_AddSearchPath.RCast<void(*)(CBaseFileSystem* thisptr, const char* pPath, const char* pPathID, SearchPathAdd_t addType)>();
|
||||
|
||||
inline CMemory p_CBaseFileSystem_RemoveSearchPath;
|
||||
inline auto CBaseFileSystem_VRemoveSearchPath = p_CBaseFileSystem_RemoveSearchPath.RCast<bool(*)(CBaseFileSystem* thisptr, const char* pPath, const char* pPathID)>();
|
||||
|
||||
extern CBaseFileSystem* g_pFileSystem;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -68,8 +60,6 @@ class VBaseFileSystem : public IDetour
|
||||
spdlog::debug("| FUN: CBaseFileSystem::Warning : {:#18x} |\n", p_CBaseFileSystem_Warning.GetPtr());
|
||||
spdlog::debug("| FUN: CBaseFileSystem::LoadFromVPK : {:#18x} |\n", p_CBaseFileSystem_LoadFromVPK.GetPtr());
|
||||
spdlog::debug("| FUN: CBaseFileSystem::LoadFromCache : {:#18x} |\n", p_CBaseFileSystem_LoadFromCache.GetPtr());
|
||||
spdlog::debug("| FUN: CBaseFileSystem::AddSearchPath : {:#18x} |\n", p_CBaseFileSystem_AddSearchPath.GetPtr());
|
||||
spdlog::debug("| FUN: CBaseFileSystem::RemoveSearchPath : {:#18x} |\n", p_CBaseFileSystem_RemoveSearchPath.GetPtr());
|
||||
spdlog::debug("| VAR: g_pFileSystem : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pFileSystem));
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
@ -78,14 +68,10 @@ class VBaseFileSystem : public IDetour
|
||||
p_CBaseFileSystem_Warning = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x4C\x24\x20\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48"), "xxxxxx??????????x");
|
||||
p_CBaseFileSystem_LoadFromVPK = g_GameDll.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????");
|
||||
p_CBaseFileSystem_LoadFromCache = g_GameDll.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");
|
||||
p_CBaseFileSystem_AddSearchPath = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x44\x89\x4C\x24\x00\x48\x89\x4C\x24\x00\x55\x57"), "xxxx?xxxx?xx");
|
||||
p_CBaseFileSystem_RemoveSearchPath = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x55\x56\x57\x41\x54\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00\xC6\x44\x24\x00\x00"), "xxxxxxxxxxxxxx????xxx??");
|
||||
|
||||
CBaseFileSystem_Warning = p_CBaseFileSystem_Warning.RCast<void(*)(CBaseFileSystem*, FileWarningLevel_t, const char*, ...)>(); /*4C 89 4C 24 20 C3 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48*/
|
||||
CBaseFileSystem_VLoadFromVPK = p_CBaseFileSystem_LoadFromVPK.RCast<FileHandle_t(*)(CBaseFileSystem*, FileHandle_t, char*)>(); /*48 89 5C 24 ?? 57 48 81 EC ?? ?? ?? ?? 49 8B C0 4C 8D 8C 24 ?? ?? ?? ??*/
|
||||
CBaseFileSystem_VLoadFromCache = p_CBaseFileSystem_LoadFromCache.RCast<bool(*)(CBaseFileSystem*, char*, void*)>(); /*40 53 48 81 EC ?? ?? ?? ?? 80 3D ?? ?? ?? ?? ?? 49 8B D8*/
|
||||
CBaseFileSystem_VAddSearchPath = p_CBaseFileSystem_AddSearchPath.RCast<void(*)(CBaseFileSystem*, const char*, const char*, SearchPathAdd_t)>(); /*44 89 4C 24 ?? 48 89 4C 24 ?? 55 57*/
|
||||
CBaseFileSystem_VRemoveSearchPath = p_CBaseFileSystem_RemoveSearchPath.RCast<bool(*)(CBaseFileSystem*, const char*, const char*)>(); /*40 53 55 56 57 41 54 41 56 41 57 48 81 EC ?? ?? ?? ?? C6 44 24 ?? ??*/
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
|
@ -22,7 +22,6 @@ inline auto CAI_NetworkManager__LoadNetworkGraph = p_CAI_NetworkManager__LoadNet
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
inline CMemory p_CAI_NetworkManager__LoadNetworkGraph = nullptr;
|
||||
inline auto CAI_NetworkManager__LoadNetworkGraph = p_CAI_NetworkManager__LoadNetworkGraph.RCast<void* (*)(void* thisptr, void* pBuffer, const char* pszFileName)>();
|
||||
|
||||
#endif
|
||||
/* ==== CAI_NETWORKBUILDER ============================================================================================================================================== */
|
||||
inline CMemory p_CAI_NetworkBuilder__Build;
|
||||
@ -68,7 +67,7 @@ class VAI_NetworkManager : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| FUN: CAI_NetworkManager::LoadNetworkGraph : {:#18x} |\n", p_CAI_NetworkManager__ShouldRebuild.GetPtr());
|
||||
spdlog::debug("| FUN: CAI_NetworkManager::LoadNetworkGraph : {:#18x} |\n", p_CAI_NetworkManager__LoadNetworkGraph.GetPtr());
|
||||
spdlog::debug("| FUN: CAI_NetworkManager::ShouldRebuild : {:#18x} |\n", p_CAI_NetworkManager__ShouldRebuild.GetPtr());
|
||||
spdlog::debug("| FUN: CAI_NetworkBuilder::Build : {:#18x} |\n", p_CAI_NetworkBuilder__Build.GetPtr() );
|
||||
spdlog::debug("| VAR: g_nAiNodeClusters : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_nAiNodeClusters ));
|
||||
|
@ -5,6 +5,7 @@
|
||||
//===========================================================================//
|
||||
#include "core/stdafx.h"
|
||||
#include "tier1/cvar.h"
|
||||
#include "rtech/rtech_utils.h"
|
||||
#include "materialsystem/cmaterialsystem.h"
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
@ -15,18 +15,14 @@ inline auto v_DispatchDrawCall = p_DispatchDrawCall.RCast<void* (*)(int64_t a1,
|
||||
inline CMemory p_DispatchDrawCall;
|
||||
inline auto v_DispatchDrawCall = p_DispatchDrawCall.RCast<void* (*)(int64_t a1, uint64_t a2, int a3, int a4, int64_t a5, int a6, uint8_t a7, int64_t a8, uint32_t a9, uint32_t a10, int a11, __m128* a12, int a13, int64_t a14)>();
|
||||
#endif
|
||||
|
||||
inline CMemory p_DrawStreamOverlay;
|
||||
inline auto DrawStreamOverlay = p_DrawStreamOverlay.RCast<const char* (*)(void* thisptr, uint8_t* a2, void* unused, void* a4)>();
|
||||
|
||||
inline CMemory p_StreamDB_Init;
|
||||
inline auto v_StreamDB_Init = p_StreamDB_Init.RCast<void (*)(const char* pszLevelName)>();
|
||||
inline auto v_DrawStreamOverlay = p_DrawStreamOverlay.RCast<const char* (*)(void* thisptr, uint8_t* a2, void* unused, void* a4)>();
|
||||
|
||||
inline CMemory s_pRenderContext;
|
||||
|
||||
inline int* total_streaming_tex_memory = nullptr;
|
||||
inline int* unfree_streaming_tex_memory = nullptr;
|
||||
inline int* unusable_streaming_tex_memory = nullptr;
|
||||
inline int* g_nTotalStreamingTextureMemory = nullptr;
|
||||
inline int* g_nUnfreeStreamingTextureMemory = nullptr;
|
||||
inline int* g_nUnusableStreamingTextureMemory = nullptr;
|
||||
#endif // !DEDICATED
|
||||
|
||||
void CMaterialSystem_Attach();
|
||||
@ -38,12 +34,16 @@ class VMaterialSystem : public IDetour
|
||||
{
|
||||
spdlog::debug("| FUN: CMaterialSystem::Init : {:#18x} |\n", p_CMaterialSystem__Init.GetPtr());
|
||||
#ifndef DEDICATED
|
||||
spdlog::debug("| FUN: DispatchDrawCall : {:#18x} |\n", p_DispatchDrawCall.GetPtr());
|
||||
spdlog::debug("| FUN: DrawStreamOverlay : {:#18x} |\n", p_DrawStreamOverlay.GetPtr());
|
||||
spdlog::debug("| FUN: StreamDB_Init : {:#18x} |\n", p_StreamDB_Init.GetPtr());
|
||||
spdlog::debug("| FUN: CMaterialSystem::DispatchDrawCall : {:#18x} |\n", p_DispatchDrawCall.GetPtr());
|
||||
spdlog::debug("| FUN: CMaterialSystem::DrawStreamOverlay : {:#18x} |\n", p_DrawStreamOverlay.GetPtr());
|
||||
spdlog::debug("| VAR: s_pRenderContext : {:#18x} |\n", s_pRenderContext.GetPtr());
|
||||
#endif // !DEDICATED
|
||||
spdlog::debug("| VAR: g_pMaterialSystem : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pMaterialSystem));
|
||||
#ifndef DEDICATED
|
||||
spdlog::debug("| VAR: g_nTotalStreamingTextureMemory : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_nTotalStreamingTextureMemory));
|
||||
spdlog::debug("| VAR: g_nUnfreeStreamingTextureMemory : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_nUnfreeStreamingTextureMemory));
|
||||
spdlog::debug("| VAR: g_nUnusableStreamingTextureMemory : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_nUnusableStreamingTextureMemory));
|
||||
#endif // !DEDICATED
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
@ -59,10 +59,7 @@ class VMaterialSystem : public IDetour
|
||||
v_DispatchDrawCall = p_DispatchDrawCall.RCast<void* (*)(int64_t, uint64_t, int, int, int64_t, int, uint8_t, int64_t, uint32_t, uint32_t, int, __m128*, int, int64_t )>();
|
||||
#endif
|
||||
p_DrawStreamOverlay = g_GameDll.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");
|
||||
DrawStreamOverlay = p_DrawStreamOverlay.RCast<const char* (*)(void*, uint8_t*, void*, void*)>(); // 41 56 B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 2B E0 C6 02 00 //
|
||||
|
||||
p_StreamDB_Init = g_GameDll.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");
|
||||
v_StreamDB_Init = p_StreamDB_Init.RCast<void (*)(const char*)>(); /*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*/
|
||||
v_DrawStreamOverlay = p_DrawStreamOverlay.RCast<const char* (*)(void*, uint8_t*, void*, void*)>(); // 41 56 B8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 2B E0 C6 02 00 //
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
@ -72,9 +69,9 @@ class VMaterialSystem : public IDetour
|
||||
#ifndef DEDICATED
|
||||
s_pRenderContext = p_DispatchDrawCall.FindPattern("48 8B ?? ?? ?? ?? 01").ResolveRelativeAddressSelf(0x3, 0x7);
|
||||
|
||||
total_streaming_tex_memory = p_DrawStreamOverlay.Offset(0x0).FindPatternSelf("48 8B 05", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
|
||||
unfree_streaming_tex_memory = p_DrawStreamOverlay.Offset(0x20).FindPatternSelf("48 8B 05", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
|
||||
unusable_streaming_tex_memory = p_DrawStreamOverlay.Offset(0x50).FindPatternSelf("48 8B 05", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
|
||||
g_nTotalStreamingTextureMemory = p_DrawStreamOverlay.Offset(0x0).FindPatternSelf("48 8B 05", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
|
||||
g_nUnfreeStreamingTextureMemory = p_DrawStreamOverlay.Offset(0x20).FindPatternSelf("48 8B 05", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
|
||||
g_nUnusableStreamingTextureMemory = p_DrawStreamOverlay.Offset(0x50).FindPatternSelf("48 8B 05", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int*>();
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
virtual void GetCon(void) const { }
|
||||
|
@ -49,7 +49,7 @@ class VShaderGlue : public IDetour
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
CShaderGlue_SetupShader = CShaderGlue_VTable.WalkVTable(4).RCast<int(*)(CShaderGlue*, uint64_t, uint64_t, void*)>();
|
||||
CShaderGlue_SetupShader = CShaderGlue_VTable.WalkVTable(4).Deref(2).RCast<int(*)(CShaderGlue*, uint64_t, uint64_t, void*)>();
|
||||
}
|
||||
virtual void GetVar(void) const { }
|
||||
virtual void GetCon(void) const
|
||||
|
@ -198,7 +198,7 @@ public:
|
||||
// at load time, so the dedicated couldn't pass it in that way).
|
||||
virtual FilesystemMountRetval_t MountSteamContent(int nExtraAppId = -1) = 0;
|
||||
|
||||
#if !defined (GAMEDLL_S0) || !defined (GAMEDLL_S1) || !defined (GAMEDLL_S2)
|
||||
#if !defined(GAMEDLL_S0) && !defined(GAMEDLL_S1) && !defined (GAMEDLL_S2)
|
||||
virtual bool InitFeatureFlags() = 0;
|
||||
virtual bool InitFeatureFlags(const char* pszFlagSetFile) = 0;
|
||||
#endif // !GAMEDLL_S0 || !GAMEDLL_S1 || GAMEDLL_S2
|
||||
|
@ -500,7 +500,7 @@ uint8_t __fastcall RTech::DecompressPakFile(RPakDecompState_t* state, uint64_t i
|
||||
return result;
|
||||
}
|
||||
|
||||
#if not defined DEDICATED && defined (GAMEDLL_S3)
|
||||
#if not defined DEDICATED
|
||||
|
||||
#pragma warning( push )
|
||||
// Disable stack warning, tells us to move more data to the heap instead. Not really possible with 'initialData' here. Since its parallel processed.
|
||||
@ -690,9 +690,9 @@ void RTech_Utils_Attach()
|
||||
{
|
||||
//DetourAttach((LPVOID*)&RTech_OpenFile, &RTech::OpenFile); // !FIXME: Loading override rpaks doesn't work with this, disabled for now.
|
||||
|
||||
#if not defined DEDICATED && defined (GAMEDLL_S3)
|
||||
#if not defined DEDICATED && defined GAMEDLL_S3
|
||||
DetourAttach((LPVOID*)&RTech_CreateDXTexture, &RTech::CreateDXTexture);
|
||||
#endif
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
|
||||
void RTech_Utils_Detach()
|
||||
@ -700,9 +700,9 @@ void RTech_Utils_Detach()
|
||||
// [ PIXIE ]: Everything related to RTech::OpenFile should be compatible across seasons.
|
||||
//DetourDetach((LPVOID*)&RTech_OpenFile, &RTech::OpenFile);
|
||||
|
||||
#if not defined DEDICATED && defined (GAMEDLL_S3)
|
||||
#if not defined DEDICATED && defined GAMEDLL_S3
|
||||
DetourDetach((LPVOID*)&RTech_CreateDXTexture, &RTech::CreateDXTexture);
|
||||
#endif
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
#include "tier0/jobthread.h"
|
||||
#include "vpklib/packedstore.h"
|
||||
#include "rtech/rtech_game.h"
|
||||
|
||||
#define PAK_PARAM_SIZE 0xB0
|
||||
#define DCMP_BUF_SIZE 0x400000
|
||||
|
||||
@ -167,30 +170,7 @@ struct __declspec(align(8)) RPakDecompState_t
|
||||
uint64_t m_nDecompStreamSize;
|
||||
};
|
||||
|
||||
#if not defined DEDICATED && defined (GAMEDLL_S3)
|
||||
|
||||
struct RPakTextureHeader_t
|
||||
{
|
||||
uint64_t m_nNameHash;
|
||||
uint32_t m_nNameIndex;
|
||||
uint32_t m_nNameOffset;
|
||||
uint16_t m_nWidth;
|
||||
uint16_t m_nHeight;
|
||||
uint8_t unk0;
|
||||
uint8_t unk1;
|
||||
uint16_t m_nFormat;
|
||||
uint8_t unk2;
|
||||
uint32_t m_nDataSize;
|
||||
uint8_t unk3;
|
||||
uint8_t m_nMipLevelsStreamedOpt;
|
||||
uint8_t m_nArraySize;
|
||||
uint8_t m_nLayerCount;
|
||||
uint8_t unk4;
|
||||
uint8_t m_nMipLevels;
|
||||
uint8_t m_nMipLevelsStreamed;
|
||||
uint8_t unk5[0x15];
|
||||
};
|
||||
|
||||
#if not defined DEDICATED
|
||||
struct RTechTextureInfo_t
|
||||
{
|
||||
uint64_t m_nGUID;
|
||||
@ -209,7 +189,10 @@ struct RTechTextureInfo_t
|
||||
uint8_t m_nMipLevelsStreamed;
|
||||
uint8_t unk3[24];
|
||||
uint8_t m_nTotalStreamedMips; // Does not get set until after RTech::CreateDXTexture.
|
||||
uint8_t unk4[285];
|
||||
uint8_t unk4[228];
|
||||
#ifdef GAMEDLL_S3
|
||||
uint8_t unk5[57];
|
||||
#endif // GAMEDLL_S3
|
||||
ID3D11Texture2D* m_ppTexture;
|
||||
ID3D11ShaderResourceView* m_ppShaderResourceView;
|
||||
uint8_t m_nTextureMipLevels;
|
||||
@ -428,7 +411,7 @@ static std::map<uint16_t, DXGI_FORMAT> rpakToDxgiFormat {
|
||||
{ 61, DXGI_FORMAT_D16_UNORM },
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // !DEDICATED
|
||||
|
||||
class RPakLoadedInfo_t
|
||||
{
|
||||
@ -442,16 +425,16 @@ public:
|
||||
void* m_pMalloc; //0x0020
|
||||
uint64_t* m_pAssetGuids; //0x0028 size of the array is m_nAssetCount
|
||||
char pad_0030[128]; //0x0030
|
||||
#ifndef GAMEDLL_S3
|
||||
#if not defined GAMEDLL_S3
|
||||
char pad_00B0[48];
|
||||
#endif // !GAMEDLL_S3
|
||||
uint64_t m_nUnkEnd; //0x00B0
|
||||
}; //Size: 0x00B8/0x00E8
|
||||
|
||||
/* ==== RTECH =========================================================================================================================================================== */
|
||||
#if not defined DEDICATED && defined (GAMEDLL_S3)
|
||||
#if not defined DEDICATED
|
||||
inline CMemory p_RTech_CreateDXTexture;
|
||||
inline auto RTech_CreateDXTexture = p_RTech_CreateDXTexture.RCast<void(*)(RPakTextureHeader_t*, int64_t)>();
|
||||
inline auto RTech_CreateDXTexture = p_RTech_CreateDXTexture.RCast<void(*)(RTechTextureInfo_t*, int64_t)>();
|
||||
|
||||
inline CMemory p_GetStreamOverlay;
|
||||
inline auto GetStreamOverlay = p_GetStreamOverlay.RCast<void(*)(const char* mode, char* buf, size_t bufSize)>();
|
||||
@ -464,14 +447,22 @@ inline auto RTech_FindFreeSlotInFiles = p_RTech_FindFreeSlotInFiles.RCast<int32_
|
||||
inline CMemory p_RTech_OpenFile;
|
||||
inline auto RTech_OpenFile = p_RTech_OpenFile.RCast<int32_t(*)(const char*, void*, int64_t*)>();
|
||||
|
||||
inline CMemory p_StreamDB_Init;
|
||||
inline auto v_StreamDB_Init = p_StreamDB_Init.RCast<void (*)(const char* pszLevelName)>();
|
||||
|
||||
inline RPakLoadedInfo_t* g_pLoadedPakInfo;
|
||||
inline int16_t* s_pLoadedPakCount;
|
||||
inline int16_t* s_pParsedPakCount;
|
||||
inline RPakUnknownStruct_t* g_pUnknownPakStruct;
|
||||
|
||||
inline int32_t* s_pFileArray;
|
||||
inline PSRWLOCK* g_pPakFileSlotLock;
|
||||
inline pFileHandleTracker_t* m_FileHandles;
|
||||
|
||||
inline JobFifoLock_s* g_pPakFifoLock;
|
||||
inline void* g_pPakFifoLockWrapper; // Pointer to function that takes the the global pak fifolock as argument.
|
||||
inline bool* g_bPakFifoLockAcquired;
|
||||
|
||||
class RTech
|
||||
{
|
||||
public:
|
||||
@ -482,13 +473,11 @@ public:
|
||||
RPakLoadedInfo_t* GetPakLoadedInfo(const char* szPakName);
|
||||
|
||||
static int32_t OpenFile(const char* szFilePath, void* unused, int64_t* fileSizeOut);
|
||||
#if not defined DEDICATED && defined (GAMEDLL_S3)
|
||||
static void CreateDXTexture(RTechTextureInfo_t* textureHeader, int64_t cpuArg);
|
||||
#endif
|
||||
|
||||
#ifndef DEDICATED
|
||||
#if not defined DEDICATED
|
||||
static void CreateDXTexture(RTechTextureInfo_t* textureHeader, int64_t cpuArg);
|
||||
void** LoadShaderSet(void** VTablePtr);
|
||||
#endif
|
||||
#endif // !DEDICATED
|
||||
};
|
||||
|
||||
void RTech_Utils_Attach();
|
||||
@ -502,29 +491,43 @@ class VPakFile : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
#if not defined DEDICATED && defined (GAMEDLL_S3)
|
||||
spdlog::debug("| FUN: GetStreamOverlay : {:#18x} |\n", p_GetStreamOverlay.GetPtr());
|
||||
#if not defined DEDICATED
|
||||
spdlog::debug("| FUN: RTech::CreateDXTexture : {:#18x} |\n", p_RTech_CreateDXTexture.GetPtr());
|
||||
#endif
|
||||
#endif // !DEDICATED
|
||||
spdlog::debug("| FUN: RTech::FindFreeSlotInFiles : {:#18x} |\n", p_RTech_FindFreeSlotInFiles.GetPtr());
|
||||
spdlog::debug("| FUN: RTech::OpenFile : {:#18x} |\n", p_RTech_OpenFile.GetPtr());
|
||||
#if not defined DEDICATED
|
||||
spdlog::debug("| FUN: GetStreamOverlay : {:#18x} |\n", p_GetStreamOverlay.GetPtr());
|
||||
#endif // !DEDICATED
|
||||
spdlog::debug("| FUN: StreamDB_Init : {:#18x} |\n", p_StreamDB_Init.GetPtr());
|
||||
spdlog::debug("| VAR: g_pLoadedPakInfo : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pLoadedPakInfo));
|
||||
spdlog::debug("| VAR: s_pLoadedPakCount : {:#18x} |\n", reinterpret_cast<uintptr_t>(s_pLoadedPakCount));
|
||||
spdlog::debug("| VAR: s_pParsedPakCount : {:#18x} |\n", reinterpret_cast<uintptr_t>(s_pParsedPakCount));
|
||||
spdlog::debug("| VAR: s_pFileArray : {:#18x} |\n", reinterpret_cast<uintptr_t>(s_pFileArray));
|
||||
spdlog::debug("| VAR: g_pPakFileSlotLock : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pPakFileSlotLock));
|
||||
spdlog::debug("| VAR: m_FileHandles : {:#18x} |\n", reinterpret_cast<uintptr_t>(m_FileHandles));
|
||||
spdlog::debug("| VAR: g_pUnknownPakStruct : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pUnknownPakStruct));
|
||||
spdlog::debug("| VAR: g_pPakFifoLock : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pPakFifoLock));
|
||||
spdlog::debug("| VAR: g_pPakFifoLockWrapper : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pPakFifoLockWrapper));
|
||||
spdlog::debug("| VAR: g_bPakFifoLockAcquired : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_bPakFifoLockAcquired));
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
#if not defined DEDICATED && defined (GAMEDLL_S3)
|
||||
#if not defined DEDICATED
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
p_RTech_CreateDXTexture = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x89\x48\x08\x53\x55\x41\x55"), "xxxxxxxxxxx");
|
||||
RTech_CreateDXTexture = p_RTech_CreateDXTexture.RCast<void(*)(RTechTextureInfo_t*, int64_t)>(); /*48 8B C4 48 89 48 08 53 55 41 55*/
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
p_RTech_CreateDXTexture = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\x4C\x8B\xC7\x48\x8B\xD5\x48\x8B\xCB\x48\x83\xC4\x60"), "x????xxxxxxxxxxxxx").FollowNearCallSelf();
|
||||
RTech_CreateDXTexture = p_RTech_CreateDXTexture.RCast<void(*)(RTechTextureInfo_t*, int64_t)>(); /*E8 ? ? ? ? 4C 8B C7 48 8B D5 48 8B CB 48 83 C4 60*/
|
||||
#endif
|
||||
p_GetStreamOverlay = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\x80\x7C\x24\x00\x00\x0F\x84\x00\x00\x00\x00\x48\x89\x9C\x24\x00\x00\x00\x00"), "x????xxx??xx????xxxx????").FollowNearCallSelf();
|
||||
GetStreamOverlay = p_GetStreamOverlay.RCast<void(*)(const char*, char*, size_t)>(); /*E8 ? ? ? ? 80 7C 24 ? ? 0F 84 ? ? ? ? 48 89 9C 24 ? ? ? ?*/
|
||||
#endif // !DEDICATED
|
||||
p_StreamDB_Init = g_GameDll.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");
|
||||
v_StreamDB_Init = p_StreamDB_Init.RCast<void (*)(const char*)>(); /*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*/
|
||||
|
||||
p_RTech_CreateDXTexture = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\x4C\x8B\xC7\x48\x8B\xD5\x48\x8B\xCB\x48\x83\xC4\x60"), "x????xxxxxxxxxxxxx").FollowNearCallSelf();
|
||||
RTech_CreateDXTexture = p_RTech_CreateDXTexture.RCast<void(*)(RPakTextureHeader_t*, int64_t)>(); /*E8 ? ? ? ? 4C 8B C7 48 8B D5 48 8B CB 48 83 C4 60*/
|
||||
#endif
|
||||
p_RTech_FindFreeSlotInFiles = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x44\x8B\x51\x0C\x4C\x8B\xC1"), "xxxxxxx");
|
||||
RTech_FindFreeSlotInFiles = p_RTech_FindFreeSlotInFiles.RCast<int32_t(*)(int32_t*)>(); /*44 8B 51 0C 4C 8B C1*/
|
||||
|
||||
@ -533,17 +536,19 @@ class VPakFile : public IDetour
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
CMemory RTech_UnloadPak = g_GameDll.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");
|
||||
g_pLoadedPakInfo = RTech_UnloadPak.FindPattern("48 8D 05", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<RPakLoadedInfo_t*>();
|
||||
s_pLoadedPakCount = RTech_UnloadPak.FindPattern("66 89", CMemory::Direction::DOWN, 450).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int16_t*>();
|
||||
g_pLoadedPakInfo = p_CPakFile_UnloadPak.FindPattern("48 8D 05", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<RPakLoadedInfo_t*>();
|
||||
s_pLoadedPakCount = p_CPakFile_UnloadPak.FindPattern("66 89", CMemory::Direction::DOWN, 450).ResolveRelativeAddressSelf(0x3, 0x7).RCast<int16_t*>();
|
||||
s_pParsedPakCount = &*s_pLoadedPakCount - 1; // '-1' shifts it back with sizeof(int16_t).
|
||||
|
||||
/*48 8D 0D ? ? ? ? E8 ? ? ? ? 48 8D 0D ? ? ? ? 8B D8 FF 15 ? ? ? ? 4C 8D 25 ? ? ? ?*/
|
||||
CMemory Offset_StreamDB_Init = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8D\x0D\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x8D\x0D\x00\x00\x00\x00\x8B\xD8\xFF\x15\x00\x00\x00\x00\x4C\x8D\x25\x00\x00\x00\x00"), "xxx????x????xxx????xxxx????xxx????");
|
||||
s_pFileArray = Offset_StreamDB_Init.ResolveRelativeAddress(0x3, 0x7).RCast<int32_t*>();
|
||||
g_pPakFileSlotLock = Offset_StreamDB_Init.Offset(-0xD).ResolveRelativeAddress(0x3, 0x7).RCast<PSRWLOCK*>();
|
||||
m_FileHandles = Offset_StreamDB_Init.Offset(0x1B).ResolveRelativeAddress(0x3, 0x7).RCast<pFileHandleTracker_t*>();
|
||||
g_pPakFileSlotLock = p_StreamDB_Init.Offset(0x70).FindPatternSelf("48 8D 0D", CMemory::Direction::DOWN, 512, 1).ResolveRelativeAddress(0x3, 0x7).RCast<PSRWLOCK*>();
|
||||
s_pFileArray = p_StreamDB_Init.Offset(0x70).FindPatternSelf("48 8D 0D", CMemory::Direction::DOWN, 512, 2).ResolveRelativeAddress(0x3, 0x7).RCast<int32_t*>();
|
||||
m_FileHandles = p_StreamDB_Init.Offset(0x70).FindPatternSelf("4C 8D", CMemory::Direction::DOWN, 512, 1).ResolveRelativeAddress(0x3, 0x7).RCast<pFileHandleTracker_t*>();
|
||||
|
||||
g_pUnknownPakStruct = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8D\x1D\x00\x00\x00\x00\x45\x8D\x5A\x0E"), "xxx????xxxx").ResolveRelativeAddressSelf(0x3, 0x7).RCast<RPakUnknownStruct_t*>(); /*48 8D 1D ? ? ? ? 45 8D 5A 0E*/
|
||||
|
||||
g_pPakFifoLock = p_JT_HelpWithAnything.Offset(0x155).FindPatternSelf("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<JobFifoLock_s*>();
|
||||
g_pPakFifoLockWrapper = p_JT_HelpWithAnything.Offset(0x1BC).FindPatternSelf("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void*>();
|
||||
g_bPakFifoLockAcquired = p_JT_HelpWithAnything.Offset(0x50).FindPatternSelf("C6 05").ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
|
||||
}
|
||||
virtual void GetCon(void) const { }
|
||||
virtual void Attach(void) const { }
|
||||
|
@ -115,9 +115,9 @@ SQRESULT Script_InitializeCLGlobalStructs(CSquirrelVM* pSquirrelVM, SQCONTEXT co
|
||||
{
|
||||
SQRESULT results = v_Script_InitializeCLGlobalStructs(pSquirrelVM, context);
|
||||
if (context == SQCONTEXT::CLIENT)
|
||||
Script_RegisterClientFunctions(g_pClientVM.GetValue<CSquirrelVM*>());
|
||||
Script_RegisterClientFunctions(g_pClientScript.GetValue<CSquirrelVM*>());
|
||||
if (context == SQCONTEXT::UI)
|
||||
Script_RegisterUIFunctions(g_pUIVM.GetValue<CSquirrelVM*>());
|
||||
Script_RegisterUIFunctions(g_pUIScript.GetValue<CSquirrelVM*>());
|
||||
return results;
|
||||
}
|
||||
#endif // !DEDICATED
|
||||
@ -130,7 +130,7 @@ SQRESULT Script_InitializeCLGlobalStructs(CSquirrelVM* pSquirrelVM, SQCONTEXT co
|
||||
void Script_InitializeSVGlobalStructs(CSquirrelVM* pSquirrelVM)
|
||||
{
|
||||
v_Script_InitializeSVGlobalStructs(pSquirrelVM);
|
||||
Script_RegisterServerFunctions(g_pServerVM.GetValue<CSquirrelVM*>());
|
||||
Script_RegisterServerFunctions(g_pServerScript.GetValue<CSquirrelVM*>());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
@ -141,7 +141,7 @@ SQBool Script_CreateServerVM()
|
||||
{
|
||||
SQBool results = v_Script_CreateServerVM();
|
||||
if (results)
|
||||
DevMsg(eDLL_T::SERVER, "Created SERVER VM: '%p'\n", g_pServerVM.GetValue<CSquirrelVM*>());
|
||||
DevMsg(eDLL_T::SERVER, "Created SERVER VM: '%p'\n", g_pServerScript.GetValue<CSquirrelVM*>());
|
||||
else
|
||||
Error(eDLL_T::SERVER, "Failed to create SERVER VM\n");
|
||||
return results;
|
||||
@ -158,7 +158,7 @@ SQBool Script_CreateClientVM(CHLClient* hlclient)
|
||||
{
|
||||
SQBool results = v_Script_CreateClientVM(hlclient);
|
||||
if (results)
|
||||
DevMsg(eDLL_T::CLIENT, "Created CLIENT VM: '%p'\n", g_pClientVM.GetValue<CSquirrelVM*>());
|
||||
DevMsg(eDLL_T::CLIENT, "Created CLIENT VM: '%p'\n", g_pClientScript.GetValue<CSquirrelVM*>());
|
||||
else
|
||||
Error(eDLL_T::CLIENT, "Failed to create CLIENT VM\n");
|
||||
return results;
|
||||
@ -172,7 +172,7 @@ SQBool Script_CreateUIVM()
|
||||
{
|
||||
SQBool results = v_Script_CreateUIVM();
|
||||
if (results)
|
||||
DevMsg(eDLL_T::UI, "Created UI VM: '%p'\n", g_pUIVM.GetValue<CSquirrelVM*>());
|
||||
DevMsg(eDLL_T::UI, "Created UI VM: '%p'\n", g_pUIScript.GetValue<CSquirrelVM*>());
|
||||
else
|
||||
Error(eDLL_T::UI, "Failed to create UI VM\n");
|
||||
return results;
|
||||
@ -190,13 +190,13 @@ CSquirrelVM* Script_GetContextObject(SQCONTEXT context)
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
case SQCONTEXT::SERVER:
|
||||
return g_pServerVM.GetValue<CSquirrelVM*>();
|
||||
return g_pServerScript.GetValue<CSquirrelVM*>();
|
||||
#endif // !CLIENT_DLL
|
||||
#ifndef DEDICATED
|
||||
case SQCONTEXT::CLIENT:
|
||||
return g_pClientVM.GetValue<CSquirrelVM*>();
|
||||
return g_pClientScript.GetValue<CSquirrelVM*>();
|
||||
case SQCONTEXT::UI:
|
||||
return g_pUIVM.GetValue<CSquirrelVM*>();
|
||||
return g_pUIScript.GetValue<CSquirrelVM*>();
|
||||
#endif // !DEDICATED
|
||||
default:
|
||||
return nullptr;
|
||||
|
@ -93,11 +93,11 @@ inline CMemory p_Script_LoadScript;
|
||||
inline auto v_Script_LoadScript = p_Script_LoadScript.RCast<SQBool(*)(HSQUIRRELVM v, const SQChar* szScriptPath, const SQChar* szScriptName, SQInteger nFlag)>();
|
||||
|
||||
#if !defined (CLIENT_DLL)
|
||||
inline CMemory g_pServerVM;
|
||||
inline CMemory g_pServerScript;
|
||||
#endif // !CLIENT_DLL
|
||||
#if !defined (DEDICATED)
|
||||
inline CMemory g_pClientVM;
|
||||
inline CMemory g_pUIVM;
|
||||
inline CMemory g_pClientScript;
|
||||
inline CMemory g_pUIScript;
|
||||
#endif // !DEDICATED
|
||||
|
||||
SQRESULT Script_RegisterFunction(CSquirrelVM* pSquirrelVM, const SQChar* szScriptName, const SQChar* szNativeName,
|
||||
@ -145,11 +145,11 @@ class VSquirrelVM : public IDetour
|
||||
spdlog::debug("| FUN: Script_LoadRson : {:#18x} |\n", p_Script_LoadRson.GetPtr());
|
||||
spdlog::debug("| FUN: Script_LoadScript : {:#18x} |\n", p_Script_LoadScript.GetPtr());
|
||||
#ifndef CLIENT_DLL
|
||||
spdlog::debug("| VAR: g_pServerVM : {:#18x} |\n", g_pServerVM.GetPtr());
|
||||
spdlog::debug("| VAR: g_pServerScript : {:#18x} |\n", g_pServerScript.GetPtr());
|
||||
#endif // !CLIENT_DLL
|
||||
#ifndef DEDICATED
|
||||
spdlog::debug("| VAR: g_pClientVM : {:#18x} |\n", g_pClientVM.GetPtr());
|
||||
spdlog::debug("| VAR: g_pUIVM : {:#18x} |\n", g_pUIVM.GetPtr());
|
||||
spdlog::debug("| VAR: g_pClientScript : {:#18x} |\n", g_pClientScript.GetPtr());
|
||||
spdlog::debug("| VAR: g_pUIScript : {:#18x} |\n", g_pUIScript.GetPtr());
|
||||
#endif // !DEDICATED
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
@ -201,11 +201,11 @@ class VSquirrelVM : public IDetour
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
#if !defined (CLIENT_DLL)
|
||||
g_pServerVM = p_Script_CreateServerVM.FindPatternSelf("48 89 1D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7);
|
||||
g_pServerScript = p_Script_CreateServerVM.FindPatternSelf("48 89 1D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7);
|
||||
#endif // !CLIENT_DLL
|
||||
#if !defined (DEDICATED)
|
||||
g_pClientVM = p_Script_CreateClientVM.FindPatternSelf("48 83 3D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x8);
|
||||
g_pUIVM = p_Script_CreateUIVM.FindPatternSelf("48 8B 1D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7);
|
||||
g_pClientScript = p_Script_CreateClientVM.FindPatternSelf("48 83 3D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x8);
|
||||
g_pUIScript = p_Script_CreateUIVM.FindPatternSelf("48 8B 1D", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7);
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
virtual void GetCon(void) const { }
|
||||
|
@ -113,7 +113,9 @@ void ConVar::Init(void) const
|
||||
sv_rcon_whitelist_address = ConVar::Create("sv_rcon_whitelist_address", "", FCVAR_RELEASE, "This address is not considered a 'redundant' socket and will never be banned for failed authentications.", false, 0.f, false, 0.f, nullptr, "Format: '::ffff:127.0.0.1'.");
|
||||
#endif // DEDICATED
|
||||
#endif // !CLIENT_DLL
|
||||
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
|
||||
bhit_abs_origin = ConVar::Create("bhit_abs_origin", "0", FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED, "Use player's absolute origin for bhit tracing.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
#endif // !GAMEDLL_S0 && !GAMEDLL_S1
|
||||
//-------------------------------------------------------------------------
|
||||
// CLIENT |
|
||||
#ifndef DEDICATED
|
||||
@ -215,7 +217,9 @@ void ConVar::InitShipped(void) const
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
ai_script_nodes_draw = g_pCVar->FindVar("ai_script_nodes_draw");
|
||||
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
|
||||
bhit_enable = g_pCVar->FindVar("bhit_enable");
|
||||
#endif // !GAMEDLL_S0 && !GAMEDLL_S1
|
||||
#endif // !CLIENT_DLL
|
||||
#ifndef DEDICATED
|
||||
cl_threaded_bone_setup = g_pCVar->FindVar("cl_threaded_bone_setup");
|
||||
|
@ -321,7 +321,9 @@ void ConCommand::Init(void)
|
||||
{
|
||||
//-------------------------------------------------------------------------
|
||||
// ENGINE DLL |
|
||||
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
|
||||
ConCommand::Create("bhit", "Bullet-hit trajectory debug.", FCVAR_DEVELOPMENTONLY | FCVAR_GAMEDLL, BHit_f, nullptr);
|
||||
#endif // !GAMEDLL_S0 && !GAMEDLL_S1
|
||||
#ifndef DEDICATED
|
||||
ConCommand::Create("line", "Draw a debug line.", FCVAR_GAMEDLL | FCVAR_CHEAT, Line_f, nullptr);
|
||||
ConCommand::Create("sphere", "Draw a debug sphere.", FCVAR_GAMEDLL | FCVAR_CHEAT, Sphere_f, nullptr);
|
||||
|
@ -78,8 +78,10 @@ ConVar* sv_rcon_whitelist_address = nullptr;
|
||||
#endif // !CLIENT_DLL
|
||||
|
||||
ConVar* sv_visualizetraces = nullptr;
|
||||
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
|
||||
ConVar* bhit_enable = nullptr;
|
||||
ConVar* bhit_abs_origin = nullptr;
|
||||
#endif // !GAMEDLL_S0 && !GAMEDLL_S1
|
||||
//-----------------------------------------------------------------------------
|
||||
// CLIENT |
|
||||
#ifndef DEDICATED
|
||||
|
@ -73,8 +73,10 @@ extern ConVar* sv_rcon_whitelist_address;
|
||||
#endif // DEDICATED
|
||||
#endif // CLIENT_DLL
|
||||
extern ConVar* sv_visualizetraces;
|
||||
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
|
||||
extern ConVar* bhit_enable;
|
||||
extern ConVar* bhit_abs_origin;
|
||||
#endif // !GAMEDLL_S0 && !GAMEDLL_S1
|
||||
//-------------------------------------------------------------------------
|
||||
// CLIENT |
|
||||
#ifndef DEDICATED
|
||||
@ -286,34 +288,15 @@ private:
|
||||
extern CCvar* g_pCVar;
|
||||
|
||||
/* ==== CCVAR =========================================================================================================================================================== */
|
||||
inline CMemory p_CCvar_Disconnect;
|
||||
inline auto CCvar_Disconnect = p_CCvar_Disconnect.RCast<void* (*)(void)>();
|
||||
|
||||
inline CMemory p_CCvar_GetCommandLineValue;
|
||||
inline auto CCvar_GetCommandLineValue = p_CCvar_GetCommandLineValue.RCast<const char* (*)(CCvar* thisptr, const char* pVariableName)>();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class VCVar : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| FUN: CCvar::Disconnect : {:#18x} |\n", p_CCvar_Disconnect.GetPtr());
|
||||
spdlog::debug("| FUN: CCvar::GetCommandLineValue : {:#18x} |\n", p_CCvar_GetCommandLineValue.GetPtr());
|
||||
spdlog::debug("| VAR: g_pCVar : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pCVar));
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
p_CCvar_Disconnect = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x57\x41\x56\x48\x83\xEC\x38\x4C\x8B\x35"), "xxxxxxxxxxx");
|
||||
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)
|
||||
p_CCvar_Disconnect = g_GameDll.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");
|
||||
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
|
||||
p_CCvar_GetCommandLineValue = g_GameDll.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????");
|
||||
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 ? ? ? ?*/
|
||||
}
|
||||
virtual void GetFun(void) const { }
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
g_pCVar = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>(
|
||||
|
@ -154,7 +154,7 @@ void CLogSystem::DrawSimStats(void) const
|
||||
g_pClientState->GetTick(), *render_tickcount);
|
||||
#else
|
||||
snprintf((char*)szLogbuf, 4096, "Server Frame: (%d) Client Frame: (%d) Render Frame: (%d)\n",
|
||||
g_pServer->GetTick(), g_pClientState->GetTick(), *render_tickcount);
|
||||
g_pServer->GetTick(), g_pClientState->GetTick(), *g_nRenderTickCount);
|
||||
#endif
|
||||
|
||||
if (cl_simstats_invert_rect_x->GetBool())
|
||||
@ -180,7 +180,7 @@ void CLogSystem::DrawGPUStats(void) const
|
||||
static Color c = { 255, 255, 255, 255 };
|
||||
static const char* szLogbuf[4096]{};
|
||||
snprintf((char*)szLogbuf, 4096, "%8d/%8d/%8dkiB unusable/unfree/total GPU Streaming Texture memory\n",
|
||||
*unusable_streaming_tex_memory / 1024, *unfree_streaming_tex_memory / 1024, *unusable_streaming_tex_memory / 1024);
|
||||
*g_nUnusableStreamingTextureMemory / 1024, *g_nUnfreeStreamingTextureMemory / 1024, *g_nUnusableStreamingTextureMemory / 1024);
|
||||
|
||||
if (cl_gpustats_invert_rect_x->GetBool())
|
||||
{
|
||||
|
@ -1,21 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
/* ==== IAPPSYSTEM ============================================================================================================================================== */
|
||||
inline CMemory p_IAppSystem_LoadLibrary; // C initializers/terminators
|
||||
inline auto IAppSystem_LoadLibrary = p_IAppSystem_LoadLibrary.RCast<void* (*)(void)>();
|
||||
//inline CMemory p_IAppSystem_LoadLibrary; // C initializers/terminators
|
||||
//inline auto IAppSystem_LoadLibrary = p_IAppSystem_LoadLibrary.RCast<void* (*)(void)>();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class VAppSystem : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| FUN: IAppSystem::LoadLibrary : {:#18x} |\n", p_IAppSystem_LoadLibrary.GetPtr());
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
//spdlog::debug("| FUN: IAppSystem::LoadLibrary : {:#18x} |\n", p_IAppSystem_LoadLibrary.GetPtr());
|
||||
//spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
p_IAppSystem_LoadLibrary = g_GameDll.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");
|
||||
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*/
|
||||
//p_IAppSystem_LoadLibrary = g_GameDll.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");
|
||||
//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*/
|
||||
}
|
||||
virtual void GetVar(void) const { }
|
||||
virtual void GetCon(void) const { }
|
||||
|
@ -14,9 +14,6 @@ class KeyValues;
|
||||
class CFileSystem_Stdio;
|
||||
|
||||
/* ==== KEYVALUES ======================================================================================================================================================= */
|
||||
inline CMemory p_KeyValues_Init;
|
||||
inline auto KeyValues_Init = p_KeyValues_Init.RCast<void* (*)(KeyValues* thisptr, const char* pSymbol, int64_t a3, bool bCreate)>();
|
||||
|
||||
inline CMemory p_KeyValues_FindKey;
|
||||
inline auto KeyValues_FindKey = p_KeyValues_FindKey.RCast<void* (*)(KeyValues* thisptr, const char* pkeyName, bool bCreate)>();
|
||||
|
||||
@ -179,7 +176,6 @@ class VKeyValues : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| FUN: KeyValues::Init : {:#18x} |\n", p_KeyValues_Init.GetPtr());
|
||||
spdlog::debug("| FUN: KeyValues::FindKey : {:#18x} |\n", p_KeyValues_FindKey.GetPtr());
|
||||
spdlog::debug("| FUN: KeyValues::LoadPlaylists : {:#18x} |\n", p_KeyValues_LoadPlaylists.GetPtr());
|
||||
spdlog::debug("| FUN: KeyValues::ParsePlaylists : {:#18x} |\n", p_KeyValues_ParsePlaylists.GetPtr());
|
||||
@ -191,12 +187,10 @@ class VKeyValues : public IDetour
|
||||
virtual void GetFun(void) const
|
||||
{
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
p_KeyValues_Init = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\xC7\x44\x24\x30\xFF\xFF\xFF"), "xxxxxxxxxxxxxxxx");
|
||||
p_KeyValues_FindKey = g_GameDll.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");
|
||||
p_KeyValues_GetCurrentPlaylist = g_GameDll.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????");
|
||||
p_KeyValues_ReadKeyValuesFile = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x55\x56\x57\x41\x54\x41\x57\x48\x8D\x6C\x24\x00"), "xxxx?xxxxxxxxxxx?");
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
p_KeyValues_Init = g_GameDll.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");
|
||||
p_KeyValues_FindKey = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x56\x57\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x45"), "xxxxxxxx????x");
|
||||
p_KeyValues_GetCurrentPlaylist = g_GameDll.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");
|
||||
p_KeyValues_ReadKeyValuesFile = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x55\x53\x57\x41\x54\x48\x8D\x68\xA1"), "xxxxxxxxxxxx");
|
||||
@ -204,7 +198,6 @@ class VKeyValues : public IDetour
|
||||
p_KeyValues_LoadPlaylists = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x56\x57\x41\x56\x48\x83\xEC\x40\x48\x8B\xF1"), "xxxx?xxxx?xxxxxxxxxxx");
|
||||
p_KeyValues_ParsePlaylists = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\xE8\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x74\x0C"), "x????xx?????xx").FollowNearCallSelf();
|
||||
|
||||
KeyValues_Init = p_KeyValues_Init.RCast<void* (*)(KeyValues*, const char*, int64_t, bool)>(); /*40 53 48 83 EC 20 48 8B 05 ?? ?? ?? 01 48 8B D9 4C 8B C2*/
|
||||
KeyValues_FindKey = p_KeyValues_FindKey.RCast<void* (*)(KeyValues*, const char*, bool)>(); /*40 56 57 41 57 48 81 EC 30 01 00 00 45 0F B6 F8*/
|
||||
KeyValues_LoadPlaylists = p_KeyValues_ParsePlaylists.RCast<bool (*)(const char*)>(); /*48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 56 48 83 EC 40 48 8B F1*/
|
||||
KeyValues_ParsePlaylists = p_KeyValues_ParsePlaylists.RCast<bool (*)(const char*)>(); /*E8 ?? ?? ?? ?? 80 3D ?? ?? ?? ?? ?? 74 0C*/
|
||||
|
@ -1000,7 +1000,7 @@ void Capsule_f(const CCommand& args)
|
||||
g_pDebugOverlay->AddCapsuleOverlay(start, end, radius, { 0,0,0 }, { 0,0,0 }, 141, 233, 135, 0, 100);
|
||||
}
|
||||
#endif // !DEDICATED
|
||||
|
||||
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
|
||||
/*
|
||||
=====================
|
||||
BHit_f
|
||||
@ -1053,7 +1053,7 @@ void BHit_f(const CCommand& args)
|
||||
}
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
|
||||
#endif // !GAMEDLL_S0 && !GAMEDLL_S1
|
||||
/*
|
||||
=====================
|
||||
CVHelp_f
|
||||
|
@ -52,7 +52,9 @@ void Line_f(const CCommand& args);
|
||||
void Sphere_f(const CCommand& args);
|
||||
void Capsule_f(const CCommand& args);
|
||||
#endif // !DEDICATED
|
||||
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
|
||||
void BHit_f(const CCommand& args);
|
||||
#endif // !GAMEDLL_S0 && !GAMEDLL_S1
|
||||
|
||||
void CVHelp_f(const CCommand& args);
|
||||
void CVList_f(const CCommand& args);
|
||||
|
Loading…
x
Reference in New Issue
Block a user