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

Updating Packets

Confused.
Joined
Jan 27, 2007
Messages
145
Reaction score
2
Hello,

I was wondering if anyone could simply explain how to update packets to a new Habbo.SWF release. I'm not asking for anything to be released, but rather how to do it. I don't know what to look for in the actionscript of habbo_scripts.txt when I run that through AS3 Sourcerer.

I am able to search for example: [2341]

And that comes up with a line in the file such as: _-14J[2341] = _-2iw;

What can I do from here, and how do I find what this packet ID links to in Composers.cs and Events.cs.

Is this the best way to find the IDs, or is there another way? If this is, how do you do it?

Thanks, any information would be very helpful.
 
Experienced Elementalist
Joined
May 8, 2009
Messages
262
Reaction score
63
I would love to know this too! It would be extremely helpfull if someone that understands these mechanisms would take his/hers time to reply to this topic and help every single one of us out in the retro community. I could imagine that it's getting pretty annoying for the developers when all of us keep begging for help when it comes to packet updating/logging (some of them must even be sending private messages to them...). If it could be explained in depth by a friendly dev, there won't be any need for further questioning in this section about packet logging.

Amen.
 
Last edited:
Upvote 0
Confused.
Joined
Jan 27, 2007
Messages
145
Reaction score
2
And not to mention, we would be able to help other people with that knowledge so they don't come begging to the lead devs. Win-win for everyone? But on a serious note, it would be greatful to know.
 
Upvote 0
Joined
Aug 10, 2011
Messages
7,399
Reaction score
3,308
I'm not 100% sure but what looks logic to me:

Code:
            _-3KH[4000] = _-1-W;

So for the array _-3KH object and header 4000 we find class name _-1-W

Code:
    import _-4Z-._-1-W;

So _-4Z- is the super class for our specific header class.

Code:
//_-4Z-._-1-W

package _-4Z-{
    import _-2DF.*;

    public class _-1-W implements _-U1, _-2v2 {

        public function dispose():void{
        }
        public function _-4Iw():Array{
            var k:String = "LEONS_EPIC_SWF";
            return (new Array(k));
        }

    }
}//package _-4Z-

So our structure is a String.

I've never done this before though, but with my knowledge about classes and their super classes I think:
Code:
package _-14Z{
    import _-2DF.*;

    public class _-1cd implements _-U1 {

        private var _-200:int;
        private var _-W8:int = 0;
        private var _-2bu:int;
        private var _-4Uj:int = 0;

        public function _-1cd(_arg1:int, _arg2:int=0, _arg3:int=0, _arg4:int=0){
            this._-200 = _arg1;
            this._-W8 = _arg2;
            this._-2bu = _arg3;
            this._-4Uj = _arg4;
        }
        public function dispose():void{
        }
        public function _-4Iw():Array{
            return ([this._-200, this._-W8]);
        }

    }
}//package _-14Z

So I think public function _-1cd is our constructure and takes the structure int, int = 0, int = 0, int = 0 and sets them to the current object as parameters.

Please can someone confirm me if I'm close, I've never done this before :zippy:

EDIT: For people that dont know, the first int IS required. The other three are optional as they get set to 0 if they are not defined.
 
Last edited:
Upvote 0
Confused.
Joined
Jan 27, 2007
Messages
145
Reaction score
2
@nyae Right, but now what do you do with that information, and how do you know what composer or event it is?
 
Upvote 0
Confused.
Joined
Jan 27, 2007
Messages
145
Reaction score
2
Right, okay.

So, say I found that, now how do I know what line in Events.cs to replace?



For example. I'm searching for the new packet ID: 672.

In habbo_scripts.txt I search for [672].

Next, I find this line:
Code:
 _-5Wi[672] = _-48l;

And now I copy _-48l and search for it.

It comes up with:
Code:
    import _-3oA._-48l;

Then what do I do after this? What does this mean?
 
Upvote 0
Joined
Aug 10, 2011
Messages
7,399
Reaction score
3,308
You have to take the paramters that are being used in the constructor I think.

Like I said, I'm not sure.

Code:
package _-14Z{
    import _-2DF.*;

    public class _-14T implements _-U1 {

        private var _-2bu:int = 0;
        private var _-4Uj:int = 0;
        private var _-200:int;
        private var _-Lh:String;
        private var _-0Ns:String;

        public function _-14T(_arg1:int, _arg2:String, _arg3:String="", _arg4:int=0, _arg5:int=0){
            this._-200 = _arg1;
            this._-Lh = _arg2;
            this._-0Ns = _arg3;
            this._-2bu = _arg4;
            this._-4Uj = _arg5;
        }
        public function dispose():void{
        }
        public function _-4Iw():Array{
            return ([this._-200, this._-Lh, this._-0Ns]);
        }

    }
}//package _-14Z

You see public class _-14T. Then you see the function _-0Qk(). The constructor is always the same name of its class name. Don't rely on the order of its properties as they're not always the same order they are requested in the constructor.

For the people that don't know what a constructor is: It creates the object from the class.

For example we have a class items. Every item has a x, y, z position. So if we call the function items(1, 1, 3){} we create a new instance of the class items.
 
Last edited:
Upvote 0
Confused.
Joined
Jan 27, 2007
Messages
145
Reaction score
2
I think we're stuck in a stand-still between the information.

I'm trying to update packet headers in Events.cs and Composers.cs, yes?

Now when I look into habbo_scripts.txt and I want to find a new packet header ID, I follow which steps that will give me what the ID is?

