mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Load 'server' VPK's instead if the dedicated server is a standalone dedicated server
* Load server VPK's instead of client VPK's on standalone servers * Dynamically search for 'g_bDedicated' global boolean instead of hardcoded address * Add 'PatchString' to memory class
This commit is contained in:
parent
591559f8dc
commit
f488b7e75e
@ -14,159 +14,208 @@
|
||||
|
||||
|
||||
#ifdef DEDICATED
|
||||
//-------------------------------------------------------------------------
|
||||
// Purpose: change runtime behavior
|
||||
//-------------------------------------------------------------------------
|
||||
void Dedicated_Init()
|
||||
{
|
||||
*(uintptr_t*)0x14D415040 = 0x1417304E8; // CEngineClient::CEngineClient().
|
||||
//*(uintptr_t*)0x14B37C3C0 = 0x141F10CA0; // CHLClient::CHLClient().
|
||||
*(uintptr_t*)0x14D415040 = 0x1417304E8; // g_pEngineClient.
|
||||
*(uintptr_t*)0x14B3800D7 = 0x1; // bool bDedicated = true.
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CGAME
|
||||
//-------------------------------------------------------------------------
|
||||
CVideoMode_Common__CreateGameWindow.Offset(0x2C).Patch({ 0xE9, 0x9A, 0x00, 0x00, 0x00 }); // PUS --> XOR | Prevent ShowWindow and CreateGameWindow from being initialized (STGS RPak datatype is registered here).
|
||||
{
|
||||
CVideoMode_Common__CreateGameWindow.Offset(0x2C).Patch({ 0xE9, 0x9A, 0x00, 0x00, 0x00 }); // PUS --> XOR | Prevent ShowWindow and CreateGameWindow from being initialized (STGS RPak datatype is registered here).
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CHLClIENT
|
||||
//-------------------------------------------------------------------------
|
||||
gCHLClient__1000.Patch({ 0xC3 }); // FUN --> RET | Return early in unknown 'CHLClient' function to prevent infinite loop.
|
||||
{
|
||||
gCHLClient__1000.Patch({ 0xC3 }); // FUN --> RET | Return early in unknown 'CHLClient' function to prevent infinite loop.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CSOURCEAPPSYSTEMGROUP
|
||||
//-------------------------------------------------------------------------
|
||||
gCSourceAppSystemGroup__Create.Offset(0x248).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | inputSystem->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x267).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | materials->Connect().
|
||||
//gCSourceAppSystemGroup__Create.Offset(0x286).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | mdlCache->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x2A5).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | studioRender->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x2C4).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | avi->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x2E3).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | engineAPI->Connect().
|
||||
//gCSourceAppSystemGroup__Create.Offset(0x302).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | dataCache->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x321).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | matSystemSurface->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x340).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | vgui->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x35D).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | inputSystem->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x384).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | studioRender->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x39E).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | bik->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x3AB).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | engineAPI->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x3F6).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | vgui->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x3E9).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | matEmbeddedPanel->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x3F9).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | EAC_ClientInterface_Init().
|
||||
{
|
||||
gCSourceAppSystemGroup__Create.Offset(0x248).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | inputSystem->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x267).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | materials->Connect().
|
||||
//gCSourceAppSystemGroup__Create.Offset(0x286).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | mdlCache->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x2A5).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | studioRender->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x2C4).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | avi->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x2E3).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | engineAPI->Connect().
|
||||
//gCSourceAppSystemGroup__Create.Offset(0x302).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | dataCache->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x321).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | matSystemSurface->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x340).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | vgui->Connect().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x35D).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | inputSystem->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x384).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | studioRender->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x39E).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | bik->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x3AB).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | engineAPI->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x3F6).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | vgui->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x3E9).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | matEmbeddedPanel->Init().
|
||||
gCSourceAppSystemGroup__Create.Offset(0x3F9).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | EAC_ClientInterface_Init().
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CMATERIALSYSTEM
|
||||
//-------------------------------------------------------------------------
|
||||
//gCMaterialSystem__MatsysMode_Init.Offset(0x22).Patch({ 0xEB, 0x66 }); // JE --> JMP | Matsys mode init (CMaterialSystem). // TODO: Needed?
|
||||
CMaterialSystem__Init.Offset(0x406).Patch({ 0xE9, 0x55, 0x05, 0x00, 0x00 }); // MOV --> JMP | Jump over material KeyValue definitions and 'CMatRenderContextBase::sm_RenderData([x])'.
|
||||
InitMaterialSystem.Offset(0x7D).Patch({ 0xC3 }); // JMP --> RET | Return early to prevent 'InitDebugMaterials' from being executed. // RESEARCH NEEDED.
|
||||
{
|
||||
//gCMaterialSystem__MatsysMode_Init.Offset(0x22).Patch({ 0xEB, 0x66 }); // JE --> JMP | Matsys mode init (CMaterialSystem). // TODO: Needed?
|
||||
CMaterialSystem__Init.Offset(0x406).Patch({ 0xE9, 0x55, 0x05, 0x00, 0x00 }); // MOV --> JMP | Jump over material KeyValue definitions and 'CMatRenderContextBase::sm_RenderData([x])'.
|
||||
InitMaterialSystem.Offset(0x7D).Patch({ 0xC3 }); // JMP --> RET | Return early to prevent 'InitDebugMaterials' from being executed. // RESEARCH NEEDED.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CSHADERSYSTEM
|
||||
//-------------------------------------------------------------------------
|
||||
CShaderSystem__Init.Patch({ 0xC3 }); // FUN --> RET | Return early in 'CShaderSystem::Init' to prevent initialization.
|
||||
{
|
||||
CShaderSystem__Init.Patch({ 0xC3 }); // FUN --> RET | Return early in 'CShaderSystem::Init' to prevent initialization.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CSTUDIORENDERCONTEXT
|
||||
//-------------------------------------------------------------------------
|
||||
// Note: The registers here seems to contains pointers to material data and 'CMaterial' class methods when the shader system is initialized.
|
||||
CStudioRenderContext__LoadModel.Offset(0x17D).Patch({ 0x90, 0x90, 0x90, 0x90 }); // MOV --> NOP | RAX + RCX are both nullptrs.
|
||||
CStudioRenderContext__LoadModel.Offset(0x181).Patch({ 0x90, 0x90, 0x90 }); // MOV --> NOP | RCX is nullptr when trying to dereference.
|
||||
CStudioRenderContext__LoadModel.Offset(0x184).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | RAX is nullptr during virtual call resulting in exception 'C0000005'.
|
||||
CStudioRenderContext__LoadMaterials.Offset(0x28).Patch({ 0xE9, 0x80, 0x04, 0x00, 0x00 }); // FUN --> RET | 'CStudioRenderContext::LoadMaterials' is called virtually by the 'RMDL' streaming job.
|
||||
|
||||
{
|
||||
// Note: The registers here seems to contains pointers to material data and 'CMaterial' class methods when the shader system is initialized.
|
||||
CStudioRenderContext__LoadModel.Offset(0x17D).Patch({ 0x90, 0x90, 0x90, 0x90 }); // MOV --> NOP | RAX + RCX are both nullptrs.
|
||||
CStudioRenderContext__LoadModel.Offset(0x181).Patch({ 0x90, 0x90, 0x90 }); // MOV --> NOP | RCX is nullptr when trying to dereference.
|
||||
CStudioRenderContext__LoadModel.Offset(0x184).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | RAX is nullptr during virtual call resulting in exception 'C0000005'.
|
||||
CStudioRenderContext__LoadMaterials.Offset(0x28).Patch({ 0xE9, 0x80, 0x04, 0x00, 0x00 }); // FUN --> RET | 'CStudioRenderContext::LoadMaterials' is called virtually by the 'RMDL' streaming job.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CMODELLOADER
|
||||
//-------------------------------------------------------------------------
|
||||
CModelLoader__LoadModel.Offset(0x462).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Prevent call to 'CStudioRenderContext::LoadMaterials'.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x325).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialSystem::FindMaterialEx' fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x33D).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x359).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x374).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x38D).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'ReturnZero' fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x3A4).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
|
||||
{
|
||||
CModelLoader__LoadModel.Offset(0x462).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Prevent call to 'CStudioRenderContext::LoadMaterials'.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x325).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialSystem::FindMaterialEx' fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x33D).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x359).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x374).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x38D).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'ReturnZero' fails as RAX is nullptr.
|
||||
CModelLoader__Studio_LoadModel.Offset(0x3A4).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CMaterialGlue' class method fails as RAX is nullptr.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CGAMESERVER
|
||||
//-------------------------------------------------------------------------
|
||||
CGameServer__SpawnServer.Offset(0x43).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Prevent call to unknown material/shader code.
|
||||
CGameServer__SpawnServer.Offset(0x48).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // TODO: Research 'CIVDebugOverlay'.
|
||||
{
|
||||
CGameServer__SpawnServer.Offset(0x43).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Prevent call to unknown material/shader code.
|
||||
CGameServer__SpawnServer.Offset(0x48).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | TODO: Research 'CIVDebugOverlay'.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// MM_HEARTBEAT
|
||||
//-------------------------------------------------------------------------
|
||||
MM_Heartbeat__ToString.Offset(0xF).Patch({ 0xE9, 0x22, 0x01, 0x00, 0x00 }); // JS --> JMP | Skip ListenServer HeartBeat.
|
||||
{
|
||||
MM_Heartbeat__ToString.Offset(0xF).Patch({ 0xE9, 0x22, 0x01, 0x00, 0x00 }); // JS --> JMP | Skip ListenServer HeartBeat.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: SYS_INITGAME
|
||||
//-------------------------------------------------------------------------
|
||||
Sys_InitGame.Offset(0x70).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // STZNZ --> NOP | Prevent 'bDedicated' from being set to false.
|
||||
{
|
||||
Sys_InitGame.Offset(0x70).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // STZNZ --> NOP | Prevent 'bDedicated' from being set to false.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// 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.
|
||||
{
|
||||
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.
|
||||
|
||||
gHost_Init_1.Offset(0x609).Patch({ 0xEB, 0x2B }); // JE --> JMP | Skip client.dll Init_PostVideo() validation code.
|
||||
gHost_Init_1.Offset(0x621).Patch({ 0xEB, 0x0C }); // JNE --> JMP | Skip client.dll Init_PostVideo() validation code.
|
||||
gHost_Init_1.Offset(0x658).Patch({ 0xE9, 0x8C, 0x00, 0x00, 0x00 }); // JE --> JMP | Skip NULL call as client is never initialized.
|
||||
gHost_Init_1.Offset(0x6E9).Patch({ 0xE9, 0xB0, 0x00, 0x00, 0x00 }); // JNE --> JMP | Skip shader preloading as cvar can't be checked due to client being NULL.
|
||||
gHost_Init_1.Offset(0x609).Patch({ 0xEB, 0x2B }); // JE --> JMP | Skip client.dll Init_PostVideo() validation code.
|
||||
gHost_Init_1.Offset(0x621).Patch({ 0xEB, 0x0C }); // JNE --> JMP | Skip client.dll Init_PostVideo() validation code.
|
||||
gHost_Init_1.Offset(0x658).Patch({ 0xE9, 0x8C, 0x00, 0x00, 0x00 }); // JE --> JMP | Skip NULL call as client is never initialized.
|
||||
gHost_Init_1.Offset(0x6E9).Patch({ 0xE9, 0xB0, 0x00, 0x00, 0x00 }); // JNE --> JMP | Skip shader preloading as cvar can't be checked due to client being NULL.
|
||||
|
||||
gHost_Init_2.Offset(0x26F).Patch({ 0xE9, 0x4D, 0x05, 0x00, 0x00 }); // JNE --> JMP | client.dll systems initialization.
|
||||
gHost_Init_2.Offset(0x26F).Patch({ 0xE9, 0x4D, 0x05, 0x00, 0x00 }); // JNE --> JMP | client.dll systems initialization.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: HOST_NEWGAME
|
||||
//-------------------------------------------------------------------------
|
||||
Host_NewGame.Offset(0x4E0).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 });
|
||||
Host_NewGame.Offset(0x637).Patch({ 0xE9, 0xC1, 0x00, 0x00, 0x00 }); // JNE --> JMP | Prevent connect localhost from being executed in Host_NewGame.
|
||||
{
|
||||
Host_NewGame.Offset(0x4E0).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 });
|
||||
Host_NewGame.Offset(0x637).Patch({ 0xE9, 0xC1, 0x00, 0x00, 0x00 }); // JNE --> JMP | Prevent connect localhost from being executed in Host_NewGame.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: _HOST_RUNFRAME
|
||||
//-------------------------------------------------------------------------
|
||||
_Host_RunFrame.Offset(0xFB0).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | NOP call to unused VGUI code to prevent crash at SIGNONSTATE_PRESPAWN.
|
||||
_Host_RunFrame.Offset(0x1023).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | NOP NULL call as client is never initialized.
|
||||
{
|
||||
_Host_RunFrame.Offset(0xFB0).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | NOP call to unused VGUI code to prevent crash at SIGNONSTATE_PRESPAWN.
|
||||
_Host_RunFrame.Offset(0x1023).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | NOP NULL call as client is never initialized.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: EBISUSDK
|
||||
//-------------------------------------------------------------------------
|
||||
p_EbisuSDK_SetState.Offset(0x0).FindPatternSelf("0F 84", ADDRESS::Direction::DOWN).Patch({ 0x0F, 0x85 }); // JE --> JNZ | Prevent EbisuSDK from initializing on the engine and server.
|
||||
{
|
||||
p_EbisuSDK_SetState.Offset(0x0).FindPatternSelf("0F 84", ADDRESS::Direction::DOWN).Patch({ 0x0F, 0x85 }); // JE --> JNZ | Prevent EbisuSDK from initializing on the engine and server.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: FAIRFIGHT
|
||||
//-------------------------------------------------------------------------
|
||||
FairFight_Init.Offset(0x0).FindPatternSelf("0F 87", ADDRESS::Direction::DOWN, 200).Patch({ 0x0F, 0x85 }); // JA --> JNZ | Prevent 'FairFight' anti-cheat from initializing on the server by comparing RAX against 0x0 instead. Init will crash since the plugins aren't shipped.
|
||||
{
|
||||
FairFight_Init.Offset(0x0).FindPatternSelf("0F 87", ADDRESS::Direction::DOWN, 200).Patch({ 0x0F, 0x85 }); // JA --> JNZ | Prevent 'FairFight' anti-cheat from initializing on the server by comparing RAX against 0x0 instead. Init will crash since the plugins aren't shipped.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: BSP_LUMP
|
||||
//-------------------------------------------------------------------------
|
||||
CollisionBSPData_LoadAllLumps.Offset(0x41).Patch({ 0xE9, 0x4F, 0x04, 0x00, 0x00 }); // JNE --> NOP | SKYLIGHTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0x974).Patch({ 0x90, 0x90 }); // JE --> NOP | VERTNORMALS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xA55).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | MATERIALSORTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xA62).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | MESHBOUNDS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xA83).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | MESHVERTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xAC0).Patch({ 0x90, 0x90 }); // JE --> NOP | INDICES.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xBF2).Patch({ 0x90, 0x90 }); // JE --> NOP | WORLDLIGHTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xDA9).Patch({ 0x90, 0x90 }); // JE --> NOP | TWEAKLIGHTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xEEB).Patch({ 0xE9, 0x3D, 0x01, 0x00, 0x00 }); // JLE --> JMP | Exception 0x57 in while trying to dereference [R15 + R14 *8 + 0x10].
|
||||
CollisionBSPData_LoadAllLumps.Offset(0x61B).Patch({ 0xE9, 0xE2, 0x02, 0x00, 0x00 }); // JZ --> JMP | Prevent call to 'CMod_LoadTextures()'.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0x1045).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Prevent call to 'Mod_LoadCubemapSamples()'.
|
||||
{
|
||||
CollisionBSPData_LoadAllLumps.Offset(0x41).Patch({ 0xE9, 0x4F, 0x04, 0x00, 0x00 }); // JNE --> NOP | SKYLIGHTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0x974).Patch({ 0x90, 0x90 }); // JE --> NOP | VERTNORMALS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xA55).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | MATERIALSORTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xA62).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | MESHBOUNDS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xA83).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | MESHVERTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xAC0).Patch({ 0x90, 0x90 }); // JE --> NOP | INDICES.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xBF2).Patch({ 0x90, 0x90 }); // JE --> NOP | WORLDLIGHTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xDA9).Patch({ 0x90, 0x90 }); // JE --> NOP | TWEAKLIGHTS.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0xEEB).Patch({ 0xE9, 0x3D, 0x01, 0x00, 0x00 }); // JLE --> JMP | Exception 0x57 in while trying to dereference [R15 + R14 *8 + 0x10].
|
||||
CollisionBSPData_LoadAllLumps.Offset(0x61B).Patch({ 0xE9, 0xE2, 0x02, 0x00, 0x00 }); // JZ --> JMP | Prevent call to 'CMod_LoadTextures()'.
|
||||
CollisionBSPData_LoadAllLumps.Offset(0x1045).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Prevent call to 'Mod_LoadCubemapSamples()'.
|
||||
|
||||
CollisionBSPData_LinkPhysics.Offset(0x129).Patch({ 0x90, 0x90, 0x90 }); // MOV --> NOP | RCX is nullptr during dereference since shadersystem isn't initialized. Exception 'C0000005'.
|
||||
CollisionBSPData_LinkPhysics.Offset(0x12C).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CTexture' class member in RAX + 0x78 fails. Previous instruction could not dereference.
|
||||
CollisionBSPData_LinkPhysics.Offset(0x129).Patch({ 0x90, 0x90, 0x90 }); // MOV --> NOP | RCX is nullptr during dereference since shadersystem isn't initialized. Exception 'C0000005'.
|
||||
CollisionBSPData_LinkPhysics.Offset(0x12C).Patch({ 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to 'CTexture' class member in RAX + 0x78 fails. Previous instruction could not dereference.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: PROP_STATIC
|
||||
//-------------------------------------------------------------------------
|
||||
// Note: At [14028F3B0 + 0x5C7] RSP seems to contain a block of pointers to data for the static prop rmdl in question. [RSP + 0x70] is a pointer to (what seems to be) shader/material data. The pointer will be NULL without a shader system.
|
||||
p_CalcPropStaticFrustumCulling.Offset(0x5E0).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // MOV --> NOP | RSP + 0x70 is a nullptr which gets moved to R13, R13 gets used here resulting in exception 'C0000005'.
|
||||
p_CalcPropStaticFrustumCulling.Offset(0x5EB).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | RAX is nullptr during virtual call resulting in exception 'C0000005'.
|
||||
{
|
||||
// Note: At [14028F3B0 + 0x5C7] RSP seems to contain a block of pointers to data for the static prop rmdl in question. [RSP + 0x70] is a pointer to (what seems to be) shader/material data. The pointer will be NULL without a shader system.
|
||||
p_CalcPropStaticFrustumCulling.Offset(0x5E0).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // MOV --> NOP | RSP + 0x70 is a nullptr which gets moved to R13, R13 gets used here resulting in exception 'C0000005'.
|
||||
p_CalcPropStaticFrustumCulling.Offset(0x5EB).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | RAX is nullptr during virtual call resulting in exception 'C0000005'.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: GL_SCREEN
|
||||
//-------------------------------------------------------------------------
|
||||
SCR_BeginLoadingPlaque.Offset(0x82).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // JNE --> JMP | virtual call to 'CHLClient::CHudMessage'.
|
||||
SCR_BeginLoadingPlaque.Offset(0xA4).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // JNE --> JMP | virtual call to 'CEngineVGui::OnLevelLoadingStarted'.
|
||||
SCR_BeginLoadingPlaque.Offset(0x1D6).Patch({ 0xEB, 0x27 }); // JNE --> JMP | Prevent connect command from crashing by invalid call to UI function.
|
||||
{
|
||||
SCR_BeginLoadingPlaque.Offset(0x82).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // JNE --> JMP | virtual call to 'CHLClient::CHudMessage'.
|
||||
SCR_BeginLoadingPlaque.Offset(0xA4).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // JNE --> JMP | virtual call to 'CEngineVGui::OnLevelLoadingStarted'.
|
||||
SCR_BeginLoadingPlaque.Offset(0x1D6).Patch({ 0xEB, 0x27 }); // JNE --> JMP | Prevent connect command from crashing by invalid call to UI function.
|
||||
}
|
||||
|
||||
// This mandatory pak file should only exist on the client.
|
||||
if (!FileExists("vpk\\client_frontend.bsp.pak000_000.vpk"))
|
||||
{
|
||||
// Patch 'client' pak file string constants to 'server' if this is a standalone dedicated server
|
||||
g_pClientVPKDir.PatchString("vpk/%sserver_%s.bsp.pak000%s");
|
||||
g_pClientBSP.PatchString("vpk/server_%s.bsp");
|
||||
g_pClientCommonBSP.PatchString("vpk/server_mp_common.bsp");
|
||||
g_pClientMPLobby.PatchString("vpk/server_mp_lobby");
|
||||
g_pClientMP.PatchString("vpk/server_mp_");
|
||||
g_pClientSP.PatchString("vpk/server_sp_");
|
||||
}
|
||||
}
|
||||
#endif // DEDICATED
|
||||
|
||||
@ -193,7 +242,6 @@ void RuntimePtc_Toggle() /* .TEXT */
|
||||
// CALL --> NOP | Disable the viewmodel rendered to avoid a crash from a certain entity in desertlands_mu1
|
||||
//dst008.Offset(0x67).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 });
|
||||
|
||||
|
||||
printf("\n");
|
||||
printf("+--------------------------------------------------------+\n");
|
||||
printf("|>>>>>>>>>>>>>>| TEXT OPCODES OVERWRITTEN |<<<<<<<<<<<<<<|\n");
|
||||
|
@ -21,68 +21,70 @@ namespace
|
||||
ADDRESS dst008 = /*0x140E3E110*/ FindPatternSIMD(g_szGameDll, (const unsigned char*)"\x48\x83\xEC\x78\x48\x8B\x84\x24\x00\x00\x00\x00\x4D\x8B\xD8\x00", "xxxxxxxx????xxx?");
|
||||
/* -------------- ------- ----------------------------------------------------------------------------------------------------------------------------------------------- */
|
||||
#endif // GAMEDLL_S3
|
||||
namespace
|
||||
{
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
//-------------------------------------------------------------------------
|
||||
// CGAME
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS CVideoMode_Common__CreateGameWindow = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x56\x57\x48\x83\xEC\x28\x48\x8B\xF9\xE8\x00\x00\x00\x00\x48\x8B\xF0", "xxxxxxxxxxx????xxx");
|
||||
// 0x140299100 // 40 56 57 48 83 EC 28 48 8B F9 E8 ? ? ? ? 48 8B F0 //
|
||||
ADDRESS CVideoMode_Common__CreateGameWindow = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x56\x57\x48\x83\xEC\x28\x48\x8B\xF9\xE8\x00\x00\x00\x00\x48\x8B\xF0", "xxxxxxxxxxx????xxx");
|
||||
// 0x140299100 // 40 56 57 48 83 EC 28 48 8B F9 E8 ? ? ? ? 48 8B F0 //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CHLClIENT
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS gCHLClient__1000 = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x83\xEC\x28\x0F\xB6\x0D\x00\x00\x00\x00\x88\x15\x00\x00\x00\x00", "xxxxxxx????xx????"); // CHLClient + 1000
|
||||
// 0x1405C27B0 // 48 83 EC 28 0F B6 0D ? ? ? ? 88 15 ? ? ? ? //
|
||||
ADDRESS gCHLClient__1000 = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x83\xEC\x28\x0F\xB6\x0D\x00\x00\x00\x00\x88\x15\x00\x00\x00\x00", "xxxxxxx????xx????"); // CHLClient + 1000
|
||||
// 0x1405C27B0 // 48 83 EC 28 0F B6 0D ? ? ? ? 88 15 ? ? ? ? //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CSOURCEAPPSYSTEMGROUP
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS gCSourceAppSystemGroup__Create = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xF9\xE8\x00\x00\x00\x00\x33\xC9", "xxxx?xxxx?xxxxxxxxx????xx");
|
||||
// 0x14044AFA0 // 48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B F9 E8 ? ? ? ? 33 C9 //
|
||||
ADDRESS gCSourceAppSystemGroup__Create = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xF9\xE8\x00\x00\x00\x00\x33\xC9", "xxxx?xxxx?xxxxxxxxx????xx");
|
||||
// 0x14044AFA0 // 48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B F9 E8 ? ? ? ? 33 C9 //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// MM_HEARTBEAT
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS MM_Heartbeat__ToString = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x83\xEC\x38\xE8\x00\x00\x00\x00\x3B\x05\x00\x00\x00\x00", "xxxxx????xx????"); // server HeartBeat? (baseserver.cpp).
|
||||
// 0x1402312A0 // 48 83 EC 38 E8 ? ? ? ? 3B 05 ? ? ? ? //
|
||||
ADDRESS MM_Heartbeat__ToString = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x83\xEC\x38\xE8\x00\x00\x00\x00\x3B\x05\x00\x00\x00\x00", "xxxxx????xx????"); // server HeartBeat? (baseserver.cpp).
|
||||
// 0x1402312A0 // 48 83 EC 38 E8 ? ? ? ? 3B 05 ? ? ? ? //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: SYS_INITGAME
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS Sys_InitGame = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x41\x8B\xD8", "xxxx?xxxx????xx?????xxx");
|
||||
// 0x1402958D0 // 48 89 5C 24 ? 57 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 41 8B D8 //
|
||||
ADDRESS Sys_InitGame = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x41\x8B\xD8", "xxxx?xxxx????xx?????xxx");
|
||||
// 0x1402958D0 // 48 89 5C 24 ? 57 48 81 EC ? ? ? ? 80 3D ? ? ? ? ? 41 8B D8 //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CSHADERSYSTEM
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS CShaderSystem__Init = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\xC6\x41\x10\x00", "xxxx?xxxx?xxxxxxxxx");
|
||||
// 0x1403DF870 // 48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 C6 41 10 00 //
|
||||
ADDRESS CShaderSystem__Init = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\xC6\x41\x10\x00", "xxxx?xxxx?xxxxxxxxx");
|
||||
// 0x1403DF870 // 48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 C6 41 10 00 //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: BSP_LUMP
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS CollisionBSPData_LoadAllLumps = g_mGameDll.FindPatternSIMD((std::uint8_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.
|
||||
// 0x1402546F0 // 48 89 54 24 ? 48 89 4C 24 ? 55 53 56 57 41 54 41 55 41 57 //
|
||||
ADDRESS CollisionBSPData_LoadAllLumps = g_mGameDll.FindPatternSIMD((std::uint8_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.
|
||||
// 0x1402546F0 // 48 89 54 24 ? 48 89 4C 24 ? 55 53 56 57 41 54 41 55 41 57 //
|
||||
|
||||
ADDRESS CollisionBSPData_LinkPhysics = g_mGameDll.FindPatternSIMD((std::uint8_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"); // case 1: only gets called on changelevel, needs more research, function gets called by CModelLoader virtual function.
|
||||
// 0x140256480 // 48 89 5C 24 ? 48 89 6C 24 ? 57 48 81 EC ? ? ? ? 48 8B F9 33 ED //
|
||||
ADDRESS CollisionBSPData_LinkPhysics = g_mGameDll.FindPatternSIMD((std::uint8_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"); // case 1: only gets called on changelevel, needs more research, function gets called by CModelLoader virtual function.
|
||||
// 0x140256480 // 48 89 5C 24 ? 48 89 6C 24 ? 57 48 81 EC ? ? ? ? 48 8B F9 33 ED //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CSTUDIORENDERCONTEXT
|
||||
//-------------------------------------------------------------------------
|
||||
#if defined (GAMEDLL_S1)
|
||||
ADDRESS CStudioRenderContext__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x44\x24\x00\x53\x55\x56\x41\x54\x41\x57", "xxxx?xxxxxxx");
|
||||
ADDRESS CStudioRenderContext__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x44\x24\x00\x53\x55\x56\x41\x54\x41\x57", "xxxx?xxxxxxx");
|
||||
#elif defined (GAMEDLL_S2)
|
||||
ADDRESS CStudioRenderContext__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x44\x24\x00\x48\x89\x54\x24\x00\x53\x57\x41\x55\x48\x81\xEC\x00\x00\x00\x00", "xxxx?xxxx?xxxxxxx????");
|
||||
ADDRESS CStudioRenderContext__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x44\x24\x00\x48\x89\x54\x24\x00\x53\x57\x41\x55\x48\x81\xEC\x00\x00\x00\x00", "xxxx?xxxx?xxxxxxx????");
|
||||
#elif defined (GAMEDLL_S3)
|
||||
ADDRESS CStudioRenderContext__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x44\x24\x00\x48\x89\x54\x24\x00\x48\x89\x4C\x24\x00\x53\x55\x56\x57\x48\x83\xEC\x78", "xxxx?xxxx?xxxx?xxxxxxxx");
|
||||
ADDRESS CStudioRenderContext__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x44\x24\x00\x48\x89\x54\x24\x00\x48\x89\x4C\x24\x00\x53\x55\x56\x57\x48\x83\xEC\x78", "xxxx?xxxx?xxxx?xxxxxxxx");
|
||||
#endif// 0x1404554C0 // 4C 89 44 24 ? 48 89 54 24 ? 48 89 4C 24 ? 53 55 56 57 48 83 EC 78 //
|
||||
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
ADDRESS CStudioRenderContext__LoadMaterials = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x44\x24\x00\x55\x56\x41\x57", "xxxx?xxxx");
|
||||
ADDRESS CStudioRenderContext__LoadMaterials = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x44\x24\x00\x55\x56\x41\x57", "xxxx?xxxx");
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
ADDRESS CStudioRenderContext__LoadMaterials = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\xC4\x4C\x89\x40\x18\x55\x56\x41\x55", "xxxxxxxxxxx");
|
||||
ADDRESS CStudioRenderContext__LoadMaterials = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\xC4\x4C\x89\x40\x18\x55\x56\x41\x55", "xxxxxxxxxxx");
|
||||
#endif// 0x140456B50 // 48 8B C4 4C 89 40 18 55 56 41 55 //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -90,80 +92,89 @@ namespace
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
ADDRESS CModelLoader__FindModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x55\x41\x55\x41\x56\x48\x8D\xAC\x24\x00\x00\x00\x00", "xxxxxxxxxx????");
|
||||
// 0x1402A1F10 // 40 55 41 55 41 56 48 8D AC 24 ? ? ? ? //
|
||||
ADDRESS CModelLoader__FindModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x55\x41\x55\x41\x56\x48\x8D\xAC\x24\x00\x00\x00\x00", "xxxxxxxxxx????");
|
||||
// 0x1402A1F10 // 40 55 41 55 41 56 48 8D AC 24 ? ? ? ? //
|
||||
|
||||
ADDRESS CModelLoader__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x57\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xFA", "xxxxxxxx????xxx");
|
||||
// 0x1402A23B0 // 40 53 57 41 56 48 81 EC ? ? ? ? 48 8B FA //
|
||||
ADDRESS CModelLoader__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x57\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\xFA", "xxxxxxxx????xxx");
|
||||
// 0x1402A23B0 // 40 53 57 41 56 48 81 EC ? ? ? ? 48 8B FA //
|
||||
|
||||
ADDRESS CModelLoader__Studio_LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x55\x56\x57\x41\x54\x41\x56\x48\x8D\xAC\x24\x00\x00\x00\x00", "xxxx?xxxxxxxxxxx????");
|
||||
// 0x140252F10 // 48 89 5C 24 ? 55 56 57 41 54 41 57 48 81 EC ? ? ? ? //
|
||||
ADDRESS CModelLoader__Studio_LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x55\x56\x57\x41\x54\x41\x56\x48\x8D\xAC\x24\x00\x00\x00\x00", "xxxx?xxxxxxxxxxx????");
|
||||
// 0x140252F10 // 48 89 5C 24 ? 55 56 57 41 54 41 57 48 81 EC ? ? ? ? //
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
ADDRESS CModelLoader__FindModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x55\x41\x57\x48\x83\xEC\x48\x80\x3A\x2A", "xxxxxxxxxxx");
|
||||
// 0x140253530 // 40 55 41 57 48 83 EC 48 80 3A 2A //
|
||||
ADDRESS CModelLoader__FindModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x55\x41\x57\x48\x83\xEC\x48\x80\x3A\x2A", "xxxxxxxxxxx");
|
||||
// 0x140253530 // 40 55 41 57 48 83 EC 48 80 3A 2A //
|
||||
|
||||
ADDRESS CModelLoader__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x57\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00", "xxxxxxxx????xxx????");
|
||||
// 0x140253810 // 40 53 57 41 57 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? //
|
||||
ADDRESS CModelLoader__LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x57\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00", "xxxxxxxx????xxx????");
|
||||
// 0x140253810 // 40 53 57 41 57 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? //
|
||||
|
||||
ADDRESS CModelLoader__Studio_LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x55\x56\x57\x41\x54\x41\x57\x48\x81\xEC\x00\x00\x00\x00", "xxxx?xxxxxxxxxx????");
|
||||
// 0x140252F10 // 48 89 5C 24 ? 55 56 57 41 54 41 57 48 81 EC ? ? ? ? //
|
||||
ADDRESS CModelLoader__Studio_LoadModel = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x55\x56\x57\x41\x54\x41\x57\x48\x81\xEC\x00\x00\x00\x00", "xxxx?xxxxxxxxxx????");
|
||||
// 0x140252F10 // 48 89 5C 24 ? 55 56 57 41 54 41 57 48 81 EC ? ? ? ? //
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// CGAMESERVER
|
||||
//-------------------------------------------------------------------------
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
ADDRESS CGameServer__SpawnServer = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x55\x56\x57\x41\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00", "xxxxxxxxxxxxxx????");
|
||||
ADDRESS CGameServer__SpawnServer = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x55\x56\x57\x41\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00", "xxxxxxxxxxxxxx????");
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
ADDRESS CGameServer__SpawnServer = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\xC4\x53\x55\x56\x57\x41\x54\x41\x55\x41\x57", "xxxxxxxxxxxxx");
|
||||
// 0x140312D80 // 48 8B C4 53 55 56 57 41 54 41 55 41 57 //
|
||||
ADDRESS CGameServer__SpawnServer = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\xC4\x53\x55\x56\x57\x41\x54\x41\x55\x41\x57", "xxxxxxxxxxxxx");
|
||||
// 0x140312D80 // 48 8B C4 53 55 56 57 41 54 41 55 41 57 //
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: FAIRFIGHT
|
||||
//-------------------------------------------------------------------------
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
ADDRESS FairFight_Init = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x57\x41\x57\x48\x83\xEC\x30\x8B\x81\x00\x00\x00\x00", "xxxxxxxxxxx????");
|
||||
ADDRESS FairFight_Init = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x57\x41\x57\x48\x83\xEC\x30\x8B\x81\x00\x00\x00\x00", "xxxxxxxxxxx????");
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
ADDRESS FairFight_Init = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x48\x83\xEC\x20\x8B\x81\xB0\x03\x00\x00\x48\x8B\xD9\xC6", "xxxxxxxxxxxxxxxx");
|
||||
ADDRESS FairFight_Init = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x53\x48\x83\xEC\x20\x8B\x81\xB0\x03\x00\x00\x48\x8B\xD9\xC6", "xxxxxxxxxxxxxxxx");
|
||||
#endif // 0x140303AE0 // 40 53 48 83 EC 20 8B 81 ? ? ? ? 48 8B D9 C6 81 ? ? ? ? ? //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: HOST_INIT
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS gHost_Init_0 = g_mGameDll.FindPatternSIMD((std::uint8_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 //
|
||||
ADDRESS gHost_Init_0 = g_mGameDll.FindPatternSIMD((std::uint8_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 //
|
||||
|
||||
ADDRESS gHost_Init_1 = g_mGameDll.FindPatternSIMD((std::uint8_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 //
|
||||
ADDRESS gHost_Init_1 = g_mGameDll.FindPatternSIMD((std::uint8_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 //
|
||||
|
||||
ADDRESS gHost_Init_2 = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x88\x4C\x24\x08\x53\x55\x56\x57\x48\x83\xEC\x68", "xxxxxxxxxxxx"); // client Host_Init()?
|
||||
// 0x140236640 // 88 4C 24 08 53 55 56 57 48 83 EC 68 //
|
||||
ADDRESS gHost_Init_2 = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x88\x4C\x24\x08\x53\x55\x56\x57\x48\x83\xEC\x68", "xxxxxxxxxxxx"); // client Host_Init()?
|
||||
// 0x140236640 // 88 4C 24 08 53 55 56 57 48 83 EC 68 //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: _HOST_RUNFRAME
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS _Host_RunFrame = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\xC4\x48\x89\x58\x18\x48\x89\x70\x20\xF3\x0F\x11\x48\x00", "xxxxxxxxxxxxxxx?"); // _Host_RunFrame() with inlined CFrameTimer::MarkFrame()?
|
||||
// 0x140231C00 // 48 8B C4 48 89 58 18 48 89 70 20 F3 0F 11 48 ? //
|
||||
ADDRESS _Host_RunFrame = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\xC4\x48\x89\x58\x18\x48\x89\x70\x20\xF3\x0F\x11\x48\x00", "xxxxxxxxxxxxxxx?"); // _Host_RunFrame() with inlined CFrameTimer::MarkFrame()?
|
||||
// 0x140231C00 // 48 8B C4 48 89 58 18 48 89 70 20 F3 0F 11 48 ? //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: HOST_NEWGAME
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS Host_NewGame = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\xC4\x00\x41\x54\x41\x00\x48\x81\xEC\x00\x00\x00\x00\xF2", "xxx?xxx?xxx??xxx");
|
||||
// 0x140238DA0 // 48 8B C4 ?? 41 54 41 ?? 48 81 EC ?? ?? 00 00 F2 //
|
||||
ADDRESS Host_NewGame = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x8B\xC4\x00\x41\x54\x41\x00\x48\x81\xEC\x00\x00\x00\x00\xF2", "xxx?xxx?xxx??xxx");
|
||||
// 0x140238DA0 // 48 8B C4 ?? 41 54 41 ?? 48 81 EC ?? ?? 00 00 F2 //
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: GL_SCREEN
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||
ADDRESS SCR_BeginLoadingPlaque = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x0F\x29\x74\x24\x00\x48\x8B\xF9", "xxxx?xxxx?xxxxxxxxx?xxx");
|
||||
// 0x14022A4A0 // 48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 30 0F 29 74 24 ? 48 8B F9 //
|
||||
ADDRESS SCR_BeginLoadingPlaque = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x0F\x29\x74\x24\x00\x48\x8B\xF9", "xxxx?xxxx?xxxxxxxxx?xxx");
|
||||
// 0x14022A4A0 // 48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 30 0F 29 74 24 ? 48 8B F9 //
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
ADDRESS SCR_BeginLoadingPlaque = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x83\xEC\x38\x0F\x29\x74\x24\x00\x48\x89\x5C\x24\x00", "xxxxxxxx?xxxx?");
|
||||
// 0x14022A4A0 // 48 83 EC 38 0F 29 74 24 ? 48 89 5C 24 ? //
|
||||
ADDRESS SCR_BeginLoadingPlaque = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x83\xEC\x38\x0F\x29\x74\x24\x00\x48\x89\x5C\x24\x00", "xxxxxxxx?xxxx?");
|
||||
// 0x14022A4A0 // 48 83 EC 38 0F 29 74 24 ? 48 89 5C 24 ? //
|
||||
#endif
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// .RDATA
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS g_pClientVPKDir = g_mGameDll.FindAddressForString("vpk/%sclient_%s.bsp.pak000%s", true);
|
||||
ADDRESS g_pClientBSP = g_mGameDll.FindAddressForString("vpk/client_%s.bsp", true);
|
||||
ADDRESS g_pClientCommonBSP = g_mGameDll.FindAddressForString("vpk/client_mp_common.bsp", true);
|
||||
ADDRESS g_pClientMPLobby = g_mGameDll.FindAddressForString("vpk/client_mp_lobby", true);
|
||||
ADDRESS g_pClientMP = g_mGameDll.FindAddressForString("vpk/client_mp_", true);
|
||||
ADDRESS g_pClientSP = g_mGameDll.FindAddressForString("vpk/client_sp_", true);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -199,6 +210,13 @@ class HOpcodes : public IDetour
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
std::cout << "| FUN: SCR_BeginLoadingPlaque : 0x" << std::hex << std::uppercase << SCR_BeginLoadingPlaque.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
std::cout << "| CON: g_pClientVPKDir : 0x" << std::hex << std::uppercase << g_pClientVPKDir.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| CON: g_pClientBSP : 0x" << std::hex << std::uppercase << g_pClientBSP.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| CON: g_pClientCommonBSP : 0x" << std::hex << std::uppercase << g_pClientCommonBSP.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| CON: g_pClientMPLobby : 0x" << std::hex << std::uppercase << g_pClientMPLobby.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| CON: g_pClientMP : 0x" << std::hex << std::uppercase << g_pClientMP.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| CON: g_pClientSP : 0x" << std::hex << std::uppercase << g_pClientSP.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -43,8 +43,10 @@
|
||||
#include "engine/host_cmd.h"
|
||||
#include "engine/host_state.h"
|
||||
#include "engine/net_chan.h"
|
||||
#include "engine/sv_main.h"
|
||||
#include "engine/sys_dll.h"
|
||||
#include "engine/sys_dll2.h"
|
||||
#include "engine/sys_engine.h"
|
||||
#include "engine/sys_utils.h"
|
||||
#ifndef DEDICATED
|
||||
#include "engine/debugoverlay.h"
|
||||
|
@ -18,7 +18,8 @@ class HSV_MAIN : public IDetour
|
||||
{
|
||||
virtual void debugp()
|
||||
{
|
||||
std::cout << "| FUN: SV_ShutdownGameDLL : 0x" << std::hex << std::uppercase << p_SV_ShutdownGameDLL.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| FUN: SV_ShutdownGameDLL : 0x" << std::hex << std::uppercase << p_SV_ShutdownGameDLL.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -78,7 +78,8 @@ class HEngine : public IDetour
|
||||
{
|
||||
virtual void debugp()
|
||||
{
|
||||
std::cout << "| VAR: g_pEngine : 0x" << std::hex << std::uppercase << g_pEngineBuffer.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_pEngine : 0x" << std::hex << std::uppercase << g_pEngineBuffer.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -95,15 +95,14 @@ void DevMsg(eDLL_T idx, const char* fmt, ...)
|
||||
sqlogger->debug(svOut);
|
||||
|
||||
#ifndef DEDICATED
|
||||
g_spd_sys_w_oss.str("");
|
||||
g_spd_sys_w_oss.clear();
|
||||
|
||||
iconsole->info(svOut);
|
||||
|
||||
std::string s = g_spd_sys_w_oss.str();
|
||||
|
||||
g_pLogSystem.AddLog((LogType_t)eDLL_T::ENGINE, s);
|
||||
g_pIConsole->m_ivConLog.push_back(Strdup(s.c_str()));
|
||||
|
||||
g_spd_sys_w_oss.str("");
|
||||
g_spd_sys_w_oss.clear();
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,10 @@
|
||||
#include "engine/sys_dll2.h"
|
||||
#include "engine/sv_main.h"
|
||||
#include "engine/host_cmd.h"
|
||||
#include "server/IVEngineServer.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
int HIApplication_Main(CModAppSystemGroup* modAppSystemGroup)
|
||||
{
|
||||
@ -20,7 +21,7 @@ int HIApplication_Main(CModAppSystemGroup* modAppSystemGroup)
|
||||
if (g_pEngine->Load(true, g_pEngineParms->baseDirectory))
|
||||
{
|
||||
// Below is vfunc call that is supposed to be used for real dedicated servers. The class instance is sadly stripped to some degree.
|
||||
//(*(void(__fastcall**)(__int64))(*(_QWORD*)qword_14C119C10 + 72i64))(qword_14C119C10);// dedicated->RunServer
|
||||
//(*(void(__fastcall**)(__int64))(*(_QWORD*)qword_14C119C10 + 72i64))(qword_14C119C10);// dedicated->RunServer()
|
||||
SV_ShutdownGameDLL();
|
||||
}
|
||||
}
|
||||
@ -42,14 +43,12 @@ int HIApplication_Main(CModAppSystemGroup* modAppSystemGroup)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose: Instantiate all main libraries
|
||||
//-----------------------------------------------------------------------------
|
||||
bool HIApplication_Create(void* a1)
|
||||
{
|
||||
#ifdef DEDICATED
|
||||
// TODO: Don't hardcode!
|
||||
// Also add cross-season support?
|
||||
* (uintptr_t*)0x162C61208 = 0x1; // g_bDedicated
|
||||
* g_bDedicated = true;
|
||||
#endif // DEDICATED
|
||||
g_pConCommand->Init();
|
||||
|
||||
|
@ -136,6 +136,24 @@ public:
|
||||
VirtualProtect((void*)ptr, dwSize, oldProt, &oldProt); // Restore protection.
|
||||
}
|
||||
|
||||
void PatchString(const std::string string)
|
||||
{
|
||||
DWORD oldProt = NULL;
|
||||
|
||||
SIZE_T dwSize = string.size();
|
||||
std::vector<char> bytes(string.begin(), string.end());
|
||||
|
||||
VirtualProtect((void*)ptr, dwSize, PAGE_EXECUTE_READWRITE, &oldProt); // Patch page to be able to read and write to it.
|
||||
|
||||
for (int i = 0; i < string.size(); i++)
|
||||
{
|
||||
*(std::uint8_t*)(ptr + i) = bytes[i]; // Write string to Address.
|
||||
}
|
||||
|
||||
dwSize = string.size();
|
||||
VirtualProtect((void*)ptr, dwSize, oldProt, &oldProt); // Restore protection.
|
||||
}
|
||||
|
||||
ADDRESS FindPatternSelf(const std::string pattern, const Direction searchDirect, const int opCodesToScan = 100, const std::ptrdiff_t occurence = 1)
|
||||
{
|
||||
static auto PatternToBytes = [](const std::string pattern)
|
||||
|
@ -5,6 +5,11 @@ namespace
|
||||
/* ==== CVENGINESERVER ================================================================================================================================================== */
|
||||
ADDRESS p_IVEngineServer_PersistenceAvailable = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x3B\x15\x00\x00\x00\x00\x7D\x33", "xx????xx");
|
||||
bool (*IVEngineServer_PersistenceAvailable)(void* entidx, int clientidx) = (bool (*)(void*, int))p_IVEngineServer_PersistenceAvailable.GetPtr(); /*3B 15 ?? ?? ?? ?? 7D 33*/
|
||||
|
||||
ADDRESS p_IVEngineServer_IsDedicatedServer = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x0F\xB6\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x8B\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x40\x53", "xxx????xxxxxxxxxxxx????xxxxxxxxxxx");
|
||||
bool (*IVEngineServer_IsDedicatedServer)(void) = (bool (*)(void))p_IVEngineServer_IsDedicatedServer.GetPtr(); /*0F B6 05 ? ? ? ? C3 CC CC CC CC CC CC CC CC 48 8B 05 ? ? ? ? C3 CC CC CC CC CC CC CC CC 40 53*/
|
||||
|
||||
bool* g_bDedicated = p_IVEngineServer_IsDedicatedServer.Offset(0x0).ResolveRelativeAddress(0x3, 0x7).RCast<bool*>();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -22,6 +27,8 @@ class HVEngineServer : public IDetour
|
||||
virtual void debugp()
|
||||
{
|
||||
std::cout << "| FUN: IVEngineServer::PersistenceAvailable : 0x" << std::hex << std::uppercase << p_IVEngineServer_PersistenceAvailable.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| FUN: IVEngineServer::IsDedicatedServer : 0x" << std::hex << std::uppercase << p_IVEngineServer_IsDedicatedServer.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| VAR: g_bDedicated : 0x" << std::hex << std::uppercase << g_bDedicated << std::setw(0) << " |" << std::endl;
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user