diff options
Diffstat (limited to 'NorthstarDLL/exploitfixes.cpp')
-rw-r--r-- | NorthstarDLL/exploitfixes.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/NorthstarDLL/exploitfixes.cpp b/NorthstarDLL/exploitfixes.cpp index 419fc448..811961f1 100644 --- a/NorthstarDLL/exploitfixes.cpp +++ b/NorthstarDLL/exploitfixes.cpp @@ -29,27 +29,35 @@ ConVar* Cvar_sv_cheats; // block bad netmessages // Servers can literally request a screenshot from any client, yeah no +// clang-format off AUTOHOOK(CLC_Screenshot_WriteToBuffer, engine.dll + 0x22AF20, bool, __fastcall, (void* thisptr, void* buffer)) // 48 89 5C 24 ? 57 48 83 EC 20 8B 42 10 +// clang-format on { return false; } +// clang-format off AUTOHOOK(CLC_Screenshot_ReadFromBuffer, engine.dll + 0x221F00, bool, __fastcall, (void* thisptr, void* buffer)) // 48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B DA 48 8B 52 38 +// clang-format on { return false; } // This is unused ingame and a big client=>server=>client exploit vector +// clang-format off AUTOHOOK(Base_CmdKeyValues_ReadFromBuffer, engine.dll + 0x220040, bool, __fastcall, (void* thisptr, void* buffer)) // 40 55 48 81 EC ? ? ? ? 48 8D 6C 24 ? 48 89 5D 70 +// clang-format on { return false; } +// clang-format off AUTOHOOK(CClient_ProcessSetConVar, engine.dll + 0x75CF0, bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10 +// clang-format on { constexpr int ENTRY_STR_LEN = 260; @@ -147,8 +155,10 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10 } // prevent invalid user CMDs +// clang-format off AUTOHOOK(CClient_ProcessUsercmds, engine.dll + 0x1040F0, bool, __fastcall, (void* thisptr, void* pMsg)) // 40 55 56 48 83 EC 58 +// clang-format on { struct CLC_Move { @@ -181,8 +191,10 @@ bool, __fastcall, (void* thisptr, void* pMsg)) // 40 55 56 48 83 EC 58 return CClient_ProcessUsercmds(thisptr, pMsg); } +// clang-format off AUTOHOOK(ReadUsercmd, server.dll + 0x2603F0, void, __fastcall, (void* buf, void* pCmd_move, void* pCmd_from)) // 4C 89 44 24 ? 53 55 56 57 +// clang-format on { // Let normal usercmd read happen first, it's safe ReadUsercmd(buf, pCmd_move, pCmd_from); @@ -256,8 +268,10 @@ INVALID_CMD: // ensure that GetLocalBaseClient().m_bRestrictServerCommands is set correctly, which the return value of this function controls // this is IsValveMod in source, but we're making it IsRespawnMod now since valve didn't make this one +// clang-format off AUTOHOOK(IsRespawnMod, engine.dll + 0x1C6360, bool, __fastcall, (const char* pModName)) // 48 83 EC 28 48 8B 0D ? ? ? ? 48 8D 15 ? ? ? ? E8 ? ? ? ? 85 C0 74 63 +// clang-format on { // somewhat temp, store the modname here, since we don't have a proper ptr in engine to it rn int iSize = strlen(pModName); @@ -270,8 +284,10 @@ bool, __fastcall, (const char* pModName)) // 48 83 EC 28 48 8B 0D ? ? ? ? 48 8D // ratelimit stringcmds, and prevent remote clients from calling commands that they shouldn't bool (*CCommand__Tokenize)(CCommand& self, const char* pCommandString, R2::cmd_source_t commandSource); +// clang-format off AUTOHOOK(CGameClient__ExecuteStringCommand, engine.dll + 0x1022E0, bool, , (R2::CBaseClient* self, uint32_t unknown, const char* pCommandString)) +// clang-format on { if (Cvar_ns_should_log_all_clientcommands->GetBool()) spdlog::info("player {} (UID: {}) sent command: \"{}\"", self->m_Name, self->m_UID, pCommandString); @@ -341,8 +357,10 @@ engine.dll + 0x1022E0, bool, , (R2::CBaseClient* self, uint32_t unknown, const c // prevent clients from crashing servers through overflowing CNetworkStringTableContainer::WriteBaselines bool bWasWritingStringTableSuccessful; +// clang-format off AUTOHOOK(CBaseClient__SendServerInfo, engine.dll + 0x104FB0, void, , (void* self)) +// clang-format on { bWasWritingStringTableSuccessful = true; CBaseClient__SendServerInfo(self); @@ -353,8 +371,10 @@ engine.dll + 0x104FB0, void, , (void* self)) // return null when GetEntByIndex is passed an index >= 0x4000 // this is called from exactly 1 script clientcommand that can be given an arbitrary index, and going above 0x4000 crashes +// clang-format off AUTOHOOK(GetEntByIndex, engine.dll + 0x2A8A50, void*,, (int i)) +// clang-format on { const int MAX_ENT_IDX = 0x4000; |