From 1f6abdff6faa0716314ebbd166b7d84bec837913 Mon Sep 17 00:00:00 2001 From: jenz Date: Sun, 13 Mar 2022 11:43:04 +0100 Subject: [PATCH] new updated by madness fixing so only the client lags and nobody else --- rptcrashfix/gamedata/rptexploitfix.css.txt | 15 ---- rptcrashfix/gamedata/rptfixaddrs.css.txt | 46 +++++++++++ rptcrashfix/scripting/rptexploitfix.sp | 88 ---------------------- rptcrashfix/scripting/rptexploitfix3.sp | 27 +++++++ 4 files changed, 73 insertions(+), 103 deletions(-) delete mode 100644 rptcrashfix/gamedata/rptexploitfix.css.txt create mode 100644 rptcrashfix/gamedata/rptfixaddrs.css.txt delete mode 100644 rptcrashfix/scripting/rptexploitfix.sp create mode 100644 rptcrashfix/scripting/rptexploitfix3.sp diff --git a/rptcrashfix/gamedata/rptexploitfix.css.txt b/rptcrashfix/gamedata/rptexploitfix.css.txt deleted file mode 100644 index 2ee6192f..00000000 --- a/rptcrashfix/gamedata/rptexploitfix.css.txt +++ /dev/null @@ -1,15 +0,0 @@ -"Games" -{ - "cstrike" - { - "Signatures" - { - "CGameClient::ExecuteStringCommand()" - { - "library" "engine" - "linux" "@_ZN11CGameClient20ExecuteStringCommandEPKc" - "windows" "\x55\x89\xE5\x81\xEC\x48\x05\x00\x00" - } - } - } -} \ No newline at end of file diff --git a/rptcrashfix/gamedata/rptfixaddrs.css.txt b/rptcrashfix/gamedata/rptfixaddrs.css.txt new file mode 100644 index 00000000..277ab47f --- /dev/null +++ b/rptcrashfix/gamedata/rptfixaddrs.css.txt @@ -0,0 +1,46 @@ +"Games" +{ + "cstrike" + { + "Addresses" + { + "aRptServerEnabl_ptr" + { + "windows" + { + "signature" "aRptServerEnabl_ptr_" + } + "linux" + { + "signature" "aRptServerEnabl_ptr_" + } + } + "aRptClientEnabl_ptr" + { + "windows" + { + "signature" "aRptClientEnabl_ptr_" + } + "linux" + { + "signature" "aRptClientEnabl_ptr_" + } + } + } + "Signatures" + { + "aRptServerEnabl_ptr_" + { + "library" "engine" + "windows" "\x72\x70\x74\x5F\x73\x65\x72\x76\x65\x72" + "linux" "\x72\x70\x74\x5F\x73\x65\x72\x76\x65\x72" + } + "aRptClientEnabl_ptr_" + { + "library" "engine" + "windows" "\x72\x70\x74\x5F\x63\x6C\x69\x65\x6E\x74" + "linux" "\x72\x70\x74\x5F\x63\x6C\x69\x65\x6E\x74" + } + } + } +} \ No newline at end of file diff --git a/rptcrashfix/scripting/rptexploitfix.sp b/rptcrashfix/scripting/rptexploitfix.sp deleted file mode 100644 index 021da8f5..00000000 --- a/rptcrashfix/scripting/rptexploitfix.sp +++ /dev/null @@ -1,88 +0,0 @@ -#pragma semicolon 1 - -#define PLUGIN_AUTHOR "null138" -#define PLUGIN_VERSION "1.00" - -#include -#include -#include -// linux -#define GetPlayerSlotOffs 3 -#pragma newdecls required -Handle hExecuteStringCommand; -Handle hGetPlayerSlot; - -public Plugin myinfo = -{ - name = "RPT Exploit Fixer", - author = PLUGIN_AUTHOR, - description = "Fixes latest RPT server exploit", - version = PLUGIN_VERSION, - url = "https://steamcommunity.com/id/null138/" -} - -public void OnPluginStart() -{ - Handle conf = LoadGameConfigFile("rptexploitfix.css"); - if (conf == INVALID_HANDLE) - SetFailState("Failed to load gamedata rptexploitfix.css"); - - hExecuteStringCommand = DHookCreateDetour(Address_Null, CallConv_THISCALL, ReturnType_Bool, ThisPointer_Address); - if (!hExecuteStringCommand) - SetFailState("Failed to setup detour for CGameClient::ExecuteStringCommand()"); - - if (!DHookSetFromConf(hExecuteStringCommand, conf, SDKConf_Signature, "CGameClient::ExecuteStringCommand()")) - SetFailState("Failed to load CGameClient::ExecuteStringCommand() signature from gamedata"); - - DHookAddParam(hExecuteStringCommand, HookParamType_CharPtr); - - if (!DHookEnableDetour(hExecuteStringCommand, false, ExecuteStringCommand)) - SetFailState("Failed to detour CGameClient::ExecuteStringCommand()"); - - // And a post hook. - if (!DHookEnableDetour(hExecuteStringCommand, true, Detour_OnExecuteStringCommand_Post)) - SetFailState("Failed to detour ExecuteStringCommand post."); - - // Setup quick hack to get the client index of the IClient this pointer in the detour callback. - StartPrepSDKCall(SDKCall_Raw); - PrepSDKCall_SetVirtual(GetPlayerSlotOffs); - PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain); - hGetPlayerSlot = EndPrepSDKCall(); - delete conf; -} - - -public MRESReturn Detour_OnExecuteStringCommand_Post(Address pThis, Handle hReturn, Handle hParams) -{ - int client = SDKCall(hGetPlayerSlot, pThis) + 1; - char sBuffer[512]; - DHookGetParamString(hParams, 1, sBuffer, sizeof(sBuffer)); - if((sBuffer[0] == 'r' && sBuffer[1] == 'p' && sBuffer[2] == 't')) - { - if(IsClientInGame(client) && !IsClientSourceTV(client)) - { - LogMessage("client: %N wanted command pre: %s", client, sBuffer); - KickClient(client, "DO NOT USE EXPLOITS ON THIS SERVER"); - } - } - -} - - -public MRESReturn ExecuteStringCommand(Address addrThis, Handle hReturn, Handle hParams) -{ - int client = SDKCall(hGetPlayerSlot, addrThis) + 1; - - char cmd[512]; - DHookGetParamString(hParams, 1, cmd, 512); - // "rpt", "rpt_" - if((cmd[0] == 'r' && cmd[1] == 'p' && cmd[2] == 't')) - { - if(IsClientInGame(client) && !IsClientSourceTV(client)) - { - LogMessage("client: %N wanted command pre: %s", client, cmd); - KickClient(client, "DO NOT USE EXPLOITS ON THIS SERVER"); - } - } - return MRES_Ignored; -} diff --git a/rptcrashfix/scripting/rptexploitfix3.sp b/rptcrashfix/scripting/rptexploitfix3.sp new file mode 100644 index 00000000..adf652cf --- /dev/null +++ b/rptcrashfix/scripting/rptexploitfix3.sp @@ -0,0 +1,27 @@ +#pragma semicolon 1 + +#define PLUGIN_AUTHOR "null138" +#define PLUGIN_VERSION "3.00" + +#include + +#pragma newdecls required + +public Plugin myinfo = +{ + name = "RPT Exploit Fixer", + author = PLUGIN_AUTHOR, + description = "Fixes latest RPT server exploit on linux", + version = PLUGIN_VERSION, + url = "https://steamcommunity.com/id/null138/" +} + +public void OnPluginStart() +{ + Address aRptServerEnabl = GameConfGetAddress(LoadGameConfigFile("rptfixaddrs.css"), "aRptServerEnabl_ptr"); + Address aRptClientEnabl = GameConfGetAddress(LoadGameConfigFile("rptfixaddrs.css"), "aRptClientEnabl_ptr"); + if (aRptServerEnabl) + StoreToAddress(aRptServerEnabl, 0x0, NumberType_Int8); + if (aRptClientEnabl) + StoreToAddress(aRptClientEnabl, 0x0, NumberType_Int8); +}