mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-09-19 00:09:38 +02:00
Fix patterns for S1 and removed redundant code
This commit is contained in:
@@ -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);
|
||||
|
@@ -81,7 +81,7 @@ class HApplication : public IDetour
|
||||
p_CModAppSystemGroup_Create = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\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<rsig_t>("\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<rsig_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");
|
||||
p_CSourceAppSystemGroup__Create = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\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<int(*)(CModAppSystemGroup*)>(); /*40 53 48 83 EC 20 80 B9 ?? ?? ?? ?? ?? BB ?? ?? ?? ??*/
|
||||
CModAppSystemGroup_Create = p_CModAppSystemGroup_Create.RCast<bool(*)(CModAppSystemGroup*)>(); /*48 8B C4 55 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 60*/
|
||||
|
@@ -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
|
||||
}
|
@@ -7,7 +7,7 @@ inline auto v_WinMain = p_WinMain.RCast<int (*)(HINSTANCE hInstance, HINSTANCE h
|
||||
inline CMemory p_LauncherMain;
|
||||
inline auto v_LauncherMain = p_LauncherMain.RCast<int(*)(HINSTANCE hInstance)>();
|
||||
|
||||
#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<void* (*)(void)>();
|
||||
#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<int(*)(HINSTANCE)>();
|
||||
|
||||
#if !defined (GAMEDLL_S0) || !defined (GAMEDLL_S1)
|
||||
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
|
||||
p_RemoveSpuriousGameParameters = 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\x33\xED\x48\x8D\x3D\x00\x00\x00\x00"), "xxxx?xxxx?xxxx?xxxx????xxxxx????");
|
||||
v_RemoveSpuriousGameParameters = p_RemoveSpuriousGameParameters.RCast<void* (*)(void)>();
|
||||
#endif // !GAMEDLL_S0 || !GAMEDLL_S1
|
||||
|
Reference in New Issue
Block a user