Welcome to the RaGEZONE - MMORPG development forums.

Habbo Packet Explaining

This is a discussion on Habbo Packet Explaining within the Habbo Tutorials forums, part of the Habbo Hotel category; I will explain the new habbo packet handling What's the difference? - No base encoding anymore. They using Bits. How ...

LyncusMU
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Alpha
    Rank
    Member
    Join Date
    Dec 2011
    Posts
    134
    Liked
    39

    Habbo Packet Explaining

    Tabo Hotel

    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 by Squard; 16-12-11 at 05:05 PM.

  2. HostKey.com: Unmetered Dedicated servers in the Netherlands
  3. #2
    Working in private usage.
    Rank
    Member +
    Join Date
    Jul 2011
    Location
    On FrostEmu
    Posts
    886
    Liked
    128

    Re: Habbo Packet Explaining

    What the fuck? 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.

  4. #3
    TopHabbo.com Best Topsite
    Rank
    Alpha Member
    Join Date
    Oct 2007
    Posts
    2,400
    Liked
    492

    Re: Habbo Packet Explaining

    Quote Originally Posted by George2000 View Post
    What the fuck? 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...

  5. #4
    C# | C++
    Rank
    Member +
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    457
    Liked
    88

    Re: Habbo Packet Explaining

    Quote Originally Posted by George2000 View Post
    What the fuck? 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

    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 by Emerica; 16-12-11 at 06:11 PM.

  6. #5
    Working in private usage.
    Rank
    Member +
    Join Date
    Jul 2011
    Location
    On FrostEmu
    Posts
    886
    Liked
    128

    Re: Habbo Packet Explaining

    Quote Originally Posted by Zak© View Post
    Not fully but enough for me to understand it?

    Mayb it's just you...
    Can't you read:

    I can understand it myself

    It's not I can't understand, but noobs can't.

  7. #6
    PHP, HTML5, CSS3, JS, C#
    Rank
    Alpha Member
    Join Date
    Jun 2010
    Location
    The Netherlands
    Posts
    1,812
    Liked
    1010

    Re: Habbo Packet Explaining

    Quote Originally Posted by George2000 View Post
    Can't you read:

    I can understand it myself

    It's not I can't understand, but noobs can't.
    I understand it and I'm noob at this shit

  8. #7
    Working in private usage.
    Rank
    Member +
    Join Date
    Jul 2011
    Location
    On FrostEmu
    Posts
    886
    Liked
    128

    Re: Habbo Packet Explaining

    Quote Originally Posted by joopie View Post
    I understand it and I'm noob at this shit
    You're not a noob, but I mean guys who are new to the retro world and guys who don't learn fast.

  9. #8
    PHP, HTML5, CSS3, JS, C#
    Rank
    Alpha Member
    Join Date
    Jun 2010
    Location
    The Netherlands
    Posts
    1,812
    Liked
    1010

    Re: Habbo Packet Explaining

    Quote Originally Posted by George2000 View Post
    You're not a noob, but I mean guys who are new to the retro world and guys who don't learn fast.
    I mean with servers/emulators and encryptions/bits etc...

    Did you ever see me releasing a emulator or a edit of it?

  10. #9
    Working in private usage.
    Rank
    Member +
    Join Date
    Jul 2011
    Location
    On FrostEmu
    Posts
    886
    Liked
    128

    Re: Habbo Packet Explaining

    Quote Originally Posted by joopie View Post
    I mean with servers/emulators and encryptions/bits etc...

    Did you ever see me releasing a emulator or a edit of it?
    I'm just trying to be nicer, don't blame me

  11. #10
    TopHabbo.com Best Topsite
    Rank
    Alpha Member
    Join Date
    Oct 2007
    Posts
    2,400
    Liked
    492

    Re: Habbo Packet Explaining

    Quote Originally Posted by George2000 View Post
    I'm just trying to be nicer, don't blame me
    Are you dumb?

    How more easier can you make it!?!?

    If noobs can't understand this, then they gotta learn more about bits? Yes? No?

    K cool.

    And yez i will learn to read.

    Once you learn to code.

  12. #11
    Alpha
    Rank
    Member
    Join Date
    Dec 2011
    Posts
    134
    Liked
    39

    Re: Habbo Packet Explaining

    Quote Originally Posted by Emerica View Post
    It's ok..
    He wrote it into the clamps



    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.

  13. #12
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2011
    Location
    Belgium
    Posts
    306
    Liked
    41

    Re: Habbo Packet Explaining

    He's to smart for us

  14. #13
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Aug 2011
    Location
    England Coder<3
    Posts
    525
    Liked
    104
    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.

  15. #14
    AWWW YEAH \,,/
    Rank
    Subscriber
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    629
    Liked
    118

    Re: Habbo Packet Explaining

    Quote Originally Posted by George2000 View Post
    You're not a noob, but I mean guys who are new to the retro world and guys who don't learn fast.
    Mhn.. "new to the retro world" doesn't mean he/she's noob... It is beginners guys..
    like you was the first time with Habbo's.

  16. #15
    Azure subscription
    Rank
    Subscriber
    Join Date
    Dec 2011
    Location
    єαятн
    Posts
    1,704
    Liked
    255

    Re: Habbo Packet Explaining

    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?

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •