diff --git a/r5dev/common/opcodes.cpp b/r5dev/common/opcodes.cpp index 2dae1cd3..e0c1d45e 100644 --- a/r5dev/common/opcodes.cpp +++ b/r5dev/common/opcodes.cpp @@ -270,6 +270,7 @@ void Dedicated_Init() CL_ClearState.Offset(0x0).Patch({ 0xC3 }); // FUN --> RET | Invalid 'CL_ClearState()' call from Host_Shutdown causing segfault. } #endif + 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). // This mandatory pak file should only exist on the client. if (!FileExists("vpk\\client_frontend.bsp.pak000_000.vpk")) diff --git a/r5dev/common/opcodes.h b/r5dev/common/opcodes.h index 922f2b2b..f930e32c 100644 --- a/r5dev/common/opcodes.h +++ b/r5dev/common/opcodes.h @@ -103,6 +103,10 @@ namespace #ifndef CLIENT_DLL 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 + //------------------------------------------------------------------------- + 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"); //------------------------------------------------------------------------- // .RDATA @@ -135,6 +139,9 @@ class HOpcodes : public IDetour std::cout << "| FUN: Host_Disconnect : 0x" << std::hex << std::uppercase << Host_Disconnect.GetPtr() << std::setw(npad) << " |" << std::endl; std::cout << "| FUN: _Host_RunFrame : 0x" << std::hex << std::uppercase << _Host_RunFrame.GetPtr() << std::setw(npad) << " |" << std::endl; 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 << "+----------------------------------------------------------------+" << 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;