TacoServer/Classic/scripts/autoexec/MemPatches.cs

55 lines
1.6 KiB
C#
Raw Normal View History

2020-04-04 16:54:38 +00:00
// Memory Patches
2019-10-19 17:41:17 +00:00
2020-04-01 23:29:33 +00:00
//Nope...Try Agian fix - telnet
2021-07-17 16:18:05 +00:00
//From Krash
2020-04-01 23:29:33 +00:00
memPatch("756076","6169");
2020-04-02 05:03:50 +00:00
// Thanks Turkeh
// TraversalRoot Console spam fix
function suppressTraversalRootPatch()
{
if($tvpatched)
return;
warn("Patching traversal root error...");
memPatch("56AD8A", "90909090909090909090909090909090909090909090");
memPatch("56D114", "90909090909090909090909090909090909090909090");
$tvpatched = 1;
2020-10-22 19:58:38 +00:00
}
if (!$CmdArmor::Patched)
{
$CmdArmor::Patched = true;
//memPatch("6FC746", "66B8000090906683FE017408ACAA84C075FA89D05F5EC3");
memPatch("6FC746", "83FE017408ACAA84C075FA89D05F5EC3");
//Removed register size override (cmp si, 1 -> cmp esi, 1) and got rid of
//weird NASM garbage code at the beginning. Had a mov ax, 0 which did nothing
//and wasn't necessary anyways because of xor eax, eax in the original. It also
//generated several NOPs after that for no reason.
}
function serverCmd(%client)
{
// Stick your own administrative action code here
messageAll('msgAll',"\c3" @ %client.namebase SPC "is attempting to crash the server!");
messageClient(%client, 'onClientBanned', "");
messageAllExcept( %client, -1, 'MsgClientDrop', "", %client.name, %client );
2021-07-17 16:18:05 +00:00
2020-10-22 19:58:38 +00:00
// kill and delete this client
if( isObject(%client.player) )
%client.player.scriptKill(0);
2021-07-17 16:18:05 +00:00
2020-10-22 19:58:38 +00:00
if ( isObject( %client ) )
{
%client.setDisconnectReason("You have been banned for attempting to crash the server.");
%client.schedule(700, "delete");
}
2021-07-17 16:18:05 +00:00
2020-10-22 19:58:38 +00:00
BanList::add(%client.guid, %client.getAddress(), $Host::BanTime);
2021-07-17 16:18:05 +00:00
}
//Disable UE box on crash
//Used if a clean crash is desired
//memPatch("7dc7fc","90");