diff options
author | KittenPopo <Pokeberry123@gmail.com> | 2022-03-23 13:03:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-23 20:03:56 +0000 |
commit | de7deafc7e6ba53deec8dd3c05d2ea5e7cf42264 (patch) | |
tree | 5bc5c82c9b720adbf02cdaeb505f46b48a02178f /NorthstarDedicatedTest/securitypatches.cpp | |
parent | 5893c7700653e5f3d51c4f7eba7f6f25a2fe5be7 (diff) | |
download | NorthstarLauncher-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/securitypatches.cpp')
-rw-r--r-- | NorthstarDedicatedTest/securitypatches.cpp | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/NorthstarDedicatedTest/securitypatches.cpp b/NorthstarDedicatedTest/securitypatches.cpp deleted file mode 100644 index 9352559a..00000000 --- a/NorthstarDedicatedTest/securitypatches.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "pch.h" -#include "securitypatches.h" -#include "hookutils.h" -#include "concommand.h" -#include "gameutils.h" -#include "convar.h" - -typedef bool (*IsValveModType)(); -IsValveModType IsValveMod; - -bool IsValveModHook() -{ - // basically: by default r2 isn't set as a valve mod, meaning that m_bRestrictServerCommands is false - // 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 - return !CommandLine()->CheckParm("-norestrictservercommands"); -} - -typedef bool (*SVC_CmdKeyValues__ReadFromBufferType)(void* a1, void* a2); -SVC_CmdKeyValues__ReadFromBufferType SVC_CmdKeyValues__ReadFromBuffer; -// never parse server=>client keyvalues for clientcommandkeyvalues -bool SVC_CmdKeyValues__ReadFromBufferHook(void* a1, void* a2) { return false; } - -void InitialiseClientEngineSecurityPatches(HMODULE baseAddress) -{ - HookEnabler hook; - - // note: this could break some things - ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x1C6360, &IsValveModHook, reinterpret_cast<LPVOID*>(&IsValveMod)); - ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x222E70, &SVC_CmdKeyValues__ReadFromBufferHook, reinterpret_cast<LPVOID*>(&SVC_CmdKeyValues__ReadFromBuffer)); - - // patches to make commands run from client/ui script still work - // note: this is likely preventable in a nicer way? test prolly - { - void* ptr = (char*)baseAddress + 0x4FB65; - TempReadWrite rw(ptr); - - *((char*)ptr) = (char)0xEB; - *((char*)ptr + 1) = (char)0x11; - } - - { - void* ptr = (char*)baseAddress + 0x4FBAC; - TempReadWrite rw(ptr); - - *((char*)ptr) = (char)0xEB; - *((char*)ptr + 1) = (char)0x16; - } - - // byte patches to patch concommands that this messes up that we need - { - // disconnect concommand - void* ptr = (char*)baseAddress + 0x5ADA2D; - TempReadWrite rw(ptr); - - *((int*)ptr) |= FCVAR_SERVER_CAN_EXECUTE; - } -}
\ No newline at end of file |