From f891fc272c75c302b8f276ef1bcdca5a5b139c5d Mon Sep 17 00:00:00 2001 From: jenz Date: Thu, 17 Mar 2022 21:21:20 +0100 Subject: [PATCH] further updates by madness to block spam commands away --- .../gamedata/cmdexploitsfix.games.txt | 114 ++++++++++++++++++ .../scripting/cmdexploitsfixer.sp | 45 +++++++ 2 files changed, 159 insertions(+) create mode 100644 madness_cmdexploitsfix/gamedata/cmdexploitsfix.games.txt create mode 100644 madness_cmdexploitsfix/scripting/cmdexploitsfixer.sp diff --git a/madness_cmdexploitsfix/gamedata/cmdexploitsfix.games.txt b/madness_cmdexploitsfix/gamedata/cmdexploitsfix.games.txt new file mode 100644 index 00000000..a4e7d7c1 --- /dev/null +++ b/madness_cmdexploitsfix/gamedata/cmdexploitsfix.games.txt @@ -0,0 +1,114 @@ +"Games" +{ + "cstrike" + { + "Addresses" + { + "aRptServerEnabl_ptr" + { + "windows" + { + "signature" "aRptServerEnabl_ptr_" + } + "linux" + { + "signature" "aRptServerEnabl_ptr_" + } + } + "aVehiclerole_ptr" + { + "windows" + { + "signature" "aVehiclerole_ptr_" + } + "linux" + { + "signature" "aVehiclerole_ptr_" + } + } + "aPlayerperf_ptr" + { + "windows" + { + "signature" "aPlayerperf_ptr_" + } + "linux" + { + "signature" "aPlayerperf_ptr_" + } + } + "aVehicleFlushsc_ptr" + { + "windows" + { + "signature" "aVehicleFlushsc_ptr_" + } + "linux" + { + "signature" "aVehicleFlushsc_ptr_" + } + } + "aAiDebugNodeCon_ptr" + { + "windows" + { + "signature" "aAiDebugNodeCon_ptr_" + } + "linux" + { + "signature" "aAiDebugNodeCon_ptr_" + } + } + "aAiSetMoveHeigh_ptr" + { + "windows" + { + "signature" "aAiSetMoveHeigh_ptr_" + } + "linux" + { + "signature" "aAiSetMoveHeigh_ptr_" + } + } + } + "Signatures" + { + "aRptServerEnabl_ptr_" + { + "library" "engine" + "windows" "\x72\x70\x74\x5f\x73\x65\x72\x76\x65\x72\x5f\x65\x6e\x61\x62\x6c\x65" + "linux" "\x72\x70\x74\x5f\x73\x65\x72\x76\x65\x72\x5f\x65\x6e\x61\x62\x6c\x65" + } + "aVehiclerole_ptr_" + { + "library" "server" + "windows" "\x76\x65\x68\x69\x63\x6C\x65\x52\x6F\x6C" + "linux" "\x76\x65\x68\x69\x63\x6C\x65\x52\x6F\x6C" + } + "aPlayerperf_ptr_" + { + "library" "server" + "windows" "\x70\x6C\x61\x79\x65\x72\x70\x65\x72\x66\x00" + "linux" "\x70\x6C\x61\x79\x65\x72\x70\x65\x72\x66" + } + "aVehicleFlushsc_ptr_" + { + "library" "server" + "windows" "\x76\x65\x68\x69\x63\x6C\x65\x5F\x66\x6C\x75\x73\x68\x73\x63\x72\x69\x70\x74\x00" + "linux" "\x76\x65\x68\x69\x63\x6C\x65\x5F\x66\x6C\x75\x73\x68\x73\x63\x72\x69\x70\x74\x00" + } + "aAiDebugNodeCon_ptr_" + { + "library" "server" + "windows" "\x61\x69\x5F\x64\x65\x62\x75\x67\x5F\x6E\x6F\x64\x65\x5F\x63\x6F\x6E\x6E\x65\x63" + "linux" "\x61\x69\x5F\x64\x65\x62\x75\x67\x5F\x6E\x6F\x64\x65\x5F\x63\x6F\x6E\x6E\x65\x63" + } + "aAiSetMoveHeigh_ptr_" + { + "library" "server" + "windows" "\x61\x69\x5F\x73\x65\x74\x5F\x6D\x6F\x76\x65\x5F\x68\x65\x69\x67\x68\x74\x5F\x65" + "linux" "\x61\x69\x5F\x73\x65\x74\x5F\x6D\x6F\x76\x65\x5F\x68\x65\x69\x67\x68\x74\x5F\x65" + } + } + } +} \ No newline at end of file diff --git a/madness_cmdexploitsfix/scripting/cmdexploitsfixer.sp b/madness_cmdexploitsfix/scripting/cmdexploitsfixer.sp new file mode 100644 index 00000000..59969e27 --- /dev/null +++ b/madness_cmdexploitsfix/scripting/cmdexploitsfixer.sp @@ -0,0 +1,45 @@ +#pragma semicolon 1 + +#define PLUGIN_AUTHOR "null138" +#define PLUGIN_VERSION "3.00" + +#include + +#pragma newdecls required + +public Plugin myinfo = +{ + name = "Command Exploits Fixer", + author = PLUGIN_AUTHOR, + description = "Fixes command exploits", + version = PLUGIN_VERSION, + url = "https://steamcommunity.com/id/null138/" +} + +public void OnPluginStart() +{ + Address addr; + addr = GameConfGetAddress(LoadGameConfigFile("cmdexploitsfix"), "aRptServerEnabl_ptr"); + // addr + 0xAD648 (710216) is pointer to exact line in static const char * s_clcommands[] + if(addr) StoreToAddress(addr + view_as
(0xAD648), 0x0, NumberType_Int32); + + addr = GameConfGetAddress(LoadGameConfigFile("cmdexploitsfix"), "aVehiclerole_ptr"); + if(addr) + StoreToAddress(addr, 0x0, NumberType_Int8); + + addr = GameConfGetAddress(LoadGameConfigFile("cmdexploitsfix"), "aPlayerperf_ptr"); + if(addr) + StoreToAddress(addr, 0x0, NumberType_Int8); + + addr = GameConfGetAddress(LoadGameConfigFile("cmdexploitsfix"), "aVehicleFlushsc_ptr"); + if(addr) + StoreToAddress(addr, 0x0, NumberType_Int8); + + addr = GameConfGetAddress(LoadGameConfigFile("cmdexploitsfix"), "aAiDebugNodeCon_ptr"); + if(addr) + StoreToAddress(addr, 0x0, NumberType_Int8); + + addr = GameConfGetAddress(LoadGameConfigFile("cmdexploitsfix"), "aAiSetMoveHeigh_ptr"); + if(addr) + StoreToAddress(addr, 0x0, NumberType_Int8); +}