Rename hooked command callbacks

This commit is contained in:
Amos 2021-12-29 13:57:16 +01:00
parent b514f928a6
commit 6a9a00735a
4 changed files with 13 additions and 13 deletions

View File

@ -22,15 +22,15 @@ namespace
#ifdef DEDICATED #ifdef DEDICATED
#if defined (GAMEDLL_S1) #if defined (GAMEDLL_S1)
ADDRESS g_bEbisuSDKInitialized = p_EbisuSDK_Init_Tier0.FindPatternSelf("80 3D ?? ?? ?? ?? 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr(); ADDRESS g_bEbisuSDKInitialized = p_EbisuSDK_Init_Tier0.FindPatternSelf("80 3D ?? ?? ?? ?? 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr();
ADDRESS g_bEbisuSDKCvarInitialized = p_Map_Callback.FindPatternSelf("80 3D 8F 7C 1E 22 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr(); ADDRESS g_bEbisuSDKCvarInitialized = p_Host_Map_f_CompletionFunc.FindPatternSelf("80 3D 8F 7C 1E 22 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr();
ADDRESS g_qEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.FindPatternSelf("4C 89 05 C4 2B 0E 22", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr(); ADDRESS g_qEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.FindPatternSelf("4C 89 05 C4 2B 0E 22", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr();
#elif defined (GAMEDLL_S2) #elif defined (GAMEDLL_S2)
ADDRESS g_bEbisuSDKInitialized = p_EbisuSDK_Init_Tier0.FindPatternSelf("80 3D ?? ?? ?? ?? 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr(); ADDRESS g_bEbisuSDKInitialized = p_EbisuSDK_Init_Tier0.FindPatternSelf("80 3D ?? ?? ?? ?? 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr();
ADDRESS g_bEbisuSDKCvarInitialized = p_Map_Callback.FindPatternSelf("80 3D 43 2D 41 22 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr(); ADDRESS g_bEbisuSDKCvarInitialized = p_Host_Map_f_CompletionFunc.FindPatternSelf("80 3D 43 2D 41 22 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr();
ADDRESS g_qEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.FindPatternSelf("4C 89 05 74 2D 32 22", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr(); ADDRESS g_qEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.FindPatternSelf("4C 89 05 74 2D 32 22", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr();
#elif defined (GAMEDLL_S3) #elif defined (GAMEDLL_S3)
ADDRESS g_bEbisuSDKInitialized = p_EbisuSDK_Init_Tier0.FindPatternSelf("80 3D ?? ?? ?? ?? 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr(); ADDRESS g_bEbisuSDKInitialized = p_EbisuSDK_Init_Tier0.FindPatternSelf("80 3D ?? ?? ?? ?? 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr();
ADDRESS g_bEbisuSDKCvarInitialized = p_Map_Callback.FindPatternSelf("80 3D 23 54 2B 23 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr(); ADDRESS g_bEbisuSDKCvarInitialized = p_Host_Map_f_CompletionFunc.FindPatternSelf("80 3D 23 54 2B 23 00", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x7).GetPtr();
ADDRESS g_qEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.FindPatternSelf("4C 89 05 B4 2C 1C 23", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr(); ADDRESS g_qEbisuSDKCvarInitialized = p_EbisuSDK_CVar_Init.FindPatternSelf("4C 89 05 B4 2C 1C 23", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr();
#endif // GAMEDLL_* #endif // GAMEDLL_*
#endif // DEDICATED #endif // DEDICATED

View File

@ -22,7 +22,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void HNET_ShutDown(void* thisptr, const char* szReason, std::uint8_t a1, char a2) void HNET_ShutDown(void* thisptr, const char* szReason, std::uint8_t a1, char a2)
{ {
DownloadPlaylists_Callback(); // Re-load playlist from disk after getting disconnected from the server. DownloadPlaylists_f_CompletionFunc(); // Re-load playlist from disk after getting disconnected from the server.
NET_Shutdown(thisptr, szReason, a1, a2); NET_Shutdown(thisptr, szReason, a1, a2);
} }

View File

@ -564,7 +564,7 @@ void IBrowser::HostServerSection()
{ {
if (ImGui::Button("Reload Playlist from Disk##ServerHost_ReloadPlaylist", ImVec2(ImGui::GetWindowSize().x, 32))) if (ImGui::Button("Reload Playlist from Disk##ServerHost_ReloadPlaylist", ImVec2(ImGui::GetWindowSize().x, 32)))
{ {
DownloadPlaylists_Callback(); DownloadPlaylists_f_CompletionFunc();
CKeyValueSystem_InitPlaylist(); // Re-Init playlist. CKeyValueSystem_InitPlaylist(); // Re-Init playlist.
} }
} }

View File

@ -5,14 +5,14 @@ namespace
{ {
/* ==== CONCOMMANDCALLBACK ============================================================================================================================================== */ /* ==== CONCOMMANDCALLBACK ============================================================================================================================================== */
#if defined (GAMEDLL_S1) #if defined (GAMEDLL_S1)
ADDRESS p_Map_Callback = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x18\x55\x41\x56\x41\x00\x00\x00\x00\x40\x02", "xxxxxxxxx????xx"); ADDRESS p_Host_Map_f_CompletionFunc = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x18\x55\x41\x56\x41\x00\x00\x00\x00\x40\x02", "xxxxxxxxx????xx");
void (*Map_Callback)(CCommand* cmd, char a2) = (void (*)(CCommand*, char))p_Map_Callback.GetPtr(); /*48 89 5C 24 18 55 41 56 41 ?? ?? ?? ?? 40 02*/ void (*Host_Map_f_CompletionFunc)(CCommand* cmd, char a2) = (void (*)(CCommand*, char))p_Host_Map_f_CompletionFunc.GetPtr(); /*48 89 5C 24 18 55 41 56 41 ?? ?? ?? ?? 40 02*/
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3) #elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
ADDRESS p_Map_Callback = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x83\x3D", "xxxxxxxxx????xx"); ADDRESS p_Host_Map_f_CompletionFunc = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x55\x41\x56\x41\x57\x48\x81\xEC\x00\x00\x00\x00\x83\x3D", "xxxxxxxxx????xx");
void (*Map_Callback)(CCommand* cmd, char a2) = (void (*)(CCommand*, char))p_Map_Callback.GetPtr(); /*40 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 83 3D*/ void (*Host_Map_f_CompletionFunc)(CCommand* cmd, char a2) = (void (*)(CCommand*, char))p_Host_Map_f_CompletionFunc.GetPtr(); /*40 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 83 3D*/
#endif #endif
ADDRESS p_DownloadPlaylists_Callback = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x33\xC9\xC6\x05\x00\x00\x00\x00\x00\xE9\x00\x00\x00\x00", "xxxx?????x????"); ADDRESS p_DownloadPlaylists_f_CompletionFunc = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x33\xC9\xC6\x05\x00\x00\x00\x00\x00\xE9\x00\x00\x00\x00", "xxxx?????x????");
void (*DownloadPlaylists_Callback)() = (void(*)())p_DownloadPlaylists_Callback.GetPtr(); /*33 C9 C6 05 ?? ?? ?? ?? ?? E9 ?? ?? ?? ??*/ void (*DownloadPlaylists_f_CompletionFunc)() = (void(*)())p_DownloadPlaylists_f_CompletionFunc.GetPtr(); /*33 C9 C6 05 ?? ?? ?? ?? ?? E9 ?? ?? ?? ??*/
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -40,8 +40,8 @@ class HCompletion : public IDetour
{ {
virtual void debugp() virtual void debugp()
{ {
std::cout << "| FUN: Map_Callback : 0x" << std::hex << std::uppercase << p_Map_Callback.GetPtr() << std::setw(npad) << " |" << std::endl; std::cout << "| FUN: Host_Map_f_CompletionFunc : 0x" << std::hex << std::uppercase << p_Host_Map_f_CompletionFunc.GetPtr() << std::setw(npad) << " |" << std::endl;
std::cout << "| FUN: DownloadPlaylists_Callback : 0x" << std::hex << std::uppercase << p_DownloadPlaylists_Callback.GetPtr() << std::setw(npad) << " |" << std::endl; std::cout << "| FUN: DownloadPlaylist_f_CompletionFunc : 0x" << std::hex << std::uppercase << p_DownloadPlaylists_f_CompletionFunc.GetPtr() << std::setw(npad) << " |" << std::endl;
std::cout << "+----------------------------------------------------------------+" << std::endl; std::cout << "+----------------------------------------------------------------+" << std::endl;
} }
}; };