mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Prevent dedicated server from writing any files to 'Saved Games' folder
This commit is contained in:
parent
a6b92f8713
commit
b85683b6f7
@ -270,7 +270,12 @@ void Dedicated_Init()
|
||||
CL_ClearState.Offset(0x0).Patch({ 0xC3 }); // FUN --> RET | Invalid 'CL_ClearState()' call from Host_Shutdown causing segfault.
|
||||
}
|
||||
#endif
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: GAME_CFG
|
||||
//-------------------------------------------------------------------------
|
||||
UpdateCurrentVideoConfig.Offset(0x0).Patch({ 0xB8, 0x01, 0x00, 0x00, 0x00, 0xC3 }); // FUN --> RET | Return early to prevent the server from writing a videoconfig.txt file to the disk (overwriting the existing one).
|
||||
HandleConfigFile.Offset(0x0).Patch({ 0xB8, 0x01, 0x00, 0x00, 0x00, 0xC3 }); // FUN --> RET | Return early to prevent the server from writing various input and ConVar config files to the disk (overwriting the existing one).
|
||||
ResetPreviousGameState.Offset(0x0).Patch({ 0xC3 }); // FUN --> RET | Return early to prevent the server from writing a previousgamestate.txt file to the disk (overwriting the existing one).
|
||||
|
||||
// This mandatory pak file should only exist on the client.
|
||||
if (!FileExists("vpk\\client_frontend.bsp.pak000_000.vpk"))
|
||||
|
@ -104,9 +104,11 @@ namespace
|
||||
ADDRESS Server_S2C_CONNECT_1 = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x3B\x05\x00\x00\x00\x00\x74\x0C", "xxx????xx");
|
||||
#endif // !CLIENT_DLL
|
||||
//-------------------------------------------------------------------------
|
||||
// RUNTIME: VIDEO_CFG
|
||||
// RUNTIME: GAME_CFG
|
||||
//-------------------------------------------------------------------------
|
||||
ADDRESS UpdateCurrentVideoConfig = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x55\x00\x41\x56\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00\x4C\x8B\xF1", "xx?xxxxxx????xxx????xxx????xxx");
|
||||
ADDRESS HandleConfigFile = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x56\x48\x81\xEC\x00\x00\x00\x00\x8B\xF1", "xxxxx????xx");
|
||||
ADDRESS ResetPreviousGameState = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\xE8\x00\x00\x00\x00\x44\x89\x3D\x00\x00\x00\x00\x00\x8B\x00\x24\x00", "x????xxx?????x?x?").ResolveRelativeAddressSelf(0x1, 0x5);
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// .RDATA
|
||||
@ -141,6 +143,8 @@ class HOpcodes : public IDetour
|
||||
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
||||
std::cout << "| FUN: Server_S2C_CONNECT_1 : 0x" << std::hex << std::uppercase << Server_S2C_CONNECT_1.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| FUN: UpdateCurrentVideoConfig : 0x" << std::hex << std::uppercase << UpdateCurrentVideoConfig.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| FUN: HandleConfigFile : 0x" << std::hex << std::uppercase << HandleConfigFile.GetPtr() << std::setw(npad) << " |" << std::endl;
|
||||
std::cout << "| FUN: ResetPreviousGameState : 0x" << std::hex << std::uppercase << ResetPreviousGameState.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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user