From fb284307deea668c2a8bbb254a7d268b7fd5a7f8 Mon Sep 17 00:00:00 2001 From: Cedric Mercier Date: Mon, 19 Oct 2026 14:52:40 +0200 Subject: [PATCH 1/2] Support CS:S x86_64 - Read ScriptVariant_t::m_pszString with LoadAddressFromAddress: it was read as an Int32, which truncates the pointer on x86_64 (m_type stays at +8, the value union is 8 bytes on both). - gamedata: linux64 signatures (same symbols as linux). - CI: build with SourceMod 1.13.0.7427 (production) for 64-bit Address. Checked on CS:S x86 and x86_64 (build 11003710) with VScript Convars.SetValue: int, float and string values are decoded the same and rcon_password is blocked. --- .github/workflows/ci.yml | 3 ++- addons/sourcemod/gamedata/ServerCommandFilter.games.txt | 2 ++ addons/sourcemod/scripting/ServerCommandFilter.sp | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 767c0bf..954aeac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,8 @@ jobs: - name: Setup SourcePawn compiler uses: rumblefrog/setup-sp@v1.3.1 with: - version: "1.12.x" + # 1.13.0.7427 (production): 64-bit Address / LoadAddressFromAddress + version: "1.13.7427" github-token: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies diff --git a/addons/sourcemod/gamedata/ServerCommandFilter.games.txt b/addons/sourcemod/gamedata/ServerCommandFilter.games.txt index 9478bc8..6ded37d 100644 --- a/addons/sourcemod/gamedata/ServerCommandFilter.games.txt +++ b/addons/sourcemod/gamedata/ServerCommandFilter.games.txt @@ -8,12 +8,14 @@ { "library" "server" "linux" "@_ZL19SendToServerConsolePKc" + "linux64" "@_ZL19SendToServerConsolePKc" "windows" "\x55\x8B\xEC\x8B\x4D\x08\x85\xC9\x74\x2A\x83\x3D\x2A\x2A\x2A\x2A\x02" } "SetValue" { "library" "server" "linux" "@_ZN21CScriptConvarAccessor8SetValueEPKc12CVariantBaseI24CVariantDefaultAllocatorE" + "linux64" "@_ZN21CScriptConvarAccessor8SetValueEPKc12CVariantBaseI24CVariantDefaultAllocatorE" } } "Functions" diff --git a/addons/sourcemod/scripting/ServerCommandFilter.sp b/addons/sourcemod/scripting/ServerCommandFilter.sp index 9479da4..660d75f 100644 --- a/addons/sourcemod/scripting/ServerCommandFilter.sp +++ b/addons/sourcemod/scripting/ServerCommandFilter.sp @@ -766,6 +766,7 @@ public MRESReturn Detour_SetValue(DHookParam hParams) if (pVariant == Address_Null) return MRES_Ignored; + // ScriptVariant_t: 8-byte value union, then int16 m_type (same layout on x86 and x86_64) int iType = LoadFromAddress(pVariant + view_as
(8), NumberType_Int16); int iRawValue = LoadFromAddress(pVariant, NumberType_Int32); @@ -783,11 +784,12 @@ public MRESReturn Detour_SetValue(DHookParam hParams) } case FIELD_CSTRING: { - if (iRawValue == 0) + // m_pszString is a full pointer: 8 bytes on x86_64 + Address pString = LoadAddressFromAddress(pVariant); + if (pString == Address_Null) return MRES_Ignored; // Null string char szStringValue[256]; - Address pString = view_as
(iRawValue); bool bSuccess = false; for (int i = 0; i < sizeof(szStringValue) - 1; i++) From 856f229b3c73da94be6bef9fdf8251d0ccb5302b Mon Sep 17 00:00:00 2001 From: Cedric Mercier Date: Tue, 20 Oct 2026 00:11:24 +0200 Subject: [PATCH 2/2] chore: bump version to 1.4.0 --- addons/sourcemod/scripting/ServerCommandFilter.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/ServerCommandFilter.sp b/addons/sourcemod/scripting/ServerCommandFilter.sp index 660d75f..e781475 100644 --- a/addons/sourcemod/scripting/ServerCommandFilter.sp +++ b/addons/sourcemod/scripting/ServerCommandFilter.sp @@ -56,7 +56,7 @@ public Plugin myinfo = name = "ServerCommandFilter", author = "BotoX, .Rushaway, koen", description = "Filters server commands using user-defined rules for maps (point_servercommand/VScript)", - version = "1.3.2", + version = "1.4.0", url = "https://github.com/srcdslab/sm-plugin-ServerCommandFilter" };