Habbo Emulator [Packet]

Results 1 to 15 of 15
  1. #1
    PHP & C# Developer Stevehabbz is offline
    MemberRank
    Nov 2011 Join Date
    244Posts

    Habbo Emulator [Packet]

    Hello guys,
    Im need help with packet or another name else.
    So, What I know with packet is when we send from server [Emulator] from ServerMessage, It will show something.
    Example , if the code 257 it will show something like navigator or else , am right ?
    Or what is it about ?
    Please help me.

    Can you explain what packet mean and HabboEncryption ?
    and Can I know what is SSOTicket for ?

    Thank you :)

    - - - Updated - - -

    And new question How Can I connect R64 Client (Habbo Now) with Emulator ?
    I tried connect the client with C# Socket and it shows "<policy-request-file/>" and I bypass it with Sent XML Policy and I wait the new data incoming and it said the Habbo.Swf released version. Now I need to know how to show the hotel view ? Just the hotel view . Please help me :/
    I had watch the Azure, Silverwave and still no clue :/


  2. #2
    PHP & C# Developer Stevehabbz is offline
    MemberRank
    Nov 2011 Join Date
    244Posts

    Re: Habbo Emulator [Packet]

    Quote Originally Posted by Boraida View Post
    First of all, have you already figured out how the client works? I'd recommend that.
    The client work when the client connected to emulator socket , right ?
    and the socket will move the client to Session where it will login the user ?
    Am i right ? :/

  3. #3
    Proficient Member Boraida is offline
    MemberRank
    May 2011 Join Date
    The NetherlandsLocation
    161Posts

    Re: Habbo Emulator [Packet]

    Quote Originally Posted by Stevehabbz View Post
    The client work when the client connected to emulator socket , right ?
    and the socket will move the client to Session where it will login the user ?
    Am i right ? :/
    Did you look into the source of the client? I'd say decompile the client with AS3 Sorcerer

    To make server you need first to know how the client works. it will help you out!

  4. #4
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    Re: Habbo Emulator [Packet]

    Packet IDs are what the emulator receives from the habbo.swf and sends to it. A packet ID translates to a certain action, either done by the emulator or the habbo.swf. For every 'newer' habbo.swf the IDs of all the actions shuffle every swf release, which the community calls R63B. There's also older versions of habbo.swfs (R63 without B) on which the packet IDs stay the same. In order for you to let the hotel view appear, you first need to send a couple of packet IDs and structures to the habbo.swf commonly known as the 'handshake'. I believe if you look at silverwave or azure emulator, you'll see comme nted which actions (with their packet IDs) belong to the handshake. I believe some of those actions were sending the client version, sending a cipher key and sending user login information. However there are some more, so for information on the handshake, just dive into the comments made in the emulators I mentioned.

  5. #5
    Evil Italian Overlowrd Droppy is offline
    [Internal Coder]Rank
    Feb 2012 Join Date
    /home/droppyLocation
    2,080Posts

    Re: Habbo Emulator [Packet]

    Just as a fix to what Gaby has said, Habbo client v7/v9 (not sure) to R63 Pre shuffle - the headers wasn't commonly changed in these versions, only in some rare cases of extra functions or add of new ones.

    Anyway, back to the original question... I'll answer the questions that I've understanded the answer...

    1) SSO is your authentication key, commonly generated by the CMS, sent through the SWF for the emulator. That way emulator recognizes which account is which.

    2) its getting stopped on 4000? Are you sure that you are reading the byte length correctly (and receiving the remaining bytes correctly aswell)? Has this SWF been cracked? Show us some packet request logs otherwise we cannot help you much. Also provide us some snippets of your code.

  6. #6
    Valued Member wesley66101 is offline
    MemberRank
    Oct 2013 Join Date
    105Posts

    Re: Habbo Emulator [Packet]

    Code:
    incoming packetname                  > outgoing packetname
    CheckReleaseMessageEvent         > CheckReleaseMessageComposer 
    InitCryptoMessageEvent              > InitCryptoMessageComposer 
    GenerateSecretKeyMessageEvent > GenerateSecretKeyMessageComposer 
    ClientPathMessageEvent              > ClientPathMessageComposer 
    CheckMachineMessageEvent         > CheckMachineMessageComposer 
    SSOTicketMessageEvent              > SSOTicketMessageComposer 
    HabboLandingViewMessageEvent  >HabboLandingViewMessageComposer (this are the diffrent texts on the hotel view, this packet gets handled more times again at the login)
    GetUserInfoDataMessageEvent     > GetUserInfoDataMessageComposer (this is for user info, such as avatar on the hotel view)
    InitMessengerMessageEvent         > InitMessengerMessageComposer (this is for the friendbar)
    This are the packet names that must be sended to the emulator (incoming), and then to the client from the emulator (outgoing)
    If this is done, you have a fully hotelview!
    Good to know, incoming packets AND outgoing packets have structures you can pick that structures from another emulator.
    Also, i recommend you a rc4 PATCHED habbo.swf so you don't have to do crypto shit in your emulator and you can send a random string to the swf


    Greetz: Wesley
    sorry for my bad english!

  7. #7
    j’aime ma famille dominic is offline
    MemberRank
    Aug 2012 Join Date
    ~/Location
    611Posts

    Re: Habbo Emulator [Packet]

    OFF-TOPIC:
    Woah, didn't know this many people actually gave a living crap about this section! Glad to see newcomers messing around with the encryption, this means I did good.
    ON-TOPIC:
    When working with Habbo and it's client, you'll need to properly understand what's going on "behind-the-scenes", eheh. You should really look into the decompiled source of the Habbo.swf. Everything will eventually be easier to read and understand, I promise you that.

  8. #8
    PHP & C# Developer Stevehabbz is offline
    MemberRank
    Nov 2011 Join Date
    244Posts

    Re: Habbo Emulator [Packet]

    Thank you all for helping. I'm discontinued the project cause I'm can be crazy because of the crazy crypto and now I'm back again to face with the crypto again. So, I get a broken packet and I'm using the Azure Packet Processor.



    This is my handshake event :
    Code:
    internal void InitCrypto()
            {
                Response.Init(Outgoing.InitCryptoMessageComposer);
                Response.AppendString(HabboEncryptionHandlerV2.GetRsaDiffieHellmanPrimeKey());
                Response.AppendString(HabboEncryptionHandlerV2.GetRsaDiffieHellmanGeneratorKey());
                SendResponse();
            }
    
            internal void GenerateSecretKey()
            {
                var cipherKey = Request.GetString();
                BigInteger sharedKey = HabboEncryptionHandlerV2.CalculateDiffieHellmanSharedKey(cipherKey);
    
                if (sharedKey != 0)
                {
                    Response.Init(Outgoing.SecretKeyMessageComposer);
                    Response.AppendString(HabboEncryptionHandlerV2.GetRsaDiffieHellmanPublicKey());
                    Response.AppendBool(false);
                    SendResponse();
    
                    var data = sharedKey.getBytes();
    
                    if (data[data.Length - 1] == 0)
                        Array.Resize(ref data, data.Length - 1);
    
                    Array.Reverse(data, 0, data.Length);
    
                    Session.GetConnection().ARC4ServerSide = new ARC4(data);
                    //Session.GetConnection().ARC4Clientide = new ARC4(data);
                }
                else
                    Console.WriteLine("Crypto Error");
            }
    This is my game packet parser
    Code:
    if (data.Length == 0 || _currentClient == null)
                    return;
                Console.WriteLine(data.Length);
                int pos = 0;
                short messageId = 0;
    
                try
                {
                    for (pos = 0; pos < data.Length;)
                    {
                        int length = HabboEncoding.DecodeInt32(new[] { data[pos++], data[pos++], data[pos++], data[pos++] });
    
                        if (length < 2 || length > 4096)
                        {
                            Console.WriteLine("Broken packet with {0} length", length);
                            return;
                        }
    
                        messageId = HabboEncoding.DecodeInt16(new[] { data[pos++], data[pos++] });
    
                        byte[] packetContent = new byte[length - 2];
    
                        for (int i = 0; i < packetContent.Length && pos < data.Length; i++)
                            packetContent[i] = data[pos++];
    
                        using (ClientMessage clientMessage = new ClientMessage(messageId, packetContent))
                        {
                            _currentClient.GetMessageHandler().HandleRequest(clientMessage);
                        }
                    }
                }
                catch (Exception exception)
                {
                    Console.WriteLine("GamePacketParser >> {0}", exception.Message);
    
                    _connection.Dispose();
                }

    P/S: I'm a newbie..

  9. #9
    Account Upgraded | Title Enabled! Sledmore is offline
    MemberRank
    Jun 2009 Join Date
    1,133Posts

    Re: Habbo Emulator [Packet]

    Quote Originally Posted by Stevehabbz View Post
    Thank you all for helping. I'm discontinued the project cause I'm can be crazy because of the crazy crypto and now I'm back again to face with the crypto again. So, I get a broken packet and I'm using the Azure Packet Processor.



    This is my handshake event :
    Code:
    internal void InitCrypto()
            {
                Response.Init(Outgoing.InitCryptoMessageComposer);
                Response.AppendString(HabboEncryptionHandlerV2.GetRsaDiffieHellmanPrimeKey());
                Response.AppendString(HabboEncryptionHandlerV2.GetRsaDiffieHellmanGeneratorKey());
                SendResponse();
            }
    
            internal void GenerateSecretKey()
            {
                var cipherKey = Request.GetString();
                BigInteger sharedKey = HabboEncryptionHandlerV2.CalculateDiffieHellmanSharedKey(cipherKey);
    
                if (sharedKey != 0)
                {
                    Response.Init(Outgoing.SecretKeyMessageComposer);
                    Response.AppendString(HabboEncryptionHandlerV2.GetRsaDiffieHellmanPublicKey());
                    Response.AppendBool(false);
                    SendResponse();
    
                    var data = sharedKey.getBytes();
    
                    if (data[data.Length - 1] == 0)
                        Array.Resize(ref data, data.Length - 1);
    
                    Array.Reverse(data, 0, data.Length);
    
                    Session.GetConnection().ARC4ServerSide = new ARC4(data);
                    //Session.GetConnection().ARC4Clientide = new ARC4(data);
                }
                else
                    Console.WriteLine("Crypto Error");
            }
    This is my game packet parser
    Code:
    if (data.Length == 0 || _currentClient == null)
                    return;
    
                Console.WriteLine(data.Length);
                int pos = 0;
                short messageId = 0;
    
                try
                {
                    for (pos = 0; pos < data.Length;)
                    {
                        int length = HabboEncoding.DecodeInt32(new[] { data[pos++], data[pos++], data[pos++], data[pos++] });
    
                        if (length < 2 || length > 4096)
                        {
                            Console.WriteLine("Broken packet with {0} length", length);
                            return;
                        }
    
                        messageId = HabboEncoding.DecodeInt16(new[] { data[pos++], data[pos++] });
    
                        byte[] packetContent = new byte[length - 2];
    
                        for (int i = 0; i < packetContent.Length && pos < data.Length; i++)
                            packetContent[i] = data[pos++];
    
                        using (ClientMessage clientMessage = new ClientMessage(messageId, packetContent))
                        {
                            _currentClient.GetMessageHandler().HandleRequest(clientMessage);
                        }
                    }
                }
                catch (Exception exception)
                {
                    Console.WriteLine("GamePacketParser >> {0}", exception.Message);
    
                    _connection.Dispose();
                }

    P/S: I'm a newbie..
    Hey, in your last method you're missing a bit. I'm assuming you're using Joopies encryption?

    You need to run something similar to

    PHP Code:
           if (this._currentClient != null && this._currentClient.GetRC4() != null)
                {
                    
    this._currentClient.GetRC4().Decrypt(ref data);
                } 
    E.g.

    PHP Code:
    if (data.Length == || _currentClient == null)
                    return;

      if (
    this._currentClient != null && this._currentClient.GetRC4() != null
                { 
                    
    this._currentClient.GetRC4().Decrypt(ref data); 
                }  

                
    Console.WriteLine(data.Length);
                
    int pos 0;
                
    short messageId 0;

                try
                {
                    for (
    pos 0pos data.Length;)
                    {
                        
    int length HabboEncoding.DecodeInt32(new[] { data[pos++], data[pos++], data[pos++], data[pos++] });

                        if (
    length || length 4096)
                        {
                            
    Console.WriteLine("Broken packet with {0} length"length);
                            return;
                        }

                        
    messageId HabboEncoding.DecodeInt16(new[] { data[pos++], data[pos++] });

                        
    byte[] packetContent = new byte[length 2];

                        for (
    int i 0packetContent.Length && pos data.Lengthi++)
                            
    packetContent[i] = data[pos++];

                        
    using (ClientMessage clientMessage = new ClientMessage(messageIdpacketContent))
                        {
                            
    _currentClient.GetMessageHandler().HandleRequest(clientMessage);
                        }
                    }
                }
                catch (
    Exception exception)
                {
                    
    Console.WriteLine("GamePacketParser >> {0}"exception.Message);

                    
    _connection.Dispose();
                } 
    Last edited by Sledmore; 02-12-15 at 06:33 AM. Reason: Oops.

  10. #10
    PHP & C# Developer Stevehabbz is offline
    MemberRank
    Nov 2011 Join Date
    244Posts

    Re: Habbo Emulator [Packet]

    Quote Originally Posted by Sledmore View Post
    Hey, in your last method you're missing a bit. I'm assuming you're using Joopies encryption?

    You need to run something similar to

    PHP Code:
           if (this._currentClient != null && this._currentClient.GetRC4() != null)
                {
                    
    this._currentClient.GetRC4().Decrypt(ref data);
                } 
    E.g.

    PHP Code:
    if (data.Length == || _currentClient == null)
                    return;

      if (
    this._currentClient != null && this._currentClient.GetRC4() != null
                { 
                    
    this._currentClient.GetRC4().Decrypt(ref data); 
                }  

                
    Console.WriteLine(data.Length);
                
    int pos 0;
                
    short messageId 0;

                try
                {
                    for (
    pos 0pos data.Length;)
                    {
                        
    int length HabboEncoding.DecodeInt32(new[] { data[pos++], data[pos++], data[pos++], data[pos++] });

                        if (
    length || length 4096)
                        {
                            
    Console.WriteLine("Broken packet with {0} length"length);
                            return;
                        }

                        
    messageId HabboEncoding.DecodeInt16(new[] { data[pos++], data[pos++] });

                        
    byte[] packetContent = new byte[length 2];

                        for (
    int i 0packetContent.Length && pos data.Lengthi++)
                            
    packetContent[i] = data[pos++];

                        
    using (ClientMessage clientMessage = new ClientMessage(messageIdpacketContent))
                        {
                            
    _currentClient.GetMessageHandler().HandleRequest(clientMessage);
                        }
                    }
                }
                catch (
    Exception exception)
                {
                    
    Console.WriteLine("GamePacketParser >> {0}"exception.Message);

                    
    _connection.Dispose();
                } 
    Already mentions the decrypt function before I send it to parser. Am using Joopie Encryption . lol
    Code:
    private void HandlePacketData(byte[] packet)
            {
                if(Parser != null)
                {
                    if (ARC4ServerSide != null)
                        ARC4ServerSide.Encrypt(ref packet);
    
                    Parser.HandlePacketData(packet);
                }
            }
    it fine now after I change this
    Code:
    Session.GetConnection().ARC4ServerSide = new ARC4(data);
    to
    Code:
    Session.GetConnection().ARC4ServerSide = new ARC4(sharedKey.getBytes());
    Is this will effect anything ? After I changed this the client work fine :/

    New Problem ! About 1 month and I still can't enter the hotel view. Omaigod. I had managed Navigator, Hotelview, Handshake and all of that and it entered the hotel view for a sec and then the client dc .
    I checked the emulator and the emulator handled all the packet . also, I compared mine emulator and azure emulator because Im use the same Habbo SWF(PRODUCTION). Take a look.
    Last edited by Stevehabbz; 02-12-15 at 11:25 AM.

  11. #11
    Valued Member wesley66101 is offline
    MemberRank
    Oct 2013 Join Date
    105Posts

    Re: Habbo Emulator [Packet]

    Quote Originally Posted by Stevehabbz View Post
    Already mentions the decrypt function before I send it to parser. Am using Joopie Encryption . lol
    Code:
    private void HandlePacketData(byte[] packet)
            {
                if(Parser != null)
                {
                    if (ARC4ServerSide != null)
                        ARC4ServerSide.Encrypt(ref packet);
    
                    Parser.HandlePacketData(packet);
                }
            }
    it fine now after I change this
    Code:
    Session.GetConnection().ARC4ServerSide = new ARC4(data);
    to
    Code:
    Session.GetConnection().ARC4ServerSide = new ARC4(sharedKey.getBytes());
    Is this will effect anything ? After I changed this the client work fine :/

    New Problem ! About 1 month and I still can't enter the hotel view. Omaigod. I had managed Navigator, Hotelview, Handshake and all of that and it entered the hotel view for a sec and then the client dc .
    I checked the emulator and the emulator handled all the packet . also, I compared mine emulator and azure emulator because Im use the same Habbo SWF(PRODUCTION). Take a look.
    It can be a SWF problem, are you sure your furnidata is in xml format and ends in .xml?

  12. #12
    :joy: Jonteh is offline
    MemberRank
    Apr 2007 Join Date
    New York, USALocation
    3,372Posts

    Re: Habbo Emulator [Packet]

    Check your developer console (f12) as well. And also the server logs. Could be a simple MySQL problem or an incorrect setup w/ files.

    I always had troubles because of things with friends. If you have friends coded, try disabling it

  13. #13
    PHP & C# Developer Stevehabbz is offline
    MemberRank
    Nov 2011 Join Date
    244Posts

    Re: Habbo Emulator [Packet]

    Quote Originally Posted by wesley66101 View Post
    It can be a SWF problem, are you sure your furnidata is in xml format and ends in .xml?
    I'm trying to create my own emulator that build from scratch but It won't enter the hotelview. So, I already handled all handshake, hotelview packet and some of HabboBasicInfo with latency test. Could It be happen on swf ? (furnidata and others) Should I defined the furnidata ? hmm ty

    - - - Updated - - -

    Quote Originally Posted by Jonteh View Post
    Check your developer console (f12) as well. And also the server logs. Could be a simple MySQL problem or an incorrect setup w/ files.

    I always had troubles because of things with friends. If you have friends coded, try disabling it
    I'm not using mysql yet until I get into hotelview. what do you mean (Justin Bieber) with incorect setup w/ files LOL. hehehe.
    InitMessenger is friends ?

    I already defined this:

  14. #14
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,483Posts

    Re: Habbo Emulator [Packet]

    Quote Originally Posted by Stevehabbz View Post
    Already mentions the decrypt function before I send it to parser. Am using Joopie Encryption . lol
    Code:
    private void HandlePacketData(byte[] packet)
            {
                if(Parser != null)
                {
                    if (ARC4ServerSide != null)
                        ARC4ServerSide.Encrypt(ref packet);
    
                    Parser.HandlePacketData(packet);
                }
            }
    Looks like you're encrypting the packet instead of decrypting it?

  15. #15
    PHP & C# Developer Stevehabbz is offline
    MemberRank
    Nov 2011 Join Date
    244Posts

    Re: Habbo Emulator [Packet]

    Quote Originally Posted by Quackster View Post
    Looks like you're encrypting the packet instead of decrypting it?
    Changed to decrypt and it has a same function and didn't make any changes to get into hotel view.
    I had bypass the crypto until the OnlineConfirmationEvent and after that, the emulator didn't receive any other packet and the client dc.
    So, what is the problem lol.



Advertisement