Ie, I have an unhandled header 3229. Where do I find what the definition is of it in Events.cs (ie internal static int GuideChat = 3982;//138)

My question is, how do I find what GuideChat is, or any other name.
 
Upvote 0
Confused.
Joined
Jan 27, 2007
Messages
145
Reaction score
2
Alright, thanks. This still isn't solved as I haven't figured out how to do it, but you have been extremely helpful nyae. +1.
 
Upvote 0
Joined
Aug 10, 2011
Messages
7,399
Reaction score
3,308
So I figured it out. Using PhoenixSWF for this. Doesn't matter what SWF you use, all the same I think.

Lets take:

Code:
  _events[620] = _-1tN;

Find class _-1tN
Code:
	public class _-1tN extends _-2qA implements IMessageEvent {
		public function _-1tN(_arg1:Function){
			super(_arg1, _-a2);
		}
		public function _-0B0():_-a2{
			return ((this._-2Ja as _-a2));
		}
	}

Go to the super class _-a2:

Code:
	public class _-a2 implements _-5U {
		private var _-0SH:Boolean;
		private var _-1sO:int;
		private var _-ya:Array;
		private var _-2Pq:Array;
		private var _-1RU:Array;

		public function get _-0mk():Boolean{
			return (this._-0SH);
		}
		public function get _-09x():int{
			return (this._-1sO);
		}
		public function get _-1BP():Array{
			return (this._-ya);
		}
		public function get _-P9():Array{
			return (this._-2Pq);
		}
		public function get _-28J():Array{
			return (this._-1RU);
		}
		public function flush():Boolean{
			return (true);
		}
		public function parse(_arg1:_-0Mb):Boolean{
			var _local2:int;
			this._-ya = [];
			this._-2Pq = [];
			this._-1RU = [];
			this._-0SH = _arg1._-0ZR();
			this._-1sO = _arg1.readInteger();
			var _local3:int = _arg1.readInteger();
			_local2 = 0;
			while (_local2 < _local3)
			{
				this._-ya.push(_arg1.readInteger());
				_local2++;
			};
			_local3 = _arg1.readInteger();
			_local2 = 0;
			while (_local2 < _local3)
			{
				this._-2Pq.push(_arg1.readInteger());
				_local2++;
			};
			_local3 = _arg1.readInteger();
			_local2 = 0;
			while (_local2 < _local3)
			{
				this._-1RU.push(_arg1.readInteger());
				_local2++;
			};
			return (true);
		}
	}

Go to the parse function:

Code:
	public function parse(_arg1:_-0Mb):Boolean{
		var _local2:int;
		this._-ya = [];
		this._-2Pq = [];
		this._-1RU = [];
		this._-0SH = _arg1._-0ZR();
		this._-1sO = _arg1.readInteger();
		var _local3:int = _arg1.readInteger();
		_local2 = 0;
		while (_local2 < _local3)
		{
			this._-ya.push(_arg1.readInteger());
			_local2++;
		};
		_local3 = _arg1.readInteger();
		_local2 = 0;
		while (_local2 < _local3)
		{
			this._-2Pq.push(_arg1.readInteger());
			_local2++;
		};
		_local3 = _arg1.readInteger();
		_local2 = 0;
		while (_local2 < _local3)
		{
			this._-1RU.push(_arg1.readInteger());
			_local2++;
		};
		return (true);
	}

First some variables are assigned. Then we get _arg1._-0Zr().
This function reads a boolean.

Then we get a read integer.
Then we get another read integer. Assigned as _local3

Then we get a while loop
while(i < _local3){
readInteger();
i++
}

Then we get another read integer. Assigned as _local3. Overwrites old value.

while(i < _local3){
readInteger();
i++
}

Then we get another read integer. Assigned as _local3. Overwrites old value.

while(i < _local3){
readInteger();
i++
}

So we end up having the structure:
Code:
	Header 620
	Boolean
	Int
	for{ int }
	
	Int
	for{ int }
	
	Int
	for{ int }
 
Upvote 0
Skilled Illusionist
Joined
Dec 20, 2013
Messages
365
Reaction score
64
@nyae how to u read it so uknow where to plæace it like where do 620 need to be in the emulator and is it incoming or outcommig ??=
 
Upvote 0
Joined
Aug 10, 2011
Messages
7,399
Reaction score
3,308
nyae how to u read it so uknow where to plæace it like where do 620 need to be in the emulator and is it incoming or outcommig ??=

If you have no coding experience, don't even start doing this as you probably would screw things up instead of adding them.

620 is just a random header. Every release the headers are different. Its more a tutorial on how to get the structure if you have the header.
 
Upvote 0
Skilled Illusionist
Joined
Dec 20, 2013
Messages
365
Reaction score
64
If you have no coding experience, don't even start doing this as you probably would screw things up instead of adding them.

620 is just a random header. Every release the headers are different. Its more a tutorial on how to get the structure if you have the header.
ill do but ill never readed packets and ill asking for when u got the packet id u need to place it in ur emu some where but i dont understand how to read it so uknow where to drop it in emulator
 
Upvote 0
Skilled Illusionist
Joined
Dec 20, 2013
Messages
365
Reaction score
64
incoming & outgoing classes...

yes but as u know there is loads of packets in the incoming and outcoming like gameevent etc handshake etc and lets say ill packet log ehm event and get (number) then go into the swf etc get the packet how do iknow where to place it in incoming or outcoming - Thanks for all the help u alreayd posted to the forum :)
 
Upvote 0
Skilled Illusionist
Joined
Dec 20, 2013
Messages
365
Reaction score
64
If you packetlog, you will automatically obtain the header so then there is no need to go into the SWF. You only go to the SWF if you want to find a structure of a packet when having the header.
Yes But how do i know where to place the packet example just a random number 2040 is a packet how do iknow where to place it
 
Upvote 0
Back
Top