diff options
-rw-r--r-- | NorthstarDedicatedTest/ExploitFixes.cpp | 13 | ||||
-rw-r--r-- | NorthstarDedicatedTest/ExploitFixes.h | 3 | ||||
-rw-r--r-- | NorthstarDedicatedTest/dllmain.cpp | 1 |
3 files changed, 15 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/ExploitFixes.cpp b/NorthstarDedicatedTest/ExploitFixes.cpp index 9abc6b66..44b62d55 100644 --- a/NorthstarDedicatedTest/ExploitFixes.cpp +++ b/NorthstarDedicatedTest/ExploitFixes.cpp @@ -272,7 +272,11 @@ INVALID_CMD: // this is HORRIBLE for security, because it means servers can run arbitrary concommands on clients // especially since we have script commands this could theoretically be awful #include "gameutils.h" -KHOOK(IsValveMod, ("engine.dll", "48 83 EC 28 48 8B 0D ? ? ? ? 48 8D 15 ? ? ? ? E8 ? ? ? ? 85 C0 74 63"), bool, __fastcall, ()) + +typedef void (*IsValveModType)(); +IsValveModType IsValveMod; + +bool IsValveModHook() { return !CommandLine()->CheckParm("-norestrictservercommands"); } @@ -511,4 +515,11 @@ void ExploitFixes::LoadCallback(HMODULE baseAddress) HookEnabler hook; ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x2a8a50, &GetEntByIndexHook, reinterpret_cast<LPVOID*>(&GetEntByIndex)); +} + +void ExploitFixes::LoadCallbackEngine(HMODULE baseAddress) +{ + spdlog::info("ExploitFixes::LoadCallbackEngine ..."); + HookEnabler hook; + ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x1C6360, &IsValveModHook, reinterpret_cast<LPVOID*>(&IsValveMod)); }
\ No newline at end of file diff --git a/NorthstarDedicatedTest/ExploitFixes.h b/NorthstarDedicatedTest/ExploitFixes.h index 7a407a3d..1cafe758 100644 --- a/NorthstarDedicatedTest/ExploitFixes.h +++ b/NorthstarDedicatedTest/ExploitFixes.h @@ -6,4 +6,5 @@ namespace ExploitFixes { void LoadCallback(HMODULE unused); -}
\ No newline at end of file + void LoadCallbackEngine(HMODULE baseAddress); +} // namespace ExploitFixes
\ No newline at end of file diff --git a/NorthstarDedicatedTest/dllmain.cpp b/NorthstarDedicatedTest/dllmain.cpp index fc403e95..08081d78 100644 --- a/NorthstarDedicatedTest/dllmain.cpp +++ b/NorthstarDedicatedTest/dllmain.cpp @@ -287,6 +287,7 @@ bool InitialiseNorthstar() // activate exploit fixes AddDllLoadCallback("server.dll", ExploitFixes::LoadCallback); + AddDllLoadCallback("engine.dll", ExploitFixes::LoadCallbackEngine); // run callbacks for any libraries that are already loaded by now CallAllPendingDLLLoadCallbacks(); |