mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Un-hardcode all CHostState dependencies
The SDK now works on executables with ASLR enabled. !TODO: Dedicated.
This commit is contained in:
parent
db141d5edb
commit
e1f5e7d46b
@ -58,6 +58,7 @@
|
|||||||
#endif // !CLIENT_DLL
|
#endif // !CLIENT_DLL
|
||||||
#include "engine/common.h"
|
#include "engine/common.h"
|
||||||
#include "engine/cmodel_bsp.h"
|
#include "engine/cmodel_bsp.h"
|
||||||
|
#include "engine/host.h"
|
||||||
#include "engine/host_cmd.h"
|
#include "engine/host_cmd.h"
|
||||||
#include "engine/host_state.h"
|
#include "engine/host_state.h"
|
||||||
#include "engine/modelloader.h"
|
#include "engine/modelloader.h"
|
||||||
@ -107,12 +108,18 @@
|
|||||||
void Systems_Init()
|
void Systems_Init()
|
||||||
{
|
{
|
||||||
CheckCPU();
|
CheckCPU();
|
||||||
|
CFastTimer masterTimer;
|
||||||
|
|
||||||
|
masterTimer.Start();
|
||||||
for (IDetour* pdetour : vDetour)
|
for (IDetour* pdetour : vDetour)
|
||||||
{
|
{
|
||||||
pdetour->GetFun();
|
pdetour->GetFun();
|
||||||
pdetour->GetVar();
|
pdetour->GetVar();
|
||||||
pdetour->GetCon();
|
pdetour->GetCon();
|
||||||
}
|
}
|
||||||
|
masterTimer.End();
|
||||||
|
|
||||||
|
//printf("DLL initialization took %f seconds\n", masterTimer.GetDuration().GetSeconds());
|
||||||
|
|
||||||
// Initialize WinSock system.
|
// Initialize WinSock system.
|
||||||
WS_Init();
|
WS_Init();
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <WinSock2.h>
|
#include <WinSock2.h>
|
||||||
#include <comdef.h>
|
#include <comdef.h>
|
||||||
|
#include <setjmp.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <Psapi.h>
|
#include <Psapi.h>
|
||||||
|
@ -3,19 +3,28 @@
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// RUNTIME: CL_CLEARSTATE
|
// RUNTIME: CL_CLEARSTATE
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
#if defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||||
inline CMemory CL_ClearState = 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\x48\x8B\x0D\x00\x00\x00\x00\x48\x8B\x01"), "xxxx?xxxx?xxxx????xxx????xxx");
|
inline CMemory p_CL_ClearState = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x1D\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxx????xxx????");
|
||||||
#endif // 0x1402BE4C0 // 48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 48 8B 0D ? ? ? ? 48 8B 01 //
|
inline auto CL_ClearState = p_CL_ClearState.RCast<int(*)(void)>(); /*48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 48 8B 1D ? ? ? ?*/
|
||||||
|
|
||||||
|
inline CMemory p_CL_EndMovie = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x83\xEC\x68\x80\x3D\x00\x00\x00\x00\x00"), "xxxxxxxxx?????");
|
||||||
|
inline auto CL_EndMovie = p_CL_EndMovie.RCast<int(*)(void)>(); /*48 8B C4 48 83 EC 68 80 3D ? ? ? ? ?*/
|
||||||
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||||
|
inline CMemory p_CL_ClearState = 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\x48\x8B\x0D\x00\x00\x00\x00\x48\x8B\x01"), "xxxx?xxxx?xxxx????xxx????xxx");
|
||||||
|
inline auto CL_ClearState = p_CL_ClearState.RCast<int(*)(void)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 48 8B 0D ? ? ? ? 48 8B 01*/
|
||||||
|
|
||||||
|
inline CMemory p_CL_EndMovie = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x80\x3D\x00\x00\x00\x00\x00\x74\x7B"), "xxxxxx?????xx");
|
||||||
|
inline auto CL_EndMovie = p_CL_EndMovie.RCast<int(*)(void)>(); /*48 83 EC 28 80 3D ? ? ? ? ? 74 7B*/
|
||||||
|
#endif
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class HCL_Main : public IDetour
|
class HCL_Main : public IDetour
|
||||||
{
|
{
|
||||||
virtual void GetAdr(void) const
|
virtual void GetAdr(void) const
|
||||||
{
|
{
|
||||||
#if defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
std::cout << "| FUN: CL_EndMovie : 0x" << std::hex << std::uppercase << p_CL_EndMovie.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "| FUN: CL_ClearState : 0x" << std::hex << std::uppercase << CL_ClearState.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: CL_ClearState : 0x" << std::hex << std::uppercase << p_CL_ClearState.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||||
#endif // GAMEDLL_S2 || GAMEDLL_S3
|
|
||||||
}
|
}
|
||||||
virtual void GetFun(void) const { }
|
virtual void GetFun(void) const { }
|
||||||
virtual void GetVar(void) const { }
|
virtual void GetVar(void) const { }
|
||||||
|
34
r5dev/engine/host.h
Normal file
34
r5dev/engine/host.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
inline CMemory p_Host_Error; /*48 89 4C 24 ? 48 89 54 24 ? 4C 89 44 24 ? 4C 89 4C 24 ? 53 57 48 81 EC ? ? ? ?*/
|
||||||
|
inline auto Host_Error = p_Host_Error.RCast<int(*)(char* error, ...)>();
|
||||||
|
|
||||||
|
inline bool* g_bAbortServerSet = nullptr;
|
||||||
|
inline jmp_buf* host_abortserver = nullptr;
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
class HHost : public IDetour
|
||||||
|
{
|
||||||
|
virtual void GetAdr(void) const
|
||||||
|
{
|
||||||
|
std::cout << "| FUN: Host_Error : 0x" << std::hex << std::uppercase << p_Host_Error.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
|
std::cout << "| FUN: g_bAbortServerSet : 0x" << std::hex << std::uppercase << g_bAbortServerSet << std::setw(0) << " |" << std::endl;
|
||||||
|
std::cout << "| FUN: host_abortserver : 0x" << std::hex << std::uppercase << host_abortserver << std::setw(0) << " |" << std::endl;
|
||||||
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||||
|
}
|
||||||
|
virtual void GetFun(void) const
|
||||||
|
{
|
||||||
|
p_Host_Error = 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\x53\x57\x48\x81\xEC\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxx?xxxxx????");
|
||||||
|
}
|
||||||
|
virtual void GetVar(void) const
|
||||||
|
{
|
||||||
|
g_bAbortServerSet = p_Host_Error.FindPattern("40 38 3D", CMemory::Direction::DOWN, 512, 4).ResolveRelativeAddress(3, 7).RCast<bool*>();
|
||||||
|
host_abortserver = p_Host_Error.FindPattern("48 8D 0D", CMemory::Direction::DOWN, 512, 5).ResolveRelativeAddress(3, 7).RCast<jmp_buf*>();
|
||||||
|
}
|
||||||
|
virtual void GetCon(void) const { }
|
||||||
|
virtual void Attach(void) const { }
|
||||||
|
virtual void Detach(void) const { }
|
||||||
|
};
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
REGISTER(HHost);
|
@ -17,12 +17,18 @@ inline auto Host_Init = p_Host_Init.RCast<void* (*)(bool* bDedicated)>(); /*48 8
|
|||||||
|
|
||||||
inline CMemory 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 CMemory 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();
|
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 CMemory p_Host_ChangeLevel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x56\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x49\x8B\xD8"), "xxxxxxxx????xxx");
|
||||||
|
inline auto Host_ChangeLevel = p_Host_ChangeLevel.RCast<bool (*)(bool bLoadFromSavedGame, const char* pszMapName, const char* pszMapGroup)>(); /*40 53 56 41 56 48 81 EC ? ? ? ? 49 8B D8*/
|
||||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||||
inline CMemory 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 CMemory 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 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 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 CMemory 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 CMemory 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*/
|
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*/
|
||||||
|
|
||||||
|
inline CMemory p_Host_ChangeLevel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x56\x57\x41\x56\x48\x81\xEC\x00\x00\x00\x00"), "xxxxxxxx????");
|
||||||
|
inline auto Host_ChangeLevel = p_Host_ChangeLevel.RCast<bool (*)(bool bLoadFromSavedGame, const char* pszMapName, const char* pszMapGroup)>(); /*40 56 57 41 56 48 81 EC ? ? ? ?*/
|
||||||
#endif
|
#endif
|
||||||
inline CMemory 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 CMemory 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 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 ? ? ? ?*/
|
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 ? ? ? ?*/
|
||||||
@ -43,6 +49,7 @@ class HHostCmd : public IDetour
|
|||||||
{
|
{
|
||||||
std::cout << "| FUN: Host_Init : 0x" << std::hex << std::uppercase << p_Host_Init.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: Host_Init : 0x" << std::hex << std::uppercase << p_Host_Init.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "| FUN: Host_NewGame : 0x" << std::hex << std::uppercase << p_Host_NewGame.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: Host_NewGame : 0x" << std::hex << std::uppercase << p_Host_NewGame.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
|
std::cout << "| FUN: Host_ChangeLevel : 0x" << std::hex << std::uppercase << p_Host_ChangeLevel.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "| FUN: malloc_internal : 0x" << std::hex << std::uppercase << p_malloc_internal.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: malloc_internal : 0x" << std::hex << std::uppercase << p_malloc_internal.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "| VAR: g_pEngineParms : 0x" << std::hex << std::uppercase << g_pEngineParmsBuffer.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| VAR: g_pEngineParms : 0x" << std::hex << std::uppercase << g_pEngineParmsBuffer.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "| VAR: g_pMallocPool : 0x" << std::hex << std::uppercase << g_pMallocPool.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| VAR: g_pMallocPool : 0x" << std::hex << std::uppercase << g_pMallocPool.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
|
@ -16,18 +16,23 @@
|
|||||||
#include "engine/sv_rcon.h"
|
#include "engine/sv_rcon.h"
|
||||||
#else //
|
#else //
|
||||||
#include "engine/cl_rcon.h"
|
#include "engine/cl_rcon.h"
|
||||||
|
#include "engine/cl_main.h"
|
||||||
#endif // DEDICATED
|
#endif // DEDICATED
|
||||||
#include "engine/net.h"
|
#include "engine/net.h"
|
||||||
#include "engine/gl_screen.h"
|
#include "engine/gl_screen.h"
|
||||||
|
#include "engine/host.h"
|
||||||
|
#include "engine/host_cmd.h"
|
||||||
#include "engine/host_state.h"
|
#include "engine/host_state.h"
|
||||||
#include "engine/sys_engine.h"
|
#include "engine/sys_engine.h"
|
||||||
#include "engine/sys_utils.h"
|
#include "engine/sys_utils.h"
|
||||||
|
#include "engine/modelloader.h"
|
||||||
#include "engine/cmodel_bsp.h"
|
#include "engine/cmodel_bsp.h"
|
||||||
#ifndef CLIENT_DLL
|
#ifndef CLIENT_DLL
|
||||||
#include "engine/baseserver.h"
|
#include "engine/baseserver.h"
|
||||||
#endif // !CLIENT_DLL
|
#endif // !CLIENT_DLL
|
||||||
#include "rtech/rtech_game.h"
|
#include "rtech/rtech_game.h"
|
||||||
#include "rtech/rtech_utils.h"
|
#include "rtech/rtech_utils.h"
|
||||||
|
#include "rtech/stryder/stryder.h"
|
||||||
#ifndef DEDICATED
|
#ifndef DEDICATED
|
||||||
#include "vgui/vgui_baseui_interface.h"
|
#include "vgui/vgui_baseui_interface.h"
|
||||||
#endif // DEDICATED
|
#endif // DEDICATED
|
||||||
@ -43,7 +48,7 @@ bool g_bLevelResourceInitialized = false;
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: state machine's main processing loop
|
// Purpose: state machine's main processing loop
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
FORCEINLINE void CHostState::FrameUpdate(void* rcx, void* rdx, float time)
|
FORCEINLINE void CHostState::FrameUpdate(CHostState* rcx, void* rdx, float time)
|
||||||
{
|
{
|
||||||
static bool bInitialized = false;
|
static bool bInitialized = false;
|
||||||
static ConVar* single_frame_shutdown_for_reload = g_pCVar->FindVar("single_frame_shutdown_for_reload");
|
static ConVar* single_frame_shutdown_for_reload = g_pCVar->FindVar("single_frame_shutdown_for_reload");
|
||||||
@ -59,16 +64,15 @@ FORCEINLINE void CHostState::FrameUpdate(void* rcx, void* rdx, float time)
|
|||||||
#endif // DEDICATED
|
#endif // DEDICATED
|
||||||
|
|
||||||
HostStates_t oldState{};
|
HostStates_t oldState{};
|
||||||
void* placeHolder = nullptr;
|
if (setjmp(*host_abortserver))
|
||||||
if (setjmpFn(*host_abortserver, placeHolder))
|
|
||||||
{
|
{
|
||||||
CHostState_InitFn(g_pHostState);
|
g_pHostState->Init();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef CLIENT_DLL
|
#ifndef CLIENT_DLL
|
||||||
*g_ServerAbortServer = true;
|
*g_bAbortServerSet = true;
|
||||||
#endif // !CLIENT_DLL
|
#endif // !CLIENT_DLL
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -97,7 +101,7 @@ FORCEINLINE void CHostState::FrameUpdate(void* rcx, void* rdx, float time)
|
|||||||
}
|
}
|
||||||
case HostStates_t::HS_RUN:
|
case HostStates_t::HS_RUN:
|
||||||
{
|
{
|
||||||
State_RunFn(&g_pHostState->m_iCurrentState, nullptr, time);
|
CHostState_State_Run(&g_pHostState->m_iCurrentState, nullptr, time);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HostStates_t::HS_GAME_SHUTDOWN:
|
case HostStates_t::HS_GAME_SHUTDOWN:
|
||||||
@ -105,7 +109,7 @@ FORCEINLINE void CHostState::FrameUpdate(void* rcx, void* rdx, float time)
|
|||||||
DevMsg(eDLL_T::ENGINE, "%s - Shutdown host game\n", "CHostState::FrameUpdate");
|
DevMsg(eDLL_T::ENGINE, "%s - Shutdown host game\n", "CHostState::FrameUpdate");
|
||||||
|
|
||||||
g_bLevelResourceInitialized = false;
|
g_bLevelResourceInitialized = false;
|
||||||
Host_Game_ShutdownFn(g_pHostState);
|
CHostState_GameShutDown(g_pHostState);
|
||||||
g_pHostState->UnloadPakFile();
|
g_pHostState->UnloadPakFile();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -114,9 +118,9 @@ FORCEINLINE void CHostState::FrameUpdate(void* rcx, void* rdx, float time)
|
|||||||
DevMsg(eDLL_T::ENGINE, "%s - Restarting state machine\n", "CHostState::FrameUpdate");
|
DevMsg(eDLL_T::ENGINE, "%s - Restarting state machine\n", "CHostState::FrameUpdate");
|
||||||
g_bLevelResourceInitialized = false;
|
g_bLevelResourceInitialized = false;
|
||||||
#ifndef DEDICATED
|
#ifndef DEDICATED
|
||||||
CL_EndMovieFn();
|
CL_EndMovie();
|
||||||
#endif // !DEDICATED
|
#endif // !DEDICATED
|
||||||
SendOfflineRequestToStryderFn(); // We have hostnames nulled anyway.
|
Stryder_SendOfflineRequest(); // We have hostnames nulled anyway.
|
||||||
g_pEngine->SetNextState(EngineState_t::DLL_RESTART);
|
g_pEngine->SetNextState(EngineState_t::DLL_RESTART);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -125,9 +129,9 @@ FORCEINLINE void CHostState::FrameUpdate(void* rcx, void* rdx, float time)
|
|||||||
DevMsg(eDLL_T::ENGINE, "%s - Shutdown state machine\n", "CHostState::FrameUpdate");
|
DevMsg(eDLL_T::ENGINE, "%s - Shutdown state machine\n", "CHostState::FrameUpdate");
|
||||||
g_bLevelResourceInitialized = false;
|
g_bLevelResourceInitialized = false;
|
||||||
#ifndef DEDICATED
|
#ifndef DEDICATED
|
||||||
CL_EndMovieFn();
|
CL_EndMovie();
|
||||||
#endif // !DEDICATED
|
#endif // !DEDICATED
|
||||||
SendOfflineRequestToStryderFn(); // We have hostnames nulled anyway.
|
Stryder_SendOfflineRequest(); // We have hostnames nulled anyway.
|
||||||
g_pEngine->SetNextState(EngineState_t::DLL_CLOSE);
|
g_pEngine->SetNextState(EngineState_t::DLL_CLOSE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -144,7 +148,37 @@ FORCEINLINE void CHostState::FrameUpdate(void* rcx, void* rdx, float time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: setup state machine
|
// Purpose: state machine initialization
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
FORCEINLINE void CHostState::Init(void)
|
||||||
|
{
|
||||||
|
static ConVar* single_frame_shutdown_for_reload = g_pCVar->FindVar("single_frame_shutdown_for_reload");
|
||||||
|
|
||||||
|
if (m_iNextState != HostStates_t::HS_SHUTDOWN)
|
||||||
|
{
|
||||||
|
if (m_iNextState == HostStates_t::HS_GAME_SHUTDOWN)
|
||||||
|
{
|
||||||
|
CHostState_GameShutDown(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_iCurrentState = HostStates_t::HS_RUN;
|
||||||
|
if (m_iNextState != HostStates_t::HS_SHUTDOWN || !single_frame_shutdown_for_reload->GetInt())
|
||||||
|
m_iNextState = HostStates_t::HS_RUN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_flShortFrameTime = 1.0;
|
||||||
|
m_levelName[0] = 0;
|
||||||
|
m_landMarkName[0] = 0;
|
||||||
|
m_mapGroupName[0] = 0;
|
||||||
|
m_bSplitScreenConnect = 256;
|
||||||
|
m_vecLocation.Init();
|
||||||
|
m_angLocation.Init();
|
||||||
|
m_iCurrentState = HostStates_t::HS_NEW_GAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: state machine setup
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
FORCEINLINE void CHostState::Setup(void) const
|
FORCEINLINE void CHostState::Setup(void) const
|
||||||
{
|
{
|
||||||
@ -305,15 +339,17 @@ FORCEINLINE void CHostState::UnloadPakFile(void)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
FORCEINLINE void CHostState::State_NewGame(void)
|
FORCEINLINE void CHostState::State_NewGame(void)
|
||||||
{
|
{
|
||||||
|
LARGE_INTEGER time{};
|
||||||
|
|
||||||
g_bLevelResourceInitialized = false;
|
g_bLevelResourceInitialized = false;
|
||||||
m_bSplitScreenConnect = false;
|
m_bSplitScreenConnect = false;
|
||||||
if (!g_ServerGameClients) // Init Game if it ain't valid.
|
if (!g_pServerGameClients) // Init Game if it ain't valid.
|
||||||
{
|
{
|
||||||
SV_InitGameDLLFn();
|
SV_InitGameDLL();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CModelLoader_Map_IsValidFn(g_CModelLoader, m_levelName) // Check if map is valid and if we can start a new game.
|
if (!CModelLoader__Map_IsValid(g_pModelLoader, m_levelName) // Check if map is valid and if we can start a new game.
|
||||||
|| !Host_NewGameFn(m_levelName, nullptr, m_bBackgroundLevel, m_bSplitScreenConnect, nullptr) || !g_ServerGameClients)
|
|| !Host_NewGame(m_levelName, nullptr, m_bBackgroundLevel, m_bSplitScreenConnect, time) || !g_pServerGameClients)
|
||||||
{
|
{
|
||||||
Error(eDLL_T::ENGINE, "%s - Error: Map not valid\n", "CHostState::State_NewGame");
|
Error(eDLL_T::ENGINE, "%s - Error: Map not valid\n", "CHostState::State_NewGame");
|
||||||
#ifndef DEDICATED
|
#ifndef DEDICATED
|
||||||
@ -340,9 +376,9 @@ FORCEINLINE void CHostState::State_ChangeLevelSP(void)
|
|||||||
m_flShortFrameTime = 1.5; // Set frame time.
|
m_flShortFrameTime = 1.5; // Set frame time.
|
||||||
g_bLevelResourceInitialized = false;
|
g_bLevelResourceInitialized = false;
|
||||||
|
|
||||||
if (CModelLoader_Map_IsValidFn(g_CModelLoader, m_levelName)) // Check if map is valid and if we can start a new game.
|
if (CModelLoader__Map_IsValid(g_pModelLoader, m_levelName)) // Check if map is valid and if we can start a new game.
|
||||||
{
|
{
|
||||||
Host_ChangelevelFn(true, m_levelName, m_mapGroupName); // Call change level as singleplayer level.
|
Host_ChangeLevel(true, m_levelName, m_mapGroupName); // Call change level as singleplayer level.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -370,13 +406,13 @@ FORCEINLINE void CHostState::State_ChangeLevelMP(void)
|
|||||||
#ifndef CLIENT_DLL
|
#ifndef CLIENT_DLL
|
||||||
g_pServerGameDLL->LevelShutdown();
|
g_pServerGameDLL->LevelShutdown();
|
||||||
#endif // !CLIENT_DLL
|
#endif // !CLIENT_DLL
|
||||||
if (CModelLoader_Map_IsValidFn(g_CModelLoader, m_levelName)) // Check if map is valid and if we can start a new game.
|
if (CModelLoader__Map_IsValid(g_pModelLoader, m_levelName)) // Check if map is valid and if we can start a new game.
|
||||||
{
|
{
|
||||||
#ifndef DEDICATED
|
#ifndef DEDICATED
|
||||||
using EnabledProgressBarForNextLoadFn = void(*)(void*);
|
using EnabledProgressBarForNextLoadFn = void(*)(void*);
|
||||||
(*reinterpret_cast<EnabledProgressBarForNextLoadFn**>(g_pEngineVGui))[31](g_pEngineVGui); // EnabledProgressBarForNextLoad
|
(*reinterpret_cast<EnabledProgressBarForNextLoadFn**>(g_pEngineVGui))[31](g_pEngineVGui); // EnabledProgressBarForNextLoad
|
||||||
#endif // !DEDICATED
|
#endif // !DEDICATED
|
||||||
Host_ChangelevelFn(false, m_levelName, m_mapGroupName); // Call change level as multiplayer level.
|
Host_ChangeLevel(false, m_levelName, m_mapGroupName); // Call change level as multiplayer level.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -404,4 +440,4 @@ void CHostState_Detach()
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
CHostState* g_pHostState = reinterpret_cast<CHostState*>(p_CHostState_FrameUpdate.FindPatternSelf("48 8D ?? ?? ?? ?? 01", CMemory::Direction::DOWN, 100).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr());
|
CHostState* g_pHostState = nullptr;
|
||||||
|
@ -16,9 +16,11 @@ enum class HostStates_t : int
|
|||||||
class CHostState
|
class CHostState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FORCEINLINE static void FrameUpdate(void* rcx, void* rdx, float time);
|
|
||||||
|
FORCEINLINE static void FrameUpdate(CHostState* rcx, void* rdx, float time);
|
||||||
FORCEINLINE void LoadConfig(void) const;
|
FORCEINLINE void LoadConfig(void) const;
|
||||||
|
|
||||||
|
FORCEINLINE void Init(void);
|
||||||
FORCEINLINE void Setup(void) const;
|
FORCEINLINE void Setup(void) const;
|
||||||
FORCEINLINE void Think(void) const;
|
FORCEINLINE void Think(void) const;
|
||||||
|
|
||||||
@ -48,26 +50,14 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* ==== CHOSTSTATE ====================================================================================================================================================== */
|
/* ==== CHOSTSTATE ====================================================================================================================================================== */
|
||||||
inline CMemory 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 CMemory p_CHostState_FrameUpdate = nullptr; /*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*/
|
inline auto CHostState_FrameUpdate = p_CHostState_FrameUpdate.RCast<void(*)(CHostState* rcx, void* rdx, float time)>();
|
||||||
|
|
||||||
namespace // !TEMP
|
inline CMemory p_CHostState_State_Run = nullptr; /*48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 C8 45 33 E4*/
|
||||||
{
|
inline auto CHostState_State_Run = p_CHostState_State_Run.RCast<void(*)(HostStates_t* pState, void* pUnused, float flFrameTime)>();
|
||||||
static auto setjmpFn = CMemory(0x141205460).RCast<std::int64_t(*)(jmp_buf, void*)>();
|
|
||||||
static auto host_abortserver = CMemory(0x14B37C700).RCast<jmp_buf*>();
|
inline CMemory p_CHostState_GameShutDown = nullptr; /*48 89 5C 24 ? 57 48 83 EC 20 48 8B D9 E8 ? ? ? ? 48 8B 0D ? ? ? ?*/
|
||||||
static auto CHostState_InitFn = CMemory(0x14023E7D0).RCast<void(*)(CHostState*)>();
|
inline auto CHostState_GameShutDown = p_CHostState_GameShutDown.RCast<void(*)(CHostState* thisptr)>();
|
||||||
static auto g_ServerAbortServer = CMemory(0x14B37CA22).RCast<char*>();
|
|
||||||
static auto State_RunFn = CMemory(0x14023E870).RCast<void(*)(HostStates_t*, void*, float)>();
|
|
||||||
static auto g_ServerGameClients = CMemory(0x14B383428).RCast<std::int64_t*>();
|
|
||||||
static auto SV_InitGameDLLFn = CMemory(0x140308B90).RCast<void(*)()>();
|
|
||||||
static auto g_CModelLoader = CMemory(0x14173B210).RCast<void*>();
|
|
||||||
static auto CModelLoader_Map_IsValidFn = CMemory(0x1402562F0).RCast<bool(*)(void*, const char*)>();
|
|
||||||
static auto Host_NewGameFn = CMemory(0x140238DA0).RCast<bool(*)(char*, char*, bool, bool, void*)>();
|
|
||||||
static auto Host_Game_ShutdownFn = CMemory(0x14023EDA0).RCast<void(*)(CHostState*)>();
|
|
||||||
static auto Host_ChangelevelFn = CMemory(0x1402387B0).RCast<void(*)(bool, const char*, const char*)>();
|
|
||||||
static auto CL_EndMovieFn = CMemory(0x1402C03D0).RCast<void(*)()>();
|
|
||||||
static auto SendOfflineRequestToStryderFn = CMemory(0x14033D380).RCast<void(*)()>();
|
|
||||||
}
|
|
||||||
|
|
||||||
extern bool g_bLevelResourceInitialized;
|
extern bool g_bLevelResourceInitialized;
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -77,18 +67,37 @@ void CHostState_Detach();
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
extern CHostState* g_pHostState;
|
extern CHostState* g_pHostState;
|
||||||
|
|
||||||
|
//48 8B C4 ?? 41 54 41 ?? 48 81 EC ? ? ? ? F2 0F 10 05 ? ? ? ?, xxx?xxx?xxx????xxxx????
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class HHostState : public IDetour
|
class HHostState : public IDetour
|
||||||
{
|
{
|
||||||
virtual void GetAdr(void) const
|
virtual void GetAdr(void) const
|
||||||
{
|
{
|
||||||
std::cout << "| FUN: CHostState::FrameUpdate : 0x" << std::hex << std::uppercase << p_CHostState_FrameUpdate.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: CHostState::FrameUpdate : 0x" << std::hex << std::uppercase << p_CHostState_FrameUpdate.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "| VAR: g_pHostState : 0x" << std::hex << std::uppercase << g_pHostState << std::setw(0) << " |" << std::endl;
|
std::cout << "| FUN: CHostState::State_Run : 0x" << std::hex << std::uppercase << p_CHostState_State_Run.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
|
std::cout << "| FUN: CHostState::GameShutDown : 0x" << std::hex << std::uppercase << p_CHostState_GameShutDown.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
|
std::cout << "| VAR: g_pHostState : 0x" << std::hex << std::uppercase << g_pHostState << std::setw(0) << " |" << std::endl;
|
||||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||||
}
|
}
|
||||||
virtual void GetFun(void) const { }
|
virtual void GetFun(void) const
|
||||||
virtual void GetVar(void) const { }
|
{
|
||||||
|
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");
|
||||||
|
CHostState_FrameUpdate = p_CHostState_FrameUpdate.RCast<void(*)(CHostState*, void*, float)>();
|
||||||
|
p_CHostState_State_Run = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x48\x89\x58\x10\x48\x89\x70\x18\x48\x89\x78\x20\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xA8\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x0F\x29\x70\xC8\x45\x33\xE4"), "xxxxxxxxxxxxxxxxxxxxxxxxxxx????xxx????xxxxxxx");
|
||||||
|
CHostState_State_Run = p_CHostState_State_Run.RCast<void(*)(HostStates_t*, void*, float)>();
|
||||||
|
|
||||||
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||||
|
p_CHostState_GameShutDown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x56\x48\x83\xEC\x20\x8B\x05\x00\x00\x00\x00\x48\x8B\xF1"), "xxxx?xxxxxxx????xxx");
|
||||||
|
CHostState_GameShutDown = p_CHostState_GameShutDown.RCast<void(*)(CHostState* thisptr)>();
|
||||||
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||||
|
p_CHostState_GameShutDown = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xD9\xE8\x00\x00\x00\x00\x48\x8B\x0D\x00\x00\x00\x00"), "xxxx?xxxxxxxxx????xxx????");
|
||||||
|
CHostState_GameShutDown = p_CHostState_GameShutDown.RCast<void(*)(CHostState* thisptr)>();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
virtual void GetVar(void) const
|
||||||
|
{
|
||||||
|
g_pHostState = p_CHostState_FrameUpdate.FindPatternSelf("48 8D ?? ?? ?? ?? 01", CMemory::Direction::DOWN, 100).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CHostState*>();
|
||||||
|
}
|
||||||
virtual void GetCon(void) const { }
|
virtual void GetCon(void) const { }
|
||||||
virtual void Attach(void) const { }
|
virtual void Attach(void) const { }
|
||||||
virtual void Detach(void) const { }
|
virtual void Detach(void) const { }
|
||||||
|
@ -7,14 +7,17 @@ inline auto CModelLoader__FindModel = p_CModelLoader__FindModel.RCast<void* (*)(
|
|||||||
inline CMemory 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 CMemory 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 auto CModelLoader__LoadModel = p_CModelLoader__LoadModel.RCast<void(*)(void* thisptr, void* mod)>(); /*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 CMemory 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 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*/
|
||||||
|
|
||||||
inline CMemory 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 CMemory 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 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 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 CMemory 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 CMemory 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 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 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 CMemory 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 CMemory p_CModelLoader__Map_IsValid = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x53\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xDA"), "xxxxxxx????xxx");
|
||||||
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*/
|
inline auto CModelLoader__Map_IsValid = p_CModelLoader__Map_IsValid.RCast<bool(*)(void* thisptr, const char* pszMapName)>(); /*48 8B C4 53 48 81 EC ? ? ? ? 48 8B DA*/
|
||||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||||
inline CMemory p_CModelLoader__FindModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x41\x57\x48\x83\xEC\x48\x80\x3A\x2A"), "xxxxxxxxxxx");
|
inline CMemory p_CModelLoader__FindModel = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x55\x41\x57\x48\x83\xEC\x48\x80\x3A\x2A"), "xxxxxxxxxxx");
|
||||||
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 auto CModelLoader__FindModel = p_CModelLoader__FindModel.RCast<void* (*)(void* thisptr, const char* pszModelName)>(); /*40 55 41 57 48 83 EC 48 80 3A 2A*/
|
||||||
@ -22,16 +25,23 @@ inline auto CModelLoader__FindModel = p_CModelLoader__FindModel.RCast<void* (*)(
|
|||||||
inline CMemory 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 CMemory 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 auto CModelLoader__LoadModel = p_CModelLoader__LoadModel.RCast<void(*)(void* thisptr, void* mod)>(); /*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 CMemory 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 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*/
|
||||||
|
|
||||||
inline CMemory 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 CMemory 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 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 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 CMemory 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 CMemory 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 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 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 CMemory 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 CMemory p_CModelLoader__Map_IsValid = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xDA\x48\x85\xD2\x0F\x84\x00\x00\x00\x00\x80\x3A\x00\x0F\x84\x00\x00\x00\x00\x4C\x8B\xCA"), "xxxxx????xxxxxxxx????xxxxx????xxx");
|
||||||
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*/
|
inline auto CModelLoader__Map_IsValid = p_CModelLoader__Map_IsValid.RCast<bool(*)(void* thisptr, const char* pszMapName)>(); /*40 53 48 81 EC ? ? ? ? 48 8B DA 48 85 D2 0F 84 ? ? ? ? 80 3A 00 0F 84 ? ? ? ? 4C 8B CA*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
inline void* g_pModelLoader = g_mGameDll.FindPatternSIMD(
|
||||||
|
reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x00\x53\x55\x56\x41\x54\x41\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00"),
|
||||||
|
"xxxx?xxxxxxxxxxxxxx????").FindPatternSelf("48 8D 0D", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(3, 7);
|
||||||
|
|
||||||
void CModelLoader_Attach();
|
void CModelLoader_Attach();
|
||||||
void CModelLoader_Detach();
|
void CModelLoader_Detach();
|
||||||
|
|
||||||
@ -44,7 +54,9 @@ class HModelLoader : public IDetour
|
|||||||
std::cout << "| FUN: CModelLoader::LoadModel : 0x" << std::hex << std::uppercase << p_CModelLoader__LoadModel.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: CModelLoader::LoadModel : 0x" << std::hex << std::uppercase << p_CModelLoader__LoadModel.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "| FUN: CModelLoader::UnloadModel : 0x" << std::hex << std::uppercase << p_CModelLoader__UnloadModel.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: CModelLoader::UnloadModel : 0x" << std::hex << std::uppercase << p_CModelLoader__UnloadModel.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "| FUN: CModelLoader::Map_LoadModelGuts : 0x" << std::hex << std::uppercase << p_CModelLoader__Map_LoadModelGuts.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: CModelLoader::Map_LoadModelGuts : 0x" << std::hex << std::uppercase << p_CModelLoader__Map_LoadModelGuts.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
|
std::cout << "| FUN: CModelLoader::Map_IsValid : 0x" << std::hex << std::uppercase << p_CModelLoader__Map_IsValid.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "| FUN: CModelLoader::Studio_LoadModel : 0x" << std::hex << std::uppercase << p_CModelLoader__Studio_LoadModel.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: CModelLoader::Studio_LoadModel : 0x" << std::hex << std::uppercase << p_CModelLoader__Studio_LoadModel.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
|
std::cout << "| VAR: g_pModelLoader : 0x" << std::hex << std::uppercase << g_pModelLoader << std::setw(0) << " |" << std::endl;
|
||||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||||
}
|
}
|
||||||
virtual void GetFun(void) const { }
|
virtual void GetFun(void) const { }
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
/* ==== SV_MAIN ======================================================================================================================================================= */
|
/* ==== SV_MAIN ======================================================================================================================================================= */
|
||||||
inline CMemory 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 CMemory 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 auto SV_InitGameDLL = p_SV_InitGameDLL.RCast<void(*)(float a1)>(); /*48 81 EC ? ? ? ? E8 ? ? ? ? 80 3D ? ? ? ? ? 0F 85 ? ? ? ?*/
|
inline auto SV_InitGameDLL = p_SV_InitGameDLL.RCast<void(*)(void)>(); /*48 81 EC ? ? ? ? E8 ? ? ? ? 80 3D ? ? ? ? ? 0F 85 ? ? ? ?*/
|
||||||
|
|
||||||
inline CMemory 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 CMemory 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 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 auto SV_ShutdownGameDLL = p_SV_ShutdownGameDLL.RCast<void(*)(void)>(); /*48 83 EC 28 80 3D ? ? ? ? ? 0F 84 ? ? ? ? 48 8B 0D ? ? ? ? 48 89 5C 24 ?*/
|
||||||
|
@ -57,4 +57,5 @@ float CServerGameDLL::GetTickInterval(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pointer to CServerGameDLL virtual function table.
|
// Pointer to CServerGameDLL virtual function table.
|
||||||
CServerGameDLL* g_pServerGameDLL = reinterpret_cast<CServerGameDLL*>(p_SV_CreateBaseline.Offset(0x0).FindPatternSelf("48 8B", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).Deref().GetPtr());
|
CServerGameDLL* g_pServerGameDLL = nullptr;
|
||||||
|
CServerGameClients* g_pServerGameClients = nullptr;
|
||||||
|
@ -14,19 +14,29 @@ public:
|
|||||||
void GameShutdown(void);
|
void GameShutdown(void);
|
||||||
float GetTickInterval(void);
|
float GetTickInterval(void);
|
||||||
};
|
};
|
||||||
|
class CServerGameClients
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
extern CServerGameDLL* g_pServerGameDLL;
|
extern CServerGameDLL* g_pServerGameDLL;
|
||||||
|
extern CServerGameClients* g_pServerGameClients;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class HServerGameDLL : public IDetour
|
class HServerGameDLL : public IDetour
|
||||||
{
|
{
|
||||||
virtual void GetAdr(void) const
|
virtual void GetAdr(void) const
|
||||||
{
|
{
|
||||||
std::cout << "| VAR: g_pServerGameDLL : 0x" << std::hex << std::uppercase << g_pServerGameDLL << std::setw(0) << " |" << std::endl;
|
std::cout << "| VAR: g_pServerGameDLL : 0x" << std::hex << std::uppercase << g_pServerGameDLL << std::setw(0) << " |" << std::endl;
|
||||||
|
std::cout << "| VAR: g_pServerGameClients : 0x" << std::hex << std::uppercase << g_pServerGameClients << std::setw(0) << " |" << std::endl;
|
||||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||||
}
|
}
|
||||||
virtual void GetFun(void) const { }
|
virtual void GetFun(void) const { }
|
||||||
virtual void GetVar(void) const { }
|
virtual void GetVar(void) const
|
||||||
|
{
|
||||||
|
g_pServerGameDLL = p_SV_CreateBaseline.Offset(0x0).FindPatternSelf("48 8B", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).Deref().RCast<CServerGameDLL*>();
|
||||||
|
g_pServerGameClients = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x0F\xB7\x51\x14"), "xxxx?xxxx????xxxx").
|
||||||
|
FindPatternSelf("48 8B 0D", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CServerGameClients*>();
|
||||||
|
}
|
||||||
virtual void GetCon(void) const { }
|
virtual void GetCon(void) const { }
|
||||||
virtual void Attach(void) const { }
|
virtual void Attach(void) const { }
|
||||||
virtual void Detach(void) const { }
|
virtual void Detach(void) const { }
|
||||||
|
@ -303,6 +303,11 @@ public:
|
|||||||
x = X; y = Y; z = Z;
|
x = X; y = Y; z = Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void Init(float ix = 0.0f, float iy = 0.0f, float iz = 0.0f)
|
||||||
|
{
|
||||||
|
x = ix; y = iy; z = iz;
|
||||||
|
}
|
||||||
|
|
||||||
inline void Clear()
|
inline void Clear()
|
||||||
{
|
{
|
||||||
x = y = z = 0.0f;
|
x = y = z = 0.0f;
|
||||||
|
@ -3,10 +3,16 @@
|
|||||||
/* ==== STRYDER ================================================================================================================================================ */
|
/* ==== STRYDER ================================================================================================================================================ */
|
||||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||||
inline CMemory p_Stryder_StitchRequest = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x53\x57\x41\x56\x48\x81\xEC\x20"), "xxxxxxxxxxx");
|
inline CMemory p_Stryder_StitchRequest = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x53\x57\x41\x56\x48\x81\xEC\x20"), "xxxxxxxxxxx");
|
||||||
inline void* (*Stryder_StitchRequest)(void* a1) = (void* (*)(void*))p_Stryder_StitchRequest.GetPtr(); /*48 8B C4 53 57 41 56 48 81 EC 20*/
|
inline auto Stryder_StitchRequest = p_Stryder_StitchRequest.RCast<void* (*)(void* a1)>(); /*48 8B C4 53 57 41 56 48 81 EC 20*/
|
||||||
|
|
||||||
|
inline CMemory p_Stryder_SendOfflineRequest = 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\x48\x8B\x35\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x83\x65\xD0\xFC\x48\x8D\x4D\x80"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxx????xxx????xxx????xxx????xxxxxxxx");
|
||||||
|
inline auto Stryder_SendOfflineRequest = p_Stryder_StitchRequest.RCast<void(*)(void)>(); /*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 ? ? ? ? 48 8B 35 ? ? ? ? 48 8D 05 ? ? ? ? 83 65 D0 FC 48 8D 4D 80*/
|
||||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||||
inline CMemory p_Stryder_StitchRequest = 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\xE8\xB4"), "xxxxxxxxxxxxxxxxxxxxxxxxx");
|
inline CMemory p_Stryder_StitchRequest = 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\xE8\xB4"), "xxxxxxxxxxxxxxxxxxxxxxxxx");
|
||||||
inline void* (*Stryder_StitchRequest)(void* a1) = (void* (*)(void*))p_Stryder_StitchRequest.GetPtr(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 20 48 8B F9 E8 B4*/
|
inline auto Stryder_StitchRequest = p_Stryder_StitchRequest.RCast<void*(*)(void* a1)>(); /*48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 20 48 8B F9 E8 B4*/
|
||||||
|
|
||||||
|
inline CMemory p_Stryder_SendOfflineRequest = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x55\x57\x41\x56\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x35\x00\x00\x00\x00"), "xxxx?xxxx?xxxxxxxx????xxx????xxx????");
|
||||||
|
inline auto Stryder_SendOfflineRequest = p_Stryder_StitchRequest.RCast<bool(*)(void)>(); /*48 89 5C 24 ? 48 89 74 24 ? 55 57 41 56 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 35 ? ? ? ?*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -14,7 +20,8 @@ class HStryder : public IDetour
|
|||||||
{
|
{
|
||||||
virtual void GetAdr(void) const
|
virtual void GetAdr(void) const
|
||||||
{
|
{
|
||||||
std::cout << "| FUN: Stryder_StitchRequest : 0x" << std::hex << std::uppercase << p_Stryder_StitchRequest.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
std::cout << "| FUN: Stryder_StitchRequest : 0x" << std::hex << std::uppercase << p_Stryder_StitchRequest.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
|
std::cout << "| FUN: Stryder_SendOfflineRequest : 0x" << std::hex << std::uppercase << p_Stryder_SendOfflineRequest.GetPtr() << std::setw(nPad) << " |" << std::endl;
|
||||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||||
}
|
}
|
||||||
virtual void GetFun(void) const { }
|
virtual void GetFun(void) const { }
|
||||||
|
2
r5dev/thirdparty/detours/include/idetour.h
vendored
2
r5dev/thirdparty/detours/include/idetour.h
vendored
@ -31,7 +31,7 @@ class HDetour : public IDetour
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
std::int32_t nPad = 9;
|
std::int32_t nPad = 6;
|
||||||
std::vector<IDetour*> vDetour;
|
std::vector<IDetour*> vDetour;
|
||||||
std::size_t AddDetour(IDetour* pDetour)
|
std::size_t AddDetour(IDetour* pDetour)
|
||||||
{
|
{
|
||||||
|
@ -131,6 +131,7 @@
|
|||||||
<ClInclude Include="..\engine\debugoverlay.h" />
|
<ClInclude Include="..\engine\debugoverlay.h" />
|
||||||
<ClInclude Include="..\engine\gl_matsysiface.h" />
|
<ClInclude Include="..\engine\gl_matsysiface.h" />
|
||||||
<ClInclude Include="..\engine\gl_screen.h" />
|
<ClInclude Include="..\engine\gl_screen.h" />
|
||||||
|
<ClInclude Include="..\engine\host.h" />
|
||||||
<ClInclude Include="..\engine\host_cmd.h" />
|
<ClInclude Include="..\engine\host_cmd.h" />
|
||||||
<ClInclude Include="..\engine\host_state.h" />
|
<ClInclude Include="..\engine\host_state.h" />
|
||||||
<ClInclude Include="..\engine\modelloader.h" />
|
<ClInclude Include="..\engine\modelloader.h" />
|
||||||
|
@ -1175,6 +1175,9 @@
|
|||||||
<ClInclude Include="..\common\sdkdefs.h">
|
<ClInclude Include="..\common\sdkdefs.h">
|
||||||
<Filter>sdk\common</Filter>
|
<Filter>sdk\common</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\engine\host.h">
|
||||||
|
<Filter>sdk\engine</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Image Include="..\shared\resource\lockedserver.png">
|
<Image Include="..\shared\resource\lockedserver.png">
|
||||||
|
@ -145,6 +145,7 @@
|
|||||||
<ClInclude Include="..\engine\cmodel_bsp.h" />
|
<ClInclude Include="..\engine\cmodel_bsp.h" />
|
||||||
<ClInclude Include="..\engine\common.h" />
|
<ClInclude Include="..\engine\common.h" />
|
||||||
<ClInclude Include="..\engine\gl_matsysiface.h" />
|
<ClInclude Include="..\engine\gl_matsysiface.h" />
|
||||||
|
<ClInclude Include="..\engine\host.h" />
|
||||||
<ClInclude Include="..\engine\host_cmd.h" />
|
<ClInclude Include="..\engine\host_cmd.h" />
|
||||||
<ClInclude Include="..\engine\host_state.h" />
|
<ClInclude Include="..\engine\host_state.h" />
|
||||||
<ClInclude Include="..\engine\modelloader.h" />
|
<ClInclude Include="..\engine\modelloader.h" />
|
||||||
|
@ -849,6 +849,9 @@
|
|||||||
<ClInclude Include="..\common\sdkdefs.h">
|
<ClInclude Include="..\common\sdkdefs.h">
|
||||||
<Filter>sdk\common</Filter>
|
<Filter>sdk\common</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\engine\host.h">
|
||||||
|
<Filter>sdk\engine</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\common\opcodes.cpp">
|
<ClCompile Include="..\common\opcodes.cpp">
|
||||||
|
@ -140,6 +140,7 @@
|
|||||||
<ClInclude Include="..\engine\debugoverlay.h" />
|
<ClInclude Include="..\engine\debugoverlay.h" />
|
||||||
<ClInclude Include="..\engine\gl_matsysiface.h" />
|
<ClInclude Include="..\engine\gl_matsysiface.h" />
|
||||||
<ClInclude Include="..\engine\gl_screen.h" />
|
<ClInclude Include="..\engine\gl_screen.h" />
|
||||||
|
<ClInclude Include="..\engine\host.h" />
|
||||||
<ClInclude Include="..\engine\host_cmd.h" />
|
<ClInclude Include="..\engine\host_cmd.h" />
|
||||||
<ClInclude Include="..\engine\host_state.h" />
|
<ClInclude Include="..\engine\host_state.h" />
|
||||||
<ClInclude Include="..\engine\modelloader.h" />
|
<ClInclude Include="..\engine\modelloader.h" />
|
||||||
|
@ -1238,6 +1238,9 @@
|
|||||||
<ClInclude Include="..\common\sdkdefs.h">
|
<ClInclude Include="..\common\sdkdefs.h">
|
||||||
<Filter>sdk\common</Filter>
|
<Filter>sdk\common</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\engine\host.h">
|
||||||
|
<Filter>sdk\engine</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Image Include="..\shared\resource\lockedserver.png">
|
<Image Include="..\shared\resource\lockedserver.png">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user