diff options
author | Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> | 2022-03-24 00:55:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 00:55:20 +0100 |
commit | b5405b462656b83a37bf1eb41b049b0913980a13 (patch) | |
tree | b9e48626b49782161ddaff84ae257bfece72c257 /NorthstarDedicatedTest/miscserverfixes.cpp | |
parent | 178f1deca8fe94167307e1717cee7250a3f3b8b4 (diff) | |
parent | de7deafc7e6ba53deec8dd3c05d2ea5e7cf42264 (diff) | |
download | NorthstarLauncher-b5405b462656b83a37bf1eb41b049b0913980a13.tar.gz NorthstarLauncher-b5405b462656b83a37bf1eb41b049b0913980a13.zip |
Merge branch 'main' into NetCon
Diffstat (limited to 'NorthstarDedicatedTest/miscserverfixes.cpp')
-rw-r--r-- | NorthstarDedicatedTest/miscserverfixes.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/NorthstarDedicatedTest/miscserverfixes.cpp b/NorthstarDedicatedTest/miscserverfixes.cpp index 334c5fa3..0b9a12db 100644 --- a/NorthstarDedicatedTest/miscserverfixes.cpp +++ b/NorthstarDedicatedTest/miscserverfixes.cpp @@ -2,23 +2,30 @@ #include "miscserverfixes.h" #include "hookutils.h" +#include "NSMem.h" + void InitialiseMiscServerFixes(HMODULE baseAddress) { + uintptr_t ba = (uintptr_t)baseAddress; + // ret at the start of the concommand GenerateObjFile as it can crash servers { - char* ptr = reinterpret_cast<char*>(baseAddress) + 0x38D920; - TempReadWrite rw(ptr); - *ptr = 0xC3; + NSMem::BytePatch(ba + 0x38D920, {0xC3}); } // nop out call to VGUI shutdown since it crashes the game when quitting from the console { - char* ptr = reinterpret_cast<char*>(baseAddress) + 0x154A96; - TempReadWrite rw(ptr); - *(ptr++) = 0x90; // nop - *(ptr++) = 0x90; // nop - *(ptr++) = 0x90; // nop - *(ptr++) = 0x90; // nop - *ptr = 0x90; // nop + NSMem::NOP(ba + 0x154A96, 5); } + + // ret at the start of CServerGameClients::ClientCommandKeyValues as it has no benefit and is forwarded to client (i.e. security issue) + // this prevents the attack vector of client=>server=>client, however server=>client also has clientside patches + { + NSMem::BytePatch(ba + 0x153920, {0xC3}); + } +} + +void InitialiseMiscEngineServerFixes(HMODULE baseAddress) +{ + }
\ No newline at end of file |