• Welcome to Valhalla Legends Archive.
 

0xf

Started by Eli_1, February 29, 2004, 05:40 PM

Previous topic - Next topic

Eli_1

people here inspired me to try to move away from CSB, so I'v started reading up on some of the docs here

I was reading about 0xf and saw this
Quote
Here's an example 0xf packet that's Event ID is 0x00000001:
Figure 1.1


RECV-> 0000   FF 0F 3D 00 01 00 00 00 00 00 00 00 C5 01 00 00    ..=.............
RECV-> 0010   00 00 00 00 0D F0 AD BA 0D F0 AD BA 53 61 72 63    ............Sarc
RECV-> 0020   61 73 74 69 63 00 52 41 54 53 20 30 20 30 20 30    astic.RATS 0 0 0
RECV-> 0030   20 31 20 30 20 30 20 30 20 30 20 30 00              1 0 0 0 0 0.


The format of the 0xf packet is the same throughout all Event IDs. This means that if you manage to parse a 0x00000001 Event ID, you'll be able to parse all other events.

Now, looking at the packet in Figure 1.1, you see that the user's flags is 0x00000000, ping is 453, account is "Sarcastic", and statstring is "RATS 0 0 0 1 0 0 0 0 0".

I'm able to get all that information out of the packet EXCEPT ping...
and I'm guessing the ping is somehow suppost to be from the DWORD

C5 01 00 00


I just don't understand how though... any help?


Edit: Added code tags.

Arta

#1
The packet is displayed in hexadecimal. The hexadecimal number 1C5 is 453 in decimal.

NB: It's 1C5 and not C501 because of its endianness. The dword's value is 000001C5.

Eli_1

#2
 ??? *smiles and nods*
Arta, I'm sorry but I still don't get it  :'(

I get what you mean about how it's 000001C5, but I don't understand how you get 453 from that

o.OV

#3
Quote from: Eli_1 on February 29, 2004, 05:54 PM
??? *smiles and nods*
Arta, I'm sorry but I still don't get it  :'(

I get what you mean about how it's 000001C5, but I don't understand how you get 453 from that

Our regular number system is
composed of 10 different characters
to represent a single "digit"
where as..
hexadecimal uses 16 different characters.

For better explanation of it.. You should use Google.

Run this from your immediate window:

?Val("&H000001C5")


Add-On:


?Val("&HABC")

A is 10
B is 11
C is 12

?(A * 16 ^ 2) + (B * 16 ^ 1) + (C * 16 ^ 0)

2748
If the facts don't fit the theory, change the facts. - Albert Einstein

Eli_1


tA-Kane

Quote from: o.OV on February 29, 2004, 06:19 PM?(A * 16 ^ 2) + (B * 16 ^ 1) + (C * 16 ^ 0)

If you're not good with remembering in what order mathematical expressions are done (for example, with "A * 16 ^ 2", you might think you multiply A by 16 and then raise it to the second power... (which is wrong)), you could use this instead:
?((A * (16 ^ 2)) + (B * (16 ^ 1)) + (C * (16 ^ 0)))
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

Kp

However, be aware that many good languages consider ^ to be the xor operator, not the exponentiation operator.  From what I've seen, ** is widely agreed to represent "to the power of" (even though that operator doesn't exist in some of the major languages).  Just a remark on the dangers of using too much shorthand. :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!