I saw Moogly's thread with fuserights and I just wanted to explain how packets work with Sulake's client, and since I do use this thing pretty much to find structures of packets, it will be useful for alot of server developers.
If you are a noob and you don't know where I'm talking about, or are not interested at all & don't want to learn, leave now. =]
Okay, I'll release my small 'Nillus Packet Scout', an application like HoloKIT with some decoders in it, but one big handy thing, the 'VL64 string analyzer'.
VL64 is most used in server > client packets.
What's VL64? Well, it's an encoding for numbers, it makes numbers 'understandable' for the Habbo client.
Example;
I = 1
J = 2
K = 3
PA = 4
You can see an ascending of the numbers, see? [1=2-3]
And you also see something of the alphabet in it. [I-J-K]
-1 in VL64 is M.
Okay, that looks pretty easy.
How does a 'big' number in VL64 looks like?
We'll encode 8123732.
Result: "hUuoG"
Ah yeah! Self explaining!
Not really lol.
Well, if you see the code of the encoding (can be found in JASE etc, HabboEncoding class), it's pretty logical.
But why using such cryptic things just for numbers?
At packets, Habbo likes to use alot of numbers after each other without delimiters.
Like if you want to use 10, 39, 843, and 7 after each other in a packet, you can do 10398437, but then it's a whole different number.
There's where VL64 comes in.
Let's encode the numbers 10, 39, 843 and 7...
10: RB
39: SI
843: [RC
7: SA
"Ehm, yeh, and now? Why?"
Well, VL64 has a 'magical' part that makes it that good as it is:
If you decode a whole VL64 string, so like RBSI[RCSA, it'll return as number ONLY the first encoded number in the string!
So, only the 10 (the first encoded number of that string) will be the result, while you've inputted a whole string with three other VL64 numbers!
Now it'll get tricky, but I'll show you how to decode a string like that to it's original numbers.
1) Decode RBSI[RCSA, 10 will be the result
2) Encode 10 to VL64, so it'll become RB.
3) RB is 2 characters, R-B
4) Now we 'cut' the first number (RB = 10) from the string RBSI[RCSA, and we know the lenght of the first part. In a .NET language for example, we can do that by this way;
STRING OBJECT.Substring(start,length).
If length isn't supplied than it will trigger an overload (a 'brother' of a void/function) that will simply 'run to the end of the string', so taking everything after 'start'. That's what we want, since we only want to cut off the first part and keep the other part.
So: STRING OBJECT.Substring(2)
It'll result in;
SI[RCSA
Okay, now I can say, just repeat till you are done! =D
Keep decoding the whole string to one number, store the number somewhere to work with it or w/e, and encode the number to a VL64 string, get it's length (STRING OBJECT.Length property in .NET), and keep the string after that part by using string manipulators such as .Substring.
It appears that it's hard to explain lol, code says more than thousand words! ;P
PHP Code:
// encodeVL64, returns a string
// decodeVL64, returns an integer
string SomeInput = "PAJIKPASASF";
while(SomeInput != "") // Keep looping this loop till the string is empty (so, completed with decoding)
{
int currentNumber = decodeVL64(SomeInput);
// Do something with current number, write it in database or something, just where you need the number for
int currentNumberLength = encodeVL64(currentNumber).ToString().Length; // Encode the number to it's VL64 equivalent to see what it would be if you only encoded that number to VL64, and get it's length
someInput = someInput.Substring(currentNumberLength); // Only keep the part of SomeInput after the string
} // Proceed to next cycle of the loop (so, decode the next number)
That's how you can use alot of numbers after each other, while the numbers stay on their own && this is what Habbo wants to keep their packets small.
I hope you have understood something of it.
Anyway, that's what the VL64 analyzer in Nillus Packet Scout does, and tbh, it helps me alot at finding packet structures.
I'll show how it can decode a BattleBall packet for you, which gives you alot more 'understanding' of how it works.
Full packet + header:
CtIQAJPCSAIJPCHJHJXKDX]BIIJQAPCRE
Okay, Ct is the header, but it looks like a load of crap.
Nope, it are just numbers!
Let's shove the part after the header ("Ct") in my app and hit the button...
Result:
Result of this VL64 scout session was:
# I = 1
# QA = 5
# J = 2
# PC = 12
# SA = 7
# I = 1
# J = 2
# PC = 12
# H = 0
# J = 2
# H = 0
# J = 2
# XKD = 1068
# X]B = 628
# I = 1
# I = 1
# J = 2
# QA = 5
# PC = 12
# RE = 22
Processed input string summary: I-QA-J-PC-SA-I-J-PC-H-J-H-J-XKD-X]B-I-I-J-QA-PC-RE
Woo, numbers!
There you can do something with, can't you?
& That's where it comes handy while coding.
How it works?
It just runs that loop till the string is empty, and outputting the result after decoding done.
A good example of where it's used is BattleBall/SnowStorm and the Recycler/Ecotron, alot of numbers after each other as tidy as possible.
SCREENSHOT:

That's what it can do. =]
CREDITS:
- Jeax/Josh Comery for the .dll with encoding [also used in Holograph Emulator]
DOWNLOAD:
RapidShare
VIRUSSCAN:
None, people who think that I post viruses are haters.
Have fun, hope it helps you.
It does help me alot while coding, & that's why I made it.
If it's too hard for you, well, then you probably don't need it at all.
It took a while for me before I started to see such things.
- Nillus