packet 25939 :O

09/15/2012 18:00 go for it#1
i was testing my proxy (paradise based) and found something weird :O
packet 25939 which disconnect me everytime it comes o-0

Packet Nr 7329. Server -> Client, Length : 8, PacketType: 25939
54 51 53 65 72 76 65 72 ;TQServer


Packet Nr 7330. Server -> Client, Length : 8, PacketType: 25939
54 51 53 65 72 76 65 72 ;TQServer

it send the client seal :O that's it
rest of the packets working pretty fine and i was searching the public 5565 source and couldn't find it

i did try to reply with same packet type with server seal and with empty packet also with full packet (aka FF FF FF FF FF FF FF FF FF) and still it disconnect me

p.s i always get 1-10 of the same packet then i disconnect , any idea ?

edit : also this packet disconnect me :O
and this one look scary :D
09/15/2012 18:50 pro4never#2
You're not splitting your packets correctly.

Each TQServer means the packet is done (and should be accounted for in your packet lengths)

First ushort is 00 1A meaning the packet length is actually 26


Sounds to me like it is splitting the packet prematurely (splitting based on length not length + seal) therefor the seal (TQServer) is being processed as its own packet... which it's not.
09/15/2012 18:57 go for it#3
i did actually use your splitting base then i did use the public source 5530 splitting base
Code:
        public void SplitClient(byte[] data)
        {
            if (data == null)
                return;
            if (role == null)
                return;
        roleAgain:
            ushort Length = BitConverter.ToUInt16(data, 0);
            if ((Length + 8) == data.Length)
            {
                ReadWrite.WriteString("TQClient", (data.Length - 8), data);
                HandleClient(data);
                return;
            }
            else if ((Length + 8) > data.Length)
            {
                return;
            }
            else
            {
                byte[] Packet = new byte[(Length + 8)];
                Buffer.BlockCopy(data, 0, Packet, 0, (Length + 8));
                byte[] _buffer = new byte[(data.Length - (Length + 8))];
                Buffer.BlockCopy(data, (Length + 8), _buffer, 0, (data.Length - (Length + 8)));
                data = _buffer;
                ReadWrite.WriteString("TQClient", (Packet.Length - 8), Packet);
                HandleClient(Packet);
                goto roleAgain;
            }
        }
Code:
    public static class PacketHandler
    {
        public static byte[] TQ_SERVER = Encoding.ASCII.GetBytes("TQServer");
        public static byte[] ReturnFinal(byte[] Data)
        {

            //Replaces "TQClient" with "TQServer" on the end of the packet so it may be looped back to the client.
            Array.Copy(TQ_SERVER, 0, Data, Data.Length - TQ_SERVER.Length, TQ_SERVER.Length);
            return Data;
        }
        public static void HandleBuffer(byte[] buffer, Client.GameState client)
        {
            if (buffer == null)
                return;
            if (client == null)
                return;
        roleAgain:
            ushort Length = BitConverter.ToUInt16(buffer, 0);
            if ((Length + 8) == buffer.Length)
            {
                Network.Writer.WriteString(ServerBase.Constants.ServerKey, (buffer.Length - 8), buffer);
                HandlePacket(buffer, client);
                return;
            }
            else if ((Length + 8) > buffer.Length)
            {
                return;
            }
            else
            {
                byte[] Packet = new byte[(Length + 8)];
                Buffer.BlockCopy(buffer, 0, Packet, 0, (Length + 8));
                byte[] _buffer = new byte[(buffer.Length - (Length + 8))];
                Buffer.BlockCopy(buffer, (Length + 8), _buffer, 0, (buffer.Length - (Length + 8)));
                buffer = _buffer;
                Network.Writer.WriteString(ServerBase.Constants.ServerKey, (Packet.Length - 8), Packet);
                HandlePacket(Packet, client);
                goto roleAgain;
            }
        }
anyway ill check again the packet split which explains the real long packets , BUT that doesn't explain the short packet 25939
09/15/2012 19:50 pro4never#4
yes it does...

54 51 53 65 72 76 65 72

that's always going to read TQServer when converted to ASCII... it will always read as the same length and packet type (54 51 and 53 65). It's left over bits after the packet was split incorrectly.
09/15/2012 21:24 _DreadNought_#5
spoiler... spoiler.... SPOILAAAARRR
09/15/2012 23:29 go for it#6
Quote:
Originally Posted by _DreadNought_ View Post
spoiler... spoiler.... SPOILAAAARRR
i think that's what they call shouting zone lmao
done the spoiler

about my question im still confused
Packet Nr 7330. Server -> Client, Length : 8, PacketType: 25939
54 51 53 65 72 76 65 72 ;TQServer

when i split at the seal i get this packet AS the packet just before it got seal at it's end
and when i split with packet length i get fucked up at most of packets cuz there is a stupid packet comes with 00 00 at offset 0 >.<
what should i do ? i know it's like go big or go home and that i need to rewrite everything from the damn starch and read more about this stuff but i really don't have the time so ill just work with what i got and keep asking for help O.O