aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/ExploitFixes.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 00:40:53 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 00:40:53 +0100
commitf230156cbebc1b93db5e254410ee2ab3a8dcb27c (patch)
treee98c72fabbff37a55e7f9216c52e4f8ef2084073 /NorthstarDedicatedTest/ExploitFixes.cpp
parent6c8112a6c368dd36d21fd94689e9682bc3b012a5 (diff)
downloadNorthstarLauncher-f230156cbebc1b93db5e254410ee2ab3a8dcb27c.tar.gz
NorthstarLauncher-f230156cbebc1b93db5e254410ee2ab3a8dcb27c.zip
use in-file macros rather than global funcs for registering dll load callbacks
Diffstat (limited to 'NorthstarDedicatedTest/ExploitFixes.cpp')
-rw-r--r--NorthstarDedicatedTest/ExploitFixes.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/NorthstarDedicatedTest/ExploitFixes.cpp b/NorthstarDedicatedTest/ExploitFixes.cpp
index db754ad5..257ec428 100644
--- a/NorthstarDedicatedTest/ExploitFixes.cpp
+++ b/NorthstarDedicatedTest/ExploitFixes.cpp
@@ -2,6 +2,7 @@
#include "ExploitFixes.h"
#include "ExploitFixes_UTF8Parser.h"
+#include "hooks.h"
#include "NSMem.h"
#include "cvar.h"
@@ -46,6 +47,8 @@ struct Angle
bool IsInvalid()
{
+ return !ValidateFloats(pitch, yaw, roll);
+
if (!ValidateFloats(pitch, yaw, roll))
return false;
@@ -205,12 +208,14 @@ KHOOK(CClient_ProcessUsercmds, ("engine.dll", "40 55 56 48 83 EC 58"), bool, __f
{
return BLOCKED_INFO("Invalid m_nNewCommands (" << msg->m_nNewCommands << ")");
}
-
- constexpr int NUMCMD_SANITY_LIMIT = 16;
+
+ // 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 << ")");
@@ -394,7 +399,7 @@ void DoBytePatches()
}
}
-void ExploitFixes::LoadCallback(HMODULE unused)
+ON_DLL_LOAD_RELIESON("server.dll", ExploitFixes, ConVar, (HMODULE baseAddress)
{
spdlog::info("ExploitFixes::LoadCallback ...");
@@ -416,4 +421,4 @@ void ExploitFixes::LoadCallback(HMODULE unused)
ns_exploitfixes_log =
new ConVar("ns_exploitfixes_log", "1", FCVAR_GAMEDLL, "Whether to log whenever ExploitFixes.cpp blocks/corrects something");
-} \ No newline at end of file
+}) \ No newline at end of file