Habbo Packet Explaining

Status
Not open for further replies.
Junior Spellweaver
Joined
Dec 15, 2011
Messages
143
Reaction score
36
Squard - Habbo Packet Explaining - RaGEZONE Forums

I will explain the new habbo packet handling

What's the difference?
- No base encoding anymore. They using Bits.

How to handle an Integer?
Get 4 Numbers (as bits).

Bits explaining
Code:
Example:
1-0-0-0 = 1 as int
0-1-0-0 = 256 as int
1-1-0-0 = 257 as int (1x 256 + 1)
1-2-0-0 = 513 as int (2x 256 + 1)

You have to count further.

Like having 4 Row(s) in an byte array.
Every row has an max of 255 (bit).
1-2-3-4 Rows.
If the row has reaches his max then the next row gets + 1.
Thent he old row will be set to 0, to count again.

Every single item stands for an integer of an max of (255).

Int lengths
Int32 = 4 (bits)
Int16(short) = 2 (bits) [Used for HeaderId and string lengths]

Something weird
Habbo reversed the bytes sometimes.

Boolean explaining
They just used a single bit for the boolean.

Code:
Example
True = 1
False = 0

String explaining
Not that hard, they just used as first.
[String Length (as short)] + Text of string.

Characters explaining
Just use your bitconverter to do this.

With all pleasure :)

Like if you know more after reading this!

New ServerMessage

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HabboTCP.Messages.Library
{
    class ServerMessage
    {
        private List<byte> Context = new List<byte>();

        public ServerMessage(short HeaderId) { Append(HeaderId); }

        public void Append(object Item)
        {
            if (Item is Int32 || Item is int)
            {
                AddInt32((Int32)Item);
            }
            else if (Item is Int16 || Item is short)
            {
                AddInt16((Int16)Item);
            }
            else if (Item is Boolean || Item is bool)
            {
                AddBoolean((Boolean)Item);
            }
            else if (Item is String || Item is string)
            {
                AddString(Item as string);
            }
        }

        private void AddInt32(Int32 Item)
        {
            AddBytes(BitConverter.GetBytes(Item), ReverseType.Reversed);
        }

        private void AddInt16(Int16 Item)
        {
            AddBytes(BitConverter.GetBytes(Item), ReverseType.Reversed);
        }

        private void AddBoolean(Boolean Item)
        {
            AddBytes(new byte[] { (byte)(Item ? 1 : 0) }, ReverseType.Fresh);
        }

        private void AddString(String Item)
        {
            AddInt16((short)Item.Length);
            AddBytes(Encoding.ASCII.GetBytes(Item), ReverseType.Fresh);
        }

        private void AddBytes(byte[] Bytes, ReverseType Type)
        {
            if (Type == ReverseType.Reversed)
            {
                for (int i = (Bytes.Length - 1); i > -1; i--)
                {
                    Context.Add(Bytes[i]);
                }
            }
            else
            {
                Context.AddRange(Bytes);
            }
        }

        public byte[] Bytes()
        {
            var Result = new List<byte>();

            Result.AddRange(BitConverter.GetBytes(Context.Count));

            Result.Reverse();

            Result.AddRange(Context);

            return Result.ToArray();
        }
    }

    enum ReverseType
    {
        Fresh,
        Reversed
    }
}
 
Last edited:
What the ****? You didn't really explained this:

1-0-0-0 = 1 as int
0-1-0-0 = 256 as int
1-1-0-0 = 257 as int (1x 256 + 1)
1-2-0-0 = 513 as int (2x 256 + 1)

But I think this is good.. I can understand it myself. But maybe you could explain why it's that way.

Not really something usefull in my opinion. But you deserve a like for making guide.
 
What the ****? You didn't really explained this:

1-0-0-0 = 1 as int
0-1-0-0 = 256 as int
1-1-0-0 = 257 as int (1x 256 + 1)
1-2-0-0 = 513 as int (2x 256 + 1)

But I think this is good.. I can understand it myself. But maybe you could explain why it's that way.

Not really something usefull in my opinion. But you deserve a like for making guide.


Not fully but enough for me to understand it?

Mayb it's just you...
 
What the ****? You didn't really explained this:

1-0-0-0 = 1 as int
0-1-0-0 = 256 as int
1-1-0-0 = 257 as int (1x 256 + 1)
1-2-0-0 = 513 as int (2x 256 + 1)

But I think this is good.. I can understand it myself. But maybe you could explain why it's that way.

Not really something usefull in my opinion. But you deserve a like for making guide.

It's ok..
He wrote it into the clamps :closedeyes:

String explaining
Not that hard, they just used as first.
[String Length (as short)] + Text of string.

e.g I got this:
Code:
[0][0][0]%[2]»[0] f4ca7d0937c6421ee36b2406ead092df[0]
Than I have to write this ??:
Code:
Message.Append(38 + "f4ca7d0937c6421ee36b2406ead092df");
Cause, I got 38 as String Length
 
Last edited:
It's ok..
He wrote it into the clamps :closedeyes:



e.g I got this:
Code:
[0][0][0]%[2]»[0] f4ca7d0937c6421ee36b2406ead092df[0]
Than I have to write this ??:
Code:
Message.Append(38 + "f4ca7d0937c6421ee36b2406ead092df");
Cause, I got 38 as String Length

No just the string, it will add the Length Automaticly.
 
O.o Got a java code for this? (Coding a javaEmu)
Also, Ive got no clue in packets (im a noob at this)

Sent from my mobile via Tapatalk.
 
I'm not new to the retro world, but I don't understand this, maybe you could explain a bit easier, sorry, just saying, because I really would like to learn this! And has anyone got a Packet Logger?
 
Ohhhh so that's how this **** works...O_O so basically every time a packet is sent it's double encrypted with a bit then sent to the Matrix, decoded, decompiled, recompiled and then it gets multiplied by two, sent with PHP code, that's encrypted, then it gets shipped in a box in Cyber Space, sent to the java server once again, sprinkled over a pixel pizza, added to a Habbo's Face, then gets compiled on our end.


I think I nailed it.


lol I have no idea what nillus or OP is talking about.
 
Ok, Im stupid. Tell me what this packet is
"CNH"
and this one
"F_@TST-SSO_TICKETHERE[W}"

It's ok..
He wrote it into the clamps :closedeyes:



e.g I got this:
Code:
[0][0][0]%[2]»[0] f4ca7d0937c6421ee36b2406ead092df[0]
Than I have to write this ??:
Code:
Message.Append(38 + "f4ca7d0937c6421ee36b2406ead092df");
Cause, I got 38 as String Length

No, I think you would need to write..
Message.Append(char(0).char(0).char(0).char(37).char(2)."»".char(0)."f4ca7d0937c6421ee36b2406ead092df".char(0));
 
Status
Not open for further replies.
Back