From 2f2b497aca23239406ce3f8d94f29f10d205a68b Mon Sep 17 00:00:00 2001 From: BobTheBob9 Date: Thu, 1 Sep 2022 23:08:58 +0100 Subject: add scriptdatatable.cpp rewrite --- NorthstarDLL/exploitfixes.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'NorthstarDLL/exploitfixes.cpp') diff --git a/NorthstarDLL/exploitfixes.cpp b/NorthstarDLL/exploitfixes.cpp index 3a9a504f..dbe065cc 100644 --- a/NorthstarDLL/exploitfixes.cpp +++ b/NorthstarDLL/exploitfixes.cpp @@ -13,12 +13,11 @@ ConVar* Cvar_ns_should_log_all_clientcommands; ConVar* Cvar_sv_cheats; -#define SHOULD_LOG (Cvar_ns_exploitfixes_log->m_Value.m_nValue > 0) #define BLOCKED_INFO(s) \ ( \ [=]() -> bool \ { \ - if (SHOULD_LOG) \ + if (Cvar_ns_exploitfixes_log->GetBool()) \ { \ std::stringstream stream; \ stream << "ExploitFixes.cpp: " << BLOCK_PREFIX << s; \ @@ -109,7 +108,6 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10 // Safety check for memory access if (MemoryAddress(entry).IsMemoryReadable(sizeof(*entry))) { - // Find null terminators bool nameValid = false, valValid = false; for (int i = 0; i < ENTRY_STR_LEN; i++) @@ -193,14 +191,6 @@ bool, __fastcall, (void* thisptr, void* pMsg)) // 40 55 56 48 83 EC 58 return BLOCKED_INFO("Invalid m_nNewCommands (" << msg->m_nNewCommands << ")"); } - // removing, as vanilla already limits num usercmds per frame - /*constexpr int NUMCMD_SANITY_LIMIT = 16; - if ((msg->m_nNewCommands + msg->m_nBackupCommands) > NUMCMD_SANITY_LIMIT) - { - return BLOCKED_INFO("Command count is too high (new: " << msg->m_nNewCommands << ", backup: " << msg->m_nBackupCommands << ")"); - - }*/ - if (msg->m_nLength <= 0) return BLOCKED_INFO("Invalid message length (" << msg->m_nLength << ")"); @@ -285,7 +275,7 @@ INVALID_CMD: 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 { - // somewhat temp, store the modname here, since we don't have a proper ptr to it rn + // somewhat temp, store the modname here, since we don't have a proper ptr in engine to it rn int iSize = strlen(pModName); R2::g_pModName = new char[iSize + 1]; strcpy(R2::g_pModName, pModName); -- cgit v1.2.3