• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

How to interpret packets received from Habbo?

Initiate Mage
Joined
Oct 11, 2023
Messages
4
Reaction score
0
Hello,
By sniffing in Habbo, I get a hexadecimal value, for example:
Code:
00 00 00 06 06 b4 b3 7d a9 c6

From this package I understand that:

Code:
00 00 00 06
Corresponds to the size of the package.

Code:
06 b4
A package identifier.

Code:
b3 7d a9 c6
An integer.

Thanks to the package ID I know:
- Name -> FurniListRemoveEvent
- Namespace -> _-XB
- Class -> _-31L

When it comes to a small packet like the one in the example, it is easy to interpret, but when it comes to packets larger than 500 bytes it is already a problem.

How to interpret a long packet in the simplest way?

Greetings.
 
Last edited:
Solution
You have to get the packet structure from the client. So you look up the class and then its message parser.

All messages are defined in
Code:
HabboMessages

From there you can look up the identifier and find the corresponding event class.

Now in the event class you fill find in the constructor a call to its base constructor with the corresponding message parser type.

Example:
Code:
        public function _SafeStr_2925(k:Function)
        {
            super(k, _SafeStr_4642);
        }

Then search for class _SafeStr_4642 and you'll find the parser:

Code:
public function parse(k:_SafeStr_2717):Boolean
        {
            if (k.bytesAvailable)
            {
                this._SafeStr_16561 = k._SafeStr_10975()...
Joined
Aug 10, 2011
Messages
7,399
Reaction score
3,308
You have to get the packet structure from the client. So you look up the class and then its message parser.

All messages are defined in
Code:
HabboMessages

From there you can look up the identifier and find the corresponding event class.

Now in the event class you fill find in the constructor a call to its base constructor with the corresponding message parser type.

Example:
Code:
        public function _SafeStr_2925(k:Function)
        {
            super(k, _SafeStr_4642);
        }

Then search for class _SafeStr_4642 and you'll find the parser:

Code:
public function parse(k:_SafeStr_2717):Boolean
        {
            if (k.bytesAvailable)
            {
                this._SafeStr_16561 = k._SafeStr_10975();
            };
            return (true);
        }

The argument k is the message buffer and any calls on it reads some data. In my case
Code:
_SafeStr_10975
reads an int. But this can also be a short, string, single byte or unsigned. The easiest way to check what type it is is to see what it gets assigned to. In my case
Code:
this._SafeStr_16561
which is
Code:
private var _SafeStr_16561:int;

You can also use G-Earth to obtain packets and structures. You dont really need to do packet logging in order to build an emulator. Its just handy to get a feel of what the values might be. When working on Arcturus and Sirius, I only used logging a couple times when I just couldn't figure it out from the scripts.
 
Upvote 0
Solution
Back
Top