• 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.

Habbo Emulator [Packet]

Junior Spellweaver
Joined
Nov 19, 2011
Messages
177
Reaction score
16
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 :)



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 :/
 
Junior Spellweaver
Joined
Nov 19, 2011
Messages
177
Reaction score
16
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 ? :/
 
Upvote 0
Junior Spellweaver
Joined
May 21, 2011
Messages
154
Reaction score
47
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!
 
Upvote 0
Joined
Apr 24, 2013
Messages
1,685
Reaction score
1,135
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.
 
Upvote 0
Joined
Feb 22, 2012
Messages
2,103
Reaction score
1,271
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.
 
Upvote 0
Junior Spellweaver
Joined
Oct 20, 2013
Messages
105
Reaction score
27
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)[COLOR=#000000]
[/COLOR]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 poop in your emulator and you can send a random string to the swf


Greetz: Wesley
sorry for my bad english!
 
Upvote 0
jā€™aime ma famille
Joined
Aug 24, 2012
Messages
604
Reaction score
304
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.
 
Upvote 0
Junior Spellweaver
Joined
Nov 19, 2011
Messages
177
Reaction score
16
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.

989vCU0 - Habbo Emulator [Packet] - RaGEZONE Forums


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..
 

Attachments

You must be registered for see attachments list
Upvote 0
Joined
Jun 25, 2009
Messages
831
Reaction score
475
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.

989vCU0 - Habbo Emulator [Packet] - RaGEZONE Forums


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:
       if (this._currentClient != null && this._currentClient.GetRC4() != null)
            {
                this._currentClient.GetRC4().Decrypt(ref data);
            }

E.g.

PHP:
if (data.Length == 0 || _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 = 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();
            }
 

Attachments

You must be registered for see attachments list
Last edited:
Upvote 0
Junior Spellweaver
Joined
Nov 19, 2011
Messages
177
Reaction score
16
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:
       if (this._currentClient != null && this._currentClient.GetRC4() != null)
            {
                this._currentClient.GetRC4().Decrypt(ref data);
            }

E.g.

PHP:
if (data.Length == 0 || _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 = 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();
            }

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.
X2MENxB - Habbo Emulator [Packet] - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Upvote 0
Junior Spellweaver
Joined
Oct 20, 2013
Messages
105
Reaction score
27
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.
Stevehabbz - Habbo Emulator [Packet] - RaGEZONE Forums

It can be a SWF problem, are you sure your furnidata is in xml format and ends in .xml?
 
Upvote 0
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
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
 
Upvote 0
Junior Spellweaver
Joined
Nov 19, 2011
Messages
177
Reaction score
16
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



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:
dyHH9ow - Habbo Emulator [Packet] - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Upvote 0
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
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?
 
Upvote 0
Junior Spellweaver
Joined
Nov 19, 2011
Messages
177
Reaction score
16
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.
 
Upvote 0
Back
Top