From 07e5472b64d0d2abf94080fdeaf6fb75b4161f09 Mon Sep 17 00:00:00 2001 From: Lotendan <85304370+Lotendan@users.noreply.github.com> Date: Fri, 29 Apr 2022 17:33:30 +0200 Subject: [PATCH] Add more length restrictions to WritePascalStringIntLE --- GameServer/packets/Server/PacketLib1125.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/GameServer/packets/Server/PacketLib1125.cs b/GameServer/packets/Server/PacketLib1125.cs index b1a75d8950..b7fd9d600a 100644 --- a/GameServer/packets/Server/PacketLib1125.cs +++ b/GameServer/packets/Server/PacketLib1125.cs @@ -52,7 +52,7 @@ public override void SendVersionAndCryptKey() //Construct the new packet using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.CryptKey))) { - pak.WritePascalStringIntLE((((int)m_gameClient.Version) / 1000) + "." + (((int)m_gameClient.Version) - 1000) + m_gameClient.MinorRev); + pak.WritePascalStringIntLE((((int)m_gameClient.Version) / 1000) + "." + (((int)m_gameClient.Version) - 1000) + m_gameClient.MinorRev, 0x20); //// Same as the trailing two bytes sent in first client to server packet pak.WriteByte(m_gameClient.MajorBuild); // last seen : 0x2A 0x07 pak.WriteByte(m_gameClient.MinorBuild); @@ -581,30 +581,30 @@ public override void SendMarketExplorerWindow(IList items, byte p if (item.Count > 1) { - pak.WritePascalStringIntLE(item.Count + " " + item.Name); + pak.WritePascalStringIntLE(item.Count + " " + item.Name, 0x30); } else if (item.PackSize > 1) { - pak.WritePascalStringIntLE(item.PackSize + " " + item.Name + bpPrice); + pak.WritePascalStringIntLE(item.PackSize + " " + item.Name + bpPrice, 0x30); } else { - pak.WritePascalStringIntLE(item.Name + bpPrice); + pak.WritePascalStringIntLE(item.Name + bpPrice, 0x30); } } else { if (item.Count > 1) { - pak.WritePascalStringIntLE(item.Count + " " + item.Name); + pak.WritePascalStringIntLE(item.Count + " " + item.Name, 0x30); } else if (item.PackSize > 1) { - pak.WritePascalStringIntLE(item.PackSize + " " + item.Name); + pak.WritePascalStringIntLE(item.PackSize + " " + item.Name, 0x30); } else { - pak.WritePascalStringIntLE(item.Name); + pak.WritePascalStringIntLE(item.Name, 0x30); } } }