aboutsummaryrefslogtreecommitdiff
path: root/primedev/shared/exploit_fixes/exploitfixes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'primedev/shared/exploit_fixes/exploitfixes.cpp')
-rw-r--r--primedev/shared/exploit_fixes/exploitfixes.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/primedev/shared/exploit_fixes/exploitfixes.cpp b/primedev/shared/exploit_fixes/exploitfixes.cpp
index 44651b3c..d96bc41e 100644
--- a/primedev/shared/exploit_fixes/exploitfixes.cpp
+++ b/primedev/shared/exploit_fixes/exploitfixes.cpp
@@ -55,6 +55,8 @@ 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
{
+ NOTE_UNUSED(thisptr);
+ NOTE_UNUSED(buffer);
return false;
}
@@ -103,7 +105,7 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10
auto entry = msg->m_ConVars + i;
// Safety check for memory access
- if (CMemoryAddress(entry).IsMemoryReadable(sizeof(*entry)))
+ if (CMemory(entry).IsMemoryReadable(sizeof(*entry)))
{
// Find null terminators
bool nameValid = false, valValid = false;
@@ -222,16 +224,24 @@ void, __fastcall, (void* buf, void* pCmd_move, void* pCmd_from)) // 4C 89 44 24
"ReadUsercmd (command_number delta: " + std::to_string(cmd->command_number - fromCmd->command_number) + "): ";
// fix invalid player angles
- cmd->worldViewAngles.MakeValid();
- cmd->attackangles.MakeValid();
- cmd->localViewAngles.MakeValid();
+ if (!cmd->worldViewAngles.IsValid())
+ cmd->worldViewAngles.Init();
+
+ if (!cmd->attackangles.IsValid())
+ cmd->attackangles.Init();
+
+ if (!cmd->localViewAngles.IsValid())
+ cmd->localViewAngles.Init();
// Fix invalid camera angles
- cmd->cameraPos.MakeValid();
- cmd->cameraAngles.MakeValid();
+ if (!cmd->cameraPos.IsValid())
+ cmd->cameraPos.Init();
+ if (!cmd->cameraAngles.IsValid())
+ cmd->cameraAngles.Init();
// Fix invaid movement vector
- cmd->move.MakeValid();
+ if (!cmd->move.IsValid())
+ cmd->move.Init();
if (cmd->frameTime <= 0 || cmd->tick_count == 0 || cmd->command_time <= 0)
{
@@ -413,9 +423,9 @@ ON_DLL_LOAD("engine.dll", EngineExploitFixes, (CModule module))
// patch to set bWasWritingStringTableSuccessful in CNetworkStringTableContainer::WriteBaselines if it fails
{
- CMemoryAddress writeAddress(&bWasWritingStringTableSuccessful - module.Offset(0x234EDC).m_nAddress);
+ CMemory writeAddress(&bWasWritingStringTableSuccessful - module.Offset(0x234EDC).GetPtr());
- CMemoryAddress addr = module.Offset(0x234ED2);
+ CMemory addr = module.Offset(0x234ED2);
addr.Patch("C7 05");
addr.Offset(2).Patch((BYTE*)&writeAddress, sizeof(writeAddress));
@@ -443,7 +453,7 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerExploitFixes, ConVar, (CModule module))
// Prevent these from actually doing anything
for (auto exportName : ANTITAMPER_EXPORTS)
{
- CMemoryAddress exportAddr = module.GetExport(exportName);
+ CMemory exportAddr = module.GetExportedFunction(exportName);
if (exportAddr)
{
// Just return, none of them have any args or are userpurge