From 9ffd37de257886df880794f9ee79e9a3aae36646 Mon Sep 17 00:00:00 2001 From: high Date: Mon, 13 Jun 2011 09:01:49 -0400 Subject: [PATCH 1/4] Updated Binary --- TShockAPI/TerrariaServer.exe | Bin 751616 -> 751616 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/TShockAPI/TerrariaServer.exe b/TShockAPI/TerrariaServer.exe index 03404f976aa304d26ffbe2d68fdf8e8ee24f37b4..c5feedec28d0e209a935561f2aedd9ec52d6da1d 100644 GIT binary patch delta 864 zcmY+@Ur19?90%~<@6O%bdym;>5|S0If)vvBuouCHSld-!Vv%7HR1ZNtOfZO^qD{;x zxWHxH)k~~@q#zYUTqvj>1}SVXM4FkaTz|ZY>4FuNgq?fNjj;db~-6hD+`mrmK8IXgHOPv5p(#dcfhp{&&_yNexEz|rSdNEgXlNFfEzL5e=6UaPASGsT{vFo} z)ij0{xPDR1;I)rjRjP!qv34U>IhE};WRTsaYt5{AkaBGEPTu@R87&!4=hCSwYT2q5) zV5r1n9POqWJc@Z1P{-s?^!b#gBWKt{4Q~0(CFd;()ux7+`0foH;p6Nm4ZO}*N|E;C zl7SB^R_cT6K1E;mkwbOPIpxPOx z(7>B;rJfWF6M}*sZj?k1LK8L^V$JLyn&nMMEeym6I`^E#@WPMFXTS6Na(3>$@s0ZU zM*UE~>%zn@W1tdM#$26&>ok4U$rrc8*r7{1|kx5!h1ZnJ>ETp6n5;7>h`;eN( zv)H3TGlN$`COv6sR5Mt9S_sV|k&~er9-75+Uh_gzA7t-q%d{tpxldAST(gKSN^Nn? zVepGok*?w`d@C`BN%0SJs9AAjRCJX_kV8Vqq{I5OCx;?i4mR<@cQ_*?=N8bJ?}hb7 z*8);`ozO$-d(?fGb7#3eLS2=L>VG|-ky_Pa;_xr&9$LhWA5K$-F2NL%n_0rBkVy%? znI+JgjJd-@ml0i;GIh)I4cbN_#YXuKC8TImXJljir$)8TbNZu4U?aLIW4x`7${Kvm zSx~u9aOCz8-@(%z;zyIlnw=$Gc`3Ub#f9YVZS>1=ag;WO4FCWD From 9121ce729a46d8962d7ea70fe6182586e56a50f0 Mon Sep 17 00:00:00 2001 From: high Date: Mon, 13 Jun 2011 09:32:12 -0400 Subject: [PATCH 2/4] Added -ip commandline Updated binary --- TShockAPI/TShock.cs | 21 +++++++++++++++++++++ TShockAPI/TerrariaServer.exe | Bin 751616 -> 751616 bytes 2 files changed, 21 insertions(+) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 574e328c..9c407894 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -680,6 +680,27 @@ namespace TShockAPI Console.WriteLine("This token will only display ONCE. This only works ONCE. If you don't use it and the server goes down, delete auth.lck."); FileTools.CreateFile(FileTools.SaveDir + "auth.lck"); } + HandleCommandLine(Environment.GetCommandLineArgs()); + } + + void HandleCommandLine(string[] parms) + { + for (int i = 0; i < parms.Length; i++) + { + if (parms[i].ToLower() == "-ip") + { + IPAddress ip; + if (IPAddress.TryParse(parms[++i], out ip)) + { + Netplay.serverListenIP = ip; + Console.Write("Using IP: {0}", ip); + } + else + { + Console.WriteLine("Bad IP: {0}", parms[i]); + } + } + } } private void OnUpdate(GameTime time) diff --git a/TShockAPI/TerrariaServer.exe b/TShockAPI/TerrariaServer.exe index c5feedec28d0e209a935561f2aedd9ec52d6da1d..0df42858544650d7f5acf8e27d4bdce5851736cd 100644 GIT binary patch delta 104 zcmZqppxf|4cR~k~reI@NYZqf{7gK8&b88n%YZq&47h7u=dutcR)-F!JYSy}91_qYx zcdI$sIRxq!GBdE``!g_bi8ssxGTXm2b8i3A%$0Ik;QGU!biE^fo*f7HOQtUPV7)yf IoO^}>0KpX|zyJUM delta 104 zcmV-u0GI!O@GXGwEs%%;3JQUWg^B@%iUNg-1BHqNg^C4*iUx&>2Zf3VwTcN&dj%l> z0002D-FpcK2oM*5o&x{`exU;Z1aD6O01Aing9*3vg9>ER5ZVg$Sqin?Nv`>~p!B~f Kqqk^R3z#6ts3-XV From dbc0ae7aac36ae204b2e2f25f98e4f2b6fe9c448 Mon Sep 17 00:00:00 2001 From: high Date: Mon, 13 Jun 2011 09:35:19 -0400 Subject: [PATCH 3/4] increased version tick moved commandline handling --- TShockAPI/TShock.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 9c407894..3f96574f 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -36,7 +36,7 @@ namespace TShockAPI public static string saveDir = "./tshock/"; - public static Version VersionNum = new Version(2, 1, 0, 1); + public static Version VersionNum = new Version(2, 1, 0, 2); public static string VersionCodename = "Forgot to close the issue."; @@ -173,6 +173,8 @@ namespace TShockAPI Log.Info("Hooks initialized"); Commands.InitCommands(); Log.Info("Commands initialized"); + + HandleCommandLine(Environment.GetCommandLineArgs()); } /// @@ -680,7 +682,6 @@ namespace TShockAPI Console.WriteLine("This token will only display ONCE. This only works ONCE. If you don't use it and the server goes down, delete auth.lck."); FileTools.CreateFile(FileTools.SaveDir + "auth.lck"); } - HandleCommandLine(Environment.GetCommandLineArgs()); } void HandleCommandLine(string[] parms) From e802ce4c2fee4030763887b4103645def9a240e3 Mon Sep 17 00:00:00 2001 From: high Date: Mon, 13 Jun 2011 11:28:50 -0400 Subject: [PATCH 4/4] 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) {