From 1d51a08cc727818541628d51313177453f79ee80 Mon Sep 17 00:00:00 2001 From: "C.S. Melis" Date: Wed, 13 Dec 2023 11:38:54 +0100 Subject: [PATCH] Add MP Server check --- def/Common.def | 1 + include/Common.h | 2 ++ src/main.cpp | 10 ++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/def/Common.def b/def/Common.def index 98c7396..f719401 100644 --- a/def/Common.def +++ b/def/Common.def @@ -10,3 +10,4 @@ EXPORTS ?get_value_float@INI_Reader@@QAEMI@Z ?get_value_string@INI_Reader@@QAEPBDI@Z ?close@INI_Reader@@QAEXXZ +?IsMPServer@@YA_NXZ diff --git a/include/Common.h b/include/Common.h index 86e49b8..00e513e 100644 --- a/include/Common.h +++ b/include/Common.h @@ -24,3 +24,5 @@ class Import INI_Reader private: BYTE data[0x1565]; }; + +bool Import IsMPServer(); diff --git a/src/main.cpp b/src/main.cpp index 34128ab..5cc671e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -174,16 +174,18 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) UNREFERENCED_PARAMETER(lpReserved); // TODO: Support FLServer - // TODO: Hook Server.dll load on client - // IsMPServer common.dll might be useful // Call set value functions common.dll // Split up into multiple files + // Define hard coded addresses if (fdwReason == DLL_PROCESS_ATTACH) { Init(); - DWORD loadLibraryAddrFl = 0x5B6F48; - SetLoadLibraryAHook(loadLibraryAddrFl); + if (!IsMPServer()) + { + DWORD loadLibraryAddrFl = 0x5B6F48; + SetLoadLibraryAHook(loadLibraryAddrFl); + } } return TRUE;