From 3d32346b3965a9eb442abc211ede6b606700db3e Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 19 Apr 2022 00:00:45 +0200 Subject: [PATCH] Fix patterns for S1 and removed redundant code --- r5dev/client/cdll_engine_int.cpp | 38 ------------------------- r5dev/core/init.cpp | 8 +----- r5dev/engine/gl_screen.h | 2 +- r5dev/engine/host.h | 5 ++++ r5dev/engine/host_state.cpp | 1 + r5dev/engine/host_state.h | 2 +- r5dev/engine/modelloader.h | 2 +- r5dev/launcher/IApplication.cpp | 2 +- r5dev/launcher/IApplication.h | 2 +- r5dev/launcher/launcher.cpp | 4 +-- r5dev/launcher/launcher.h | 8 +++--- r5dev/rtech/rtech_game.cpp | 2 +- r5dev/rtech/rtech_game.h | 2 +- r5dev/squirrel/sqvm.cpp | 4 +-- r5dev/tier0/basetypes.h | 2 +- r5dev/vguimatsurface/MatSystemSurface.h | 2 +- r5dev/vpc/keyvalues.cpp | 2 +- r5dev/vstdlib/keyvaluessystem.h | 2 +- 18 files changed, 26 insertions(+), 64 deletions(-) diff --git a/r5dev/client/cdll_engine_int.cpp b/r5dev/client/cdll_engine_int.cpp index 8f2cdc60..5f703421 100644 --- a/r5dev/client/cdll_engine_int.cpp +++ b/r5dev/client/cdll_engine_int.cpp @@ -26,47 +26,10 @@ void CHLClient::FrameStageNotify(CHLClient* pHLClient, ClientFrameStage_t frameS { case ClientFrameStage_t::FRAME_START: // FrameStageNotify gets called every frame by CEngine::Frame with the stage being FRAME_START. We can use this to check/set global variables. { - static bool bInitialized = false; - if (!bInitialized) - { - KeyValues::Init(); -#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) || defined (GAMEDLL_S2) // !TEMP UNTIL CHOSTSTATE IS BUILD AGNOSTIC! // - if (!CommandLine()->CheckParm("-devsdk")) - { - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"autoexec_server.cfg\"", cmd_source_t::kCommandSrcCode); - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"rcon_server.cfg\"", cmd_source_t::kCommandSrcCode); -#ifndef DEDICATED - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"autoexec_client.cfg\"", cmd_source_t::kCommandSrcCode); - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"rcon_client.cfg\"", cmd_source_t::kCommandSrcCode); -#endif // !DEDICATED - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"autoexec.cfg\"", cmd_source_t::kCommandSrcCode); - } - else // Development configs. - { - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"autoexec_server_dev.cfg\"", cmd_source_t::kCommandSrcCode); - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"rcon_server_dev.cfg\"", cmd_source_t::kCommandSrcCode); -#ifndef DEDICATED - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"autoexec_client_dev.cfg\"", cmd_source_t::kCommandSrcCode); - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"rcon_client_dev.cfg\"", cmd_source_t::kCommandSrcCode); -#endif // !DEDICATED - Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec \"autoexec_dev.cfg\"", cmd_source_t::kCommandSrcCode); - } - Cbuf_Execute(); - - if (net_userandomkey->GetBool()) - { - HNET_GenerateKey(); - } - g_pCVar->FindVar("net_usesocketsforloopback")->SetValue(1); - g_pRConClient->Init(); -#endif // GAMEDLL_S0 || GAMEDLL_S1 || GAMEDLL_S2 - bInitialized = true; - } break; } case ClientFrameStage_t::FRAME_NET_UPDATE_POSTDATAUPDATE_END: { - g_pBanSystem->BanListCheck(); gHLClient->PatchNetVarConVar(); break; } @@ -76,7 +39,6 @@ void CHLClient::FrameStageNotify(CHLClient* pHLClient, ClientFrameStage_t frameS } } g_pIConsole->Think(); - g_pRConClient->RunFrame(); CHLClient_FrameStageNotify(pHLClient, frameStage); } diff --git a/r5dev/core/init.cpp b/r5dev/core/init.cpp index fce56399..f0b0c8a5 100644 --- a/r5dev/core/init.cpp +++ b/r5dev/core/init.cpp @@ -163,10 +163,7 @@ void Systems_Init() CServer_Attach(); // S1 and S2 CServer functions require work. #endif // !CLIENT_DLL && GAMEDLL_S3 -// !TEMP UNTIL CHOSTSTATE IS BUILD AGNOSTIC! // -#if defined (DEDICATED) || defined (GAMEDLL_S3) CHostState_Attach(); -#endif // DEDICATED || GAMEDLL_S3 //CModelLoader_Attach(); NET_Attach(); @@ -270,10 +267,7 @@ void Systems_Shutdown() CServer_Detach(); // S1 and S2 CServer functions require work. #endif // !CLIENT_DLL && GAMEDLL_S3 -// !TEMP UNTIL CHOSTSTATE IS BUILD AGNOSTIC! // -#if defined (DEDICATED) || defined (GAMEDLL_S3) - CHostState_Detach(); // Dedicated only for now until backwards compatible with S1. -#endif // DEDICATED || GAMEDLL_S3 + CHostState_Detach(); //CModelLoader_Detach(); NET_Detach(); diff --git a/r5dev/engine/gl_screen.h b/r5dev/engine/gl_screen.h index 93863532..b7883d09 100644 --- a/r5dev/engine/gl_screen.h +++ b/r5dev/engine/gl_screen.h @@ -34,7 +34,7 @@ class HGL_Screen : public IDetour scr_drawloading = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x0F\xB6\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x83\xEC\x28"), "xxx????xxxxxxxxxxxxx") .ResolveRelativeAddressSelf(0x3, 0x7).RCast(); #if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) - scr_engineevent_loadingstarted = SCR_BeginLoadingPlaque.Offset(0x130).FindPatternSelf("C6 05 ?? ?? ?? ?? 01", CMemory::Direction::DOWN).ResolveRelativeAddress(0x2, 0x7).RCast(); + scr_engineevent_loadingstarted = SCR_BeginLoadingPlaque.Offset(0x130).FindPatternSelf("C6 05 ?? ?? ?? ?? 01", CMemory::Direction::DOWN).ResolveRelativeAddress(0x2, 0x7).RCast(); #elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3) scr_engineevent_loadingstarted = SCR_BeginLoadingPlaque.Offset(0x60).FindPatternSelf("C6 05 ?? ?? ?? ?? 01", CMemory::Direction::DOWN).ResolveRelativeAddress(0x2, 0x7).RCast(); #endif diff --git a/r5dev/engine/host.h b/r5dev/engine/host.h index 9b524da0..3f9c5561 100644 --- a/r5dev/engine/host.h +++ b/r5dev/engine/host.h @@ -46,8 +46,13 @@ class HHost : public IDetour } virtual void GetVar(void) const { +#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) + g_bAbortServerSet = p_Host_Error.FindPattern("40 38 3D", CMemory::Direction::DOWN, 512, 2).ResolveRelativeAddress(3, 7).RCast(); + host_abortserver = p_Host_Error.FindPattern("48 8D 0D", CMemory::Direction::DOWN, 512, 3).ResolveRelativeAddress(3, 7).RCast(); +#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3) g_bAbortServerSet = p_Host_Error.FindPattern("40 38 3D", CMemory::Direction::DOWN, 512, 4).ResolveRelativeAddress(3, 7).RCast(); host_abortserver = p_Host_Error.FindPattern("48 8D 0D", CMemory::Direction::DOWN, 512, 5).ResolveRelativeAddress(3, 7).RCast(); +#endif } virtual void GetCon(void) const { } virtual void Attach(void) const { } diff --git a/r5dev/engine/host_state.cpp b/r5dev/engine/host_state.cpp index 2d36851b..081e8b27 100644 --- a/r5dev/engine/host_state.cpp +++ b/r5dev/engine/host_state.cpp @@ -202,6 +202,7 @@ FORCEINLINE void CHostState::Setup(void) const const char* szNoMap = "main_menu"; #endif snprintf(const_cast(m_levelName), sizeof(m_levelName), szNoMap); + KeyValues::Init(); } //----------------------------------------------------------------------------- diff --git a/r5dev/engine/host_state.h b/r5dev/engine/host_state.h index feda8ebc..a1db6c3f 100644 --- a/r5dev/engine/host_state.h +++ b/r5dev/engine/host_state.h @@ -83,7 +83,7 @@ class HHostState : public IDetour p_CHostState_FrameUpdate = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x48\x89\x5C\x24\x08\x48\x89\x6C\x24\x20\xF3\x0F\x11\x54\x24\x18"), "xxxxxxxxxxxxxxxx"); p_CHostState_State_Run = g_mGameDll.FindPatternSIMD(reinterpret_cast("\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"); #if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) - p_CHostState_GameShutDown = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x48\x89\x5C\x24\x00\x56\x48\x83\xEC\x20\x8B\x05\x00\x00\x00\x00\x48\x8B\xF1"), "xxxx?xxxxxxx????xxx"); + p_CHostState_State_GameShutDown = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x48\x89\x5C\x24\x00\x56\x48\x83\xEC\x20\x8B\x05\x00\x00\x00\x00\x48\x8B\xF1"), "xxxx?xxxxxxx????xxx"); #elif defined (GAMEDLL_S2) p_CHostState_State_GameShutDown = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x8B\x05\x00\x00\x00\x00\x33\xFF\x48\x8B\xF1"), "xxxx?xxxx?xxxxxxx????xxxxx"); #elif defined (GAMEDLL_S3) diff --git a/r5dev/engine/modelloader.h b/r5dev/engine/modelloader.h index 69b5796b..3477d623 100644 --- a/r5dev/engine/modelloader.h +++ b/r5dev/engine/modelloader.h @@ -79,7 +79,7 @@ class HModelLoader : public IDetour { g_pModelLoader = g_mGameDll.FindPatternSIMD( reinterpret_cast("\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); + "xxxx?xxxxxxxxxxxxxx????").FindPatternSelf("48 ?? 0D", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(3, 7); } virtual void GetCon(void) const { } virtual void Attach(void) const { } diff --git a/r5dev/launcher/IApplication.cpp b/r5dev/launcher/IApplication.cpp index 0e793223..29dd410b 100644 --- a/r5dev/launcher/IApplication.cpp +++ b/r5dev/launcher/IApplication.cpp @@ -25,7 +25,7 @@ int CModAppSystemGroup::Main(CModAppSystemGroup* pModAppSystemGroup) HEbisuSDK_Init(); // Not here in retail. We init EbisuSDK here though. #if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) // !TODO: rebuild does not work for S1 (CModAppSystemGroup and CEngine member offsets do align with all other builds). - return CModAppSystemGroup_Main(modAppSystemGroup); + return CModAppSystemGroup_Main(pModAppSystemGroup); #elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3) g_pEngine->SetQuitting(EngineDllQuitting_t::QUIT_NOTQUITTING); diff --git a/r5dev/launcher/IApplication.h b/r5dev/launcher/IApplication.h index 6eafbb1f..86e0f7fd 100644 --- a/r5dev/launcher/IApplication.h +++ b/r5dev/launcher/IApplication.h @@ -81,7 +81,7 @@ class HApplication : public IDetour p_CModAppSystemGroup_Create = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x48\x8B\xC4\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8B\xEC\x48\x83\xEC\x60"), "xxxxxxxxxxxxxxxxxxx"); #endif p_CSourceAppSystemGroup__PreInit = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x48\x89\x74\x24\x00\x55\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00"), "xxxx?xxxxx????xxx????xxx????"); - p_CSourceAppSystemGroup__Create = g_mGameDll.FindPatternSIMD(reinterpret_cast("\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"); + p_CSourceAppSystemGroup__Create = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xF9\xE8\x00\x00\x00\x00\x33\xC9"), "xxxx?xxxx?xxxx?xxxxxxxxx????xx"); CModAppSystemGroup_Main = p_CModAppSystemGroup_Main.RCast(); /*40 53 48 83 EC 20 80 B9 ?? ?? ?? ?? ?? BB ?? ?? ?? ??*/ CModAppSystemGroup_Create = p_CModAppSystemGroup_Create.RCast(); /*48 8B C4 55 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 60*/ diff --git a/r5dev/launcher/launcher.cpp b/r5dev/launcher/launcher.cpp index fe2f0685..d9773513 100644 --- a/r5dev/launcher/launcher.cpp +++ b/r5dev/launcher/launcher.cpp @@ -163,7 +163,7 @@ void Launcher_Attatch() { DetourAttach((LPVOID*)&v_WinMain, &HWinMain); DetourAttach((LPVOID*)&v_LauncherMain, &LauncherMain); -#if !defined (GAMEDLL_S0) || !defined (GAMEDLL_S1) +#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1) DetourAttach((LPVOID*)&v_RemoveSpuriousGameParameters, &RemoveSpuriousGameParameters); #endif } @@ -172,7 +172,7 @@ void Launcher_Detatch() { DetourDetach((LPVOID*)&v_WinMain, &HWinMain); DetourDetach((LPVOID*)&v_LauncherMain, &LauncherMain); -#if !defined (GAMEDLL_S0) || !defined (GAMEDLL_S1) +#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1) DetourDetach((LPVOID*)&v_RemoveSpuriousGameParameters, &RemoveSpuriousGameParameters); #endif } \ No newline at end of file diff --git a/r5dev/launcher/launcher.h b/r5dev/launcher/launcher.h index 618f27a7..6f91b809 100644 --- a/r5dev/launcher/launcher.h +++ b/r5dev/launcher/launcher.h @@ -7,7 +7,7 @@ inline auto v_WinMain = p_WinMain.RCast(); -#if !defined (GAMEDLL_S0) || !defined (GAMEDLL_S1) +#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1) inline CMemory p_RemoveSpuriousGameParameters; inline auto v_RemoveSpuriousGameParameters = p_RemoveSpuriousGameParameters.RCast(); #endif // !GAMEDLL_S0 || !GAMEDLL_S1 @@ -27,8 +27,8 @@ class HLauncher : public IDetour { std::cout << "| FUN: WinMain : 0x" << std::hex << std::uppercase << p_WinMain.GetPtr() << std::setw(nPad) << " |" << std::endl; std::cout << "| FUN: LauncherMain : 0x" << std::hex << std::uppercase << p_LauncherMain.GetPtr() << std::setw(nPad) << " |" << std::endl; -#if !defined (GAMEDLL_S0) || !defined (GAMEDLL_S1) - std::cout << "| FUN: RemoveSpuriousGameParameters::Create : 0x" << std::hex << std::uppercase << p_RemoveSpuriousGameParameters.GetPtr() << std::setw(nPad) << " |" << std::endl; +#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1) + std::cout << "| FUN: RemoveSpuriousGameParameters : 0x" << std::hex << std::uppercase << p_RemoveSpuriousGameParameters.GetPtr() << std::setw(nPad) << " |" << std::endl; #endif // !GAMEDLL_S0 || !GAMEDLL_S1 std::cout << "+----------------------------------------------------------------+" << std::endl; } @@ -40,7 +40,7 @@ class HLauncher : public IDetour p_LauncherMain = g_mGameDll.GetExportedFunction("LauncherMain"); v_LauncherMain = p_LauncherMain.RCast(); -#if !defined (GAMEDLL_S0) || !defined (GAMEDLL_S1) +#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1) p_RemoveSpuriousGameParameters = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x81\xEC\x00\x00\x00\x00\x33\xED\x48\x8D\x3D\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxx????xxxxx????"); v_RemoveSpuriousGameParameters = p_RemoveSpuriousGameParameters.RCast(); #endif // !GAMEDLL_S0 || !GAMEDLL_S1 diff --git a/r5dev/rtech/rtech_game.cpp b/r5dev/rtech/rtech_game.cpp index a6fa82a6..2b409271 100644 --- a/r5dev/rtech/rtech_game.cpp +++ b/r5dev/rtech/rtech_game.cpp @@ -26,7 +26,7 @@ void HPakFile_UnloadAsset(int64_t a1, int64_t a2) // This ain't related to RTech return; } #if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) - return RTech_UnloadAsset(a1); + return CPakFile_UnloadAsset(a1); #elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3) return CPakFile_UnloadAsset(a1, a2); #endif diff --git a/r5dev/rtech/rtech_game.h b/r5dev/rtech/rtech_game.h index caab5081..dc5df8d0 100644 --- a/r5dev/rtech/rtech_game.h +++ b/r5dev/rtech/rtech_game.h @@ -24,7 +24,7 @@ enum class ePakStatus : int /* ==== RTECH_GAME ====================================================================================================================================================== */ #if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) -inline CMemory p_RTech_UnloadAsset; +inline CMemory p_CPakFile_UnloadAsset; inline auto CPakFile_UnloadAsset = p_CPakFile_UnloadAsset.RCast(); #elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3) diff --git a/r5dev/squirrel/sqvm.cpp b/r5dev/squirrel/sqvm.cpp index 013e42ca..21d0c9f7 100644 --- a/r5dev/squirrel/sqvm.cpp +++ b/r5dev/squirrel/sqvm.cpp @@ -49,7 +49,7 @@ SQRESULT HSQVM_PrintFunc(HSQUIRRELVM v, SQChar* fmt, ...) #ifdef GAMEDLL_S3 context = *reinterpret_cast(reinterpret_cast(v) + 0x18); #else // TODO [ AMOS ]: nothing equal to 'rdx + 18h' exist in the vm structs for anything below S3. - vmIdx = 3; + context = SQCONTEXT::NONE; #endif break; } @@ -205,7 +205,7 @@ void HSQVM_CompileError(HSQUIRRELVM v, const SQChar* pszError, const SQChar* psz #ifdef GAMEDLL_S3 context = *reinterpret_cast(reinterpret_cast(v) + 0x18); #else // TODO [ AMOS ]: nothing equal to 'rdx + 18h' exist in the vm structs for anything below S3. - vmIdx = 3; + context = SQCONTEXT::NONE; #endif SQVM_GetErrorLine(pszFile, nLine, szContextBuf, sizeof(szContextBuf)); diff --git a/r5dev/tier0/basetypes.h b/r5dev/tier0/basetypes.h index 470e1a03..f1ca6e81 100644 --- a/r5dev/tier0/basetypes.h +++ b/r5dev/tier0/basetypes.h @@ -16,7 +16,7 @@ #define MAX_PLAYERS 128 // Max R5 players. -#define SDK_VERSION "beta 1.6" // Increment this with every /breaking/ SDK change (i.e. security/backend changes breaking compatibility). +#define SDK_VERSION "beta 1.6"/*"VGameSDK001"*/ // Increment this with every /breaking/ SDK change (i.e. security/backend changes breaking compatibility). #ifndef DEDICATED #define SDK_DEFAULT_CFG "platform\\cfg\\startup_default.cfg" diff --git a/r5dev/vguimatsurface/MatSystemSurface.h b/r5dev/vguimatsurface/MatSystemSurface.h index c4535d8e..eb6f4c01 100644 --- a/r5dev/vguimatsurface/MatSystemSurface.h +++ b/r5dev/vguimatsurface/MatSystemSurface.h @@ -26,7 +26,7 @@ class HMatSystemSurface : public IDetour #if defined (GAMEDLL_S0) || defined (GAMEDLL_S1) g_pMatSystemSurface = g_mGameDll.FindPatternSIMD(reinterpret_cast( "\x48\x83\x3D\x00\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00"), - "xxx?????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????").Offset(0x0).FindPatternSelf("48 83 3D", CMemory::Direction::DOWN, 40).ResolveRelativeAddressSelf(0x3, 0x8).GetPtr(); + "xxx?????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????xxx????").ResolveRelativeAddressSelf(0x3, 0x8).GetPtr(); #elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3) g_pMatSystemSurface = g_mGameDll.FindPatternSIMD(reinterpret_cast( "\x48\x83\xEC\x28\x48\x83\x3D\x00\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00"), "xxxxxxx?????xxx????") diff --git a/r5dev/vpc/keyvalues.cpp b/r5dev/vpc/keyvalues.cpp index 63f3793a..371816f3 100644 --- a/r5dev/vpc/keyvalues.cpp +++ b/r5dev/vpc/keyvalues.cpp @@ -111,7 +111,7 @@ void KeyValues::InitPlaylist(void) { while (true) { - if ((*g_pPlaylistKeyValues)) + if (*g_pPlaylistKeyValues) { KeyValues* playlists = (*g_pPlaylistKeyValues)->FindKey("Playlists", false); if (playlists) diff --git a/r5dev/vstdlib/keyvaluessystem.h b/r5dev/vstdlib/keyvaluessystem.h index d057c5b4..b845549d 100644 --- a/r5dev/vstdlib/keyvaluessystem.h +++ b/r5dev/vstdlib/keyvaluessystem.h @@ -53,7 +53,7 @@ class HKeyValuesSystem : public IDetour { g_pKeyValuesSystem = g_mGameDll.FindPatternSIMD( reinterpret_cast("\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x56\x57\x41\x56\x48\x83\xEC\x40\x48\x8B\xF1"), "xxxx?xxxx?xxxxxxxxxxx") - .FindPatternSelf("48 8D 0D", CMemory::Direction::DOWN, 100).ResolveRelativeAddressSelf(0x3, 0x7).RCast(); + .FindPatternSelf("48 8D 0D ?? ?? ?? 01", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast(); g_pKeyValuesMemPool = g_mGameDll.FindPatternSIMD( reinterpret_cast("\x48\x8B\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\x48\x85\xD2"), "xxx????xxxxxxxxxxxx").