Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sapphonie/StAC-tf2 into refactor-…
Browse files Browse the repository at this point in the history
…namechange-bans

# Conflicts:
#	plugins/stac.smx
  • Loading branch information
sapphonie committed Jul 2, 2024
2 parents ffe784c + e43ed7e commit a0a1073
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 75 deletions.
Binary file removed extensions/connect.ext.2.ep2v.dll
Binary file not shown.
Binary file removed extensions/connect.ext.2.ep2v.so
Binary file not shown.
Binary file added extensions/connect.ext.2.tf2.dll
Binary file not shown.
Binary file added extensions/connect.ext.2.tf2.so
Binary file not shown.
Binary file added extensions/x64/connect.ext.2.tf2.dll
Binary file not shown.
Binary file added extensions/x64/connect.ext.2.tf2.so
Binary file not shown.
66 changes: 44 additions & 22 deletions gamedata/connect.games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,25 @@
"ISteamGameServer__BeginAuthSession"
{
"linux" "29"
"mac" "29"
"linux64" "29"
"windows" "29"
}

"ISteamGameServer__EndAuthSession"
{
"linux" "30"
"mac" "30"
"linux64" "30"
"windows" "30"
}
}

"Signatures"
{
"CBaseServer__CheckMasterServerRequestRestart"
{
"library" "engine"
"windows" "\xE8\x2A\x2A\x2A\x2A\x83\x78\x04\x00\x74\x2A\xE8\x2A\x2A\x2A\x2A\x8B\x48\x04\x8B\x01\x8B\x40\x2C\xFF\xD0\x84\xC0\x74\x2A\x56"
}

"Steam3Server"
{
"library" "engine"
"linux" "@_Z12Steam3Serverv"
"mac" "@_Z12Steam3Serverv"
"linux64" "@_Z12Steam3Serverv"
}
}
}
Expand All @@ -53,6 +47,14 @@
"engine" "hl2dm"
}

"Offsets"
{
"CheckMasterServerRequestRestart_Steam3ServerFuncOffset"
{
"windows" "1"
}
}

"Signatures"
{
"CBaseServer__ConnectClient"
Expand All @@ -79,12 +81,10 @@
"windows" "\x55\x8B\xEC\x8B\x55\x08\x8B\x02\x89\x41\x59\x8B\x42\x04"
}

"CBaseServer__CheckChallengeType"
"CBaseServer__CheckMasterServerRequestRestart"
{
"library" "engine"
"linux" "@_ZN11CBaseServer18CheckChallengeTypeEP11CBaseClientiR8netadr_siPKcii"
"mac" "@_ZN11CBaseServer18CheckChallengeTypeEP11CBaseClientiR8netadr_siPKcii"
"windows" "\x55\x8B\xEC\x83\xEC\x14\x56\x57\x8B\x7D\x2A\x8B\xF1"
"windows" "\xE8\x2A\x2A\x2A\x2A\x83\x78\x04\x00\x74\x2A\xE8\x2A\x2A\x2A\x2A\x8B\x48\x04\x8B\x01\x8B\x40\x2C\xFF\xD0\x84\xC0\x74\x2A\x56"
}
}
}
Expand All @@ -96,38 +96,60 @@
"engine" "tf2"
}

"Offsets"
{
"ISteamGameServer__BeginAuthSession"
{
"linux" "26"
"linux64" "26"
"windows" "26"
"windows64" "26"
}

"ISteamGameServer__EndAuthSession"
{
"linux" "27"
"linux64" "27"
"windows" "27"
"windows64" "27"
}

"CheckMasterServerRequestRestart_Steam3ServerFuncOffset"
{
"windows" "240"
}
}

"Signatures"
{
"CBaseServer__ConnectClient"
{
"library" "engine"
"linux" "@_ZN11CBaseServer13ConnectClientER8netadr_siiiiPKcS3_S3_i"
"mac" "@_ZN11CBaseServer13ConnectClientER8netadr_siiiiPKcS3_S3_i"
"windows" "\x55\x8B\xEC\x81\xEC\x24\x05\x00\x00"
"linux64" "@_ZN11CBaseServer13ConnectClientER8netadr_siiiiPKcS3_S3_i"
"windows" "\x55\x8B\xEC\x81\xEC\x24\x05\x00\x00\x53\x56\x57\x68\x2A\x2A\x2A\x2A"
}

"CBaseServer__RejectConnection"
{
"library" "engine"
"linux" "@_ZN11CBaseServer16RejectConnectionERK8netadr_siPKc"
"mac" "@_ZN11CBaseServer16RejectConnectionERK8netadr_siPKc"
"linux64" "@_ZN11CBaseServer16RejectConnectionERK8netadr_siPKc"
"windows" "\x55\x8B\xEC\x81\xEC\x04\x05\x00\x00\x57"
}

"CBaseClient__SetSteamID"
{
"library" "engine"
"linux" "@_ZN11CBaseClient10SetSteamIDERK8CSteamID"
"mac" "@_ZN11CBaseClient10SetSteamIDERK8CSteamID"
"windows" "\x55\x8B\xEC\x56\x57\x8B\x7D\x08\x8B\xF1\x8D\x4E\x04"
"linux64" "@_ZN11CBaseClient10SetSteamIDERK8CSteamID"
"windows" "\x55\x8B\xEC\x56\x8B\xF1\x57\x8B\x7D\x08\x8D\x4E\x04"
}

"CBaseServer__CheckChallengeType"
"CBaseServer__CheckMasterServerRequestRestart"
{
"library" "engine"
"linux" "@_ZN11CBaseServer18CheckChallengeTypeEP11CBaseClientiR8netadr_siPKcii"
"mac" "@_ZN11CBaseServer18CheckChallengeTypeEP11CBaseClientiR8netadr_siPKcii"
"windows" "\x55\x8B\xEC\x83\xEC\x14\x53\x8B\x5D\x14"
"windows" "\x55\x8B\xEC\x83\xEC\x1C\x53\x57\x33\xD2"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions gamedata/conplex.games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@
"ProcessAccept"
{
"library" "engine"
"windows" "\x55\x8B\xEC\x83\xEC\x24\x53\x57\x8D\x45\xF8\xC7\x45\xF8\x10\x00\x00\x00\x50"
"windows" "\x55\x8B\xEC\x83\xEC\x24\x53\x8B\xD9\x8B\x43\x18"
}

"RunFrame"
{
"library" "engine"
"windows" "\x55\x8B\xEC\xB8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x53\x8B\xD9\x56\x57"
"windows" "\x55\x8B\xEC\xB8\x60\x10\x00\x00"
}

"HandleFailedRconAuth"
{
"library" "engine"
"windows" "\x55\x8B\xEC\x83\xEC\x18\xA1\x2A\x2A\x2A\x2A\x8B\x15\x2A\x2A\x2A\x2A\x53\x56\x57"
"windows" "\x55\x8B\xEC\x83\xEC\x14\xF7\x05\x2A\x2A\x2A\x2A\x00\x10\x00\x00"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions gamedata/sourcetvmanager.games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,15 @@
"library" "engine"
"linux" "@host_client"
// ping(CCommand const&) "Client ping times:\n"
"windows" "\x55\x8B\xEC\x51\x83\x3D\x2A\x2A\x2A\x2A\x01\x75\x2A"
"windows" "\x55\x8B\xEC\x51\x83\x3D\x2A\x2A\x2A\x2A\x2A\x75\x11\x6A\x01\xFF\x75\x08\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x8B\xE5\x5D\xC3\x8B\x0D\x2A\x2A\x2A\x2A\x85"
}

"CHLTVServer::BroadcastEventLocal"
{
"library" "engine"
"linux" "@_ZN11CHLTVServer19BroadcastEventLocalEP10IGameEventb"
// "SourceTV broadcast local event: %s\n"
"windows" "\x55\x8B\xEC\x81\xEC\x48\x04\x00\x00\x53\x8B\xD9\xC6\x45\xBC\x01\x56\x8D\x4D\xD0\xC7\x45\xC0\x00\x00\x00\x00\xC7\x45\xC4\x00\x00\x00\x00\xC7\x45\x2A\x2A\x2A\x2A\x2A\xE8"
"windows" "\x55\x8B\xEC\x8B\x0D\x2A\x2A\x2A\x2A\x81\xEC\x4C\x04\x00\x00\x85\xC9\x0F\x84\x9A\x01\x00\x00\x8B\x41\x08\x83\xC1\x08\x8B\x40\x58\xFF\xD0\x84\xC0\x0F\x84\x87\x01\x00\x00\x8B\x0D"
}

"CHLTVServer::BroadcastLocalChat"
Expand Down
10 changes: 6 additions & 4 deletions gamedata/stac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,17 @@
{
/*
"Packet from %s after processing time exceeded (%d bytes pkt), aborting"
sub_101A0200 proc near
*/
"CNetChan::ProcessPacket"
{
"library" "engine"
"linux" "@_ZN8CNetChan13ProcessPacketEP11netpacket_sb"
"windows" "\x55\x8B\xEC\x83\xEC\x10\x53\x56\x57\x8B\x7D\x08\x8B\xD9\x83\x7F\x24\x00"
"windows" "\x55\x8B\xEC\x83\xEC\x08\x53\x56\x8B\x75\x08\x83\x7E\x24\x00"
}

/*
"CBasePlayer::ChangeTeam( %d )" - 2 in vtable from that func
sub_102B44C0 ; int __thiscall sub_102B44C0(_DWORD *this, int, int, int, int, char)
int __thiscall sub_102E5310(_DWORD *this, int a2, int a3, int a4, int a5, char a6)
*/
"CBasePlayer::ProcessUsercmds"
{
Expand Down Expand Up @@ -173,7 +172,10 @@
"CBaseClient::GetPlayerSlot"
{
"linux" "15"
"windows" "14" // <-- annoying offset to get that i'm just trusting nosoop to be correct on (it doesn't crash)
// annoying offset to get that i'm just trusting nosoop to be correct on (it doesn't crash):
// "find SV_BroadcastVoiceData via string xref "Sending voice from: %s - playerslot: %d"
// virtual calls made prior to that (call dword ptr [eax+38h] on windows, buncha machinery comparing to _ZThn4_NK11CBaseClient13GetPlayerSlotEv on linux)"
"windows" "14"
}
"CNetChan::GetTimeSinceLastReceived"
{
Expand Down
Binary file removed plugins/stac.smx
Binary file not shown.
13 changes: 7 additions & 6 deletions scripting/stac.sp
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,6 @@ void StopIncompatPlugins()
SetFailState("[StAC] Refusing to load with malicious plugins.");
return;
}
else if (StrContains(plName, "SMAC", false) != -1) /* SMAC */
{
delete plugini;
SetFailState("[StAC] Refusing to load with SMAC. SMAC is outdated and is actively harmful to server performance as well as StAC's operation. Uninstall SMAC and try again.");
return;
}
else if
(
StrContains(plName, "Backtrack Patch", false) != -1 /* JTanz backtrack fix */
Expand All @@ -303,6 +297,13 @@ void StopIncompatPlugins()
}
delete plugini;

if
(
LibraryExists("smac")
&& GetFeatureStatus(FeatureType_Capability, "SMAC_Ban"))
{
SetFailState("[StAC] Refusing to load with SMAC. SMAC is outdated and is actively harmful to server performance as well as StAC's operation. Uninstall SMAC and try again.");
}
}


Expand Down
43 changes: 14 additions & 29 deletions scripting/stac/stac_cvar_checks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ char miscVars[][] =
"r_portalsopenall",
// must be == 1.0
"host_timescale",
// if this is >= 8 just kick them, cathook uses this to "spoof" windows
"windows_speaker_config"
// sv_force_transmit_ents ?
// sv_suppress_viewpunch ?
// tf_showspeed ?
Expand Down Expand Up @@ -61,6 +59,8 @@ char cheatVars[][] =
// "hook"
// fware
"crash",
// cathook uses this to "spoof" windows
"windows_speaker_config",
};


Expand Down Expand Up @@ -273,35 +273,20 @@ public void ConVarCheck(QueryCookie cookie, int cl, ConVarQueryResult result, co
}
}

// chook does this. we cant ban since technically legit clients can set this, but we can kick em out
else if (StrEqual(cvarName, "windows_speaker_config"))
{
if (StringToInt(cvarValue) >= 8)
{
char fmtmsg[512];
Format
(
fmtmsg,
sizeof(fmtmsg),
"Client %N has a value of \"%i\" for cvar \"%s\", which is out of bounds. Legit clients can set this, but most of the time, this is a bot. Kicked from server.",
cl, StringToInt(cvarValue), cvarName
);
StacNotify
(
userid,
fmtmsg
);
if (stac_ban_for_misccheats.BoolValue)
{
KickClient(cl, "#GameUI_ServerInsecure");
}
}
}

/*
cheat program only cvars
*/
if (result != ConVarQuery_NotFound && IsCheatOnlyVar(cvarName))

if
(
(
result == ConVarQuery_Okay
|| result == ConVarQuery_NotValid
|| result == ConVarQuery_Protected
)
&&
IsCheatOnlyVar(cvarName)
)
{
illegalVarsNotify(userid, cvarName);
if (stac_ban_for_misccheats.BoolValue)
Expand All @@ -310,7 +295,7 @@ public void ConVarCheck(QueryCookie cookie, int cl, ConVarQueryResult result, co
}
}
// log something about cvar errors
else if (result != ConVarQuery_Okay && !IsCheatOnlyVar(cvarName) && !StrEqual(cvarName, "windows_speaker_config"))
else if (result != ConVarQuery_Okay && !IsCheatOnlyVar(cvarName))
{
char fmtmsg[512];
Format
Expand Down
19 changes: 10 additions & 9 deletions updatefile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
{
"Version"
{
"Latest" "6.1.4"
"Latest" "6.1.6"
}

"Notes" "Changes in 6.1.4"
"Notes" "- https://github.com/sapphonie/StAC-tf2/releases/tag/v6.1.4"
"Notes" "Changes in 6.1.6"
"Notes" "- https://github.com/sapphonie/StAC-tf2/releases/tag/v6.1.6"
"Notes" "===== StAC is always looking for feedback! Got an issue, request, or wanna discuss? Open a GitHub issue and join the Discord server linked in the README, on GitHub! ====="
"Notes" "===== Thank you for using StAC. -sappho ===== "
}
Expand All @@ -24,8 +24,12 @@
// Extensions
"Plugin" "Path_SM/extensions/SteamWorks.ext.dll"
"Plugin" "Path_SM/extensions/SteamWorks.ext.so"
"Plugin" "Path_SM/extensions/connect.ext.2.ep2v.dll"
"Plugin" "Path_SM/extensions/connect.ext.2.ep2v.so"

"Plugin" "Path_SM/extensions/connect.ext.2.tf2.dll"
"Plugin" "Path_SM/extensions/connect.ext.2.tf2.so"
"Plugin" "Path_SM/extensions/x64/connect.ext.2.tf2.dll"
"Plugin" "Path_SM/extensions/x64/connect.ext.2.tf2.so"

"Plugin" "Path_SM/extensions/conplex.ext.dll"
"Plugin" "Path_SM/extensions/conplex.ext.so"
"Plugin" "Path_SM/extensions/sourcetvmanager.ext.2.tf2.dll"
Expand All @@ -39,7 +43,4 @@
"Plugin" "Path_SM/gamedata/sourcetvmanager.games.txt"
"Plugin" "Path_SM/gamedata/stac.txt"
}
}



}

0 comments on commit a0a1073

Please sign in to comment.