aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/miscserverfixes.cpp
diff options
context:
space:
mode:
authorKittenPopo <Pokeberry123@gmail.com>2022-03-23 13:03:56 -0700
committerGitHub <noreply@github.com>2022-03-23 20:03:56 +0000
commitde7deafc7e6ba53deec8dd3c05d2ea5e7cf42264 (patch)
tree5bc5c82c9b720adbf02cdaeb505f46b48a02178f /NorthstarDedicatedTest/miscserverfixes.cpp
parent5893c7700653e5f3d51c4f7eba7f6f25a2fe5be7 (diff)
downloadNorthstarLauncher-de7deafc7e6ba53deec8dd3c05d2ea5e7cf42264.tar.gz
NorthstarLauncher-de7deafc7e6ba53deec8dd3c05d2ea5e7cf42264.zip
Implement KittenPopo exploit fixes (and sanity changes) (#112)
* Added main exploit fixes * Fixed typo in sigscanning.cpp * Fully implemented * Added proper includes for new files * Update README.md * typo * spare me my sanity (fixed ridiculous code) * Added rest of KittenMemUtils * Rename KittenMemUtils * Removed all messy memory edits, implemented NSMem instead * Update NorthstarDedicatedTest.vcxproj * [1] Move everything from securitypatches to ExploitFixes * [2] Move everything from securitypatches to ExploitFixes * Fixed module offsets in stack trace * Fixed UTF8 Parsing (Multiplayer Crash) * Implemented UT8 fix * Update NorthstarDedicatedTest.vcxproj * Update hookutils.cpp * Small fixes * all my homies hate clang-format * Temporarily restore README.md
Diffstat (limited to 'NorthstarDedicatedTest/miscserverfixes.cpp')
-rw-r--r--NorthstarDedicatedTest/miscserverfixes.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/NorthstarDedicatedTest/miscserverfixes.cpp b/NorthstarDedicatedTest/miscserverfixes.cpp
index fca9c169..0b9a12db 100644
--- a/NorthstarDedicatedTest/miscserverfixes.cpp
+++ b/NorthstarDedicatedTest/miscserverfixes.cpp
@@ -2,32 +2,26 @@
#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
{
- char* ptr = reinterpret_cast<char*>(baseAddress) + 0x153920;
- TempReadWrite rw(ptr);
- *ptr = 0xC3;
+ NSMem::BytePatch(ba + 0x153920, {0xC3});
}
}