Valhalla Legends Forums Archive | Battle.net Bot Development | 0xf

AuthorMessageTime
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

[code]
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.

[/code]
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".
[/quote]

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
[code]
C5 01 00 00
[/code]

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


Edit: Added code tags.
February 29, 2004, 11:40 PM
Arta
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.
February 29, 2004, 11:53 PM
Eli_1
??? *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
February 29, 2004, 11:54 PM
o.OV
[quote author=Eli_1 link=board=17;threadid=5521;start=0#msg46792 date=1078098891]
??? *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
[/quote]

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:
[code]
?Val("&H000001C5")
[/code]

Add-On:

[code]
?Val("&HABC")
[/code]
A is 10
B is 11
C is 12
[code]
?(A * 16 ^ 2) + (B * 16 ^ 1) + (C * 16 ^ 0)
[/code]
2748
March 1, 2004, 12:19 AM
Eli_1
ah, thanks a lot
March 1, 2004, 12:30 AM
tA-Kane
[quote author=o.OV link=board=17;threadid=5521;start=0#msg46797 date=1078100349][code]?(A * 16 ^ 2) + (B * 16 ^ 1) + (C * 16 ^ 0)[/code][/quote]

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:
[code]?((A * (16 ^ 2)) + (B * (16 ^ 1)) + (C * (16 ^ 0)))[/code]
March 1, 2004, 2:08 AM
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. :)
March 1, 2004, 2:38 AM

Search