From 5fe24621932711ee2150197399a92fffcabd0323 Mon Sep 17 00:00:00 2001 From: Maverick Motherfucker Date: Thu, 2 Jun 2011 23:16:35 -0700 Subject: [PATCH] Fixed exploit where cheaters can send chat as other people --- TShockAPI/TShock.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 1dac0977..85630089 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -212,6 +212,19 @@ namespace TShockAPI Tools.HandleCheater(ply); } } + else if (e.MsgID == 0x19) + { + byte ply; + using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) + { + ply = br.ReadByte(); + } + if (e.Msg.whoAmI != ply) + { + //fuck you faggot + Tools.HandleCheater(ply); + } + } } void OnGreetPlayer(int who, HandledEventArgs e)