From e802ce4c2fee4030763887b4103645def9a240e3 Mon Sep 17 00:00:00 2001 From: high Date: Mon, 13 Jun 2011 11:28:50 -0400 Subject: [PATCH] Fixed hair exploit --- TShockAPI/TShock.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 3f96574f..1990eae9 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -261,6 +261,13 @@ namespace TShockAPI Tools.ForceKick(e.Msg.whoAmI, string.Format("You are banned: {0}", ban.Reason)); return true; } + byte hair = e.Msg.readBuffer[e.Index + 1]; + if (hair > 0x10) + { + Tools.ForceKick(e.Msg.whoAmI, "Hair crash exploit."); + return true; + } + string name = Encoding.ASCII.GetString(e.Msg.readBuffer, e.Index + 23, (e.Length - (e.Index + 23)) + e.Index - 1); if (name.Length > 32) {