Valhalla Legends Forums Archive | Battle.net Bot Development | 0x00 (Null) = ASCII 3 + ASCII 0 + ASCII 0???

AuthorMessageTime
Luxer
After running BNLS querys though a BNLS tester, I discover how easy packets are.. But, what truley confuses me is that the first 0 is 0x00 is ASCII 3... Also, in 0x01 (Cdkey I hope) The first zero is ASCII 16? Also, why are there 4 ASCII 0 between the packets "flag" and the contents?
August 19, 2004, 6:14 PM
Yoni
Could you rephrase your question in a way that doesn't cause parser errors?
August 19, 2004, 6:24 PM
Luxer
Assumeing that you mean you can't read my post, sure.

How do I figure the ASCII value of the first number of a packet flag? For example:

0x00 (Null)

First Zero: ASCII 3
Second Zero: ASCII 0
Third Zero: ASCII 0

If you still have no idea that I am talking about, forget it and I will just figure it out.
August 19, 2004, 6:27 PM
Yoni
I think you are confused by the BNLS protocol spec.
Let me clear it up for you.

http://yoni.valhallalegends.com/BNLSProtocolSpec.txt

Have a look under "BNLS General Info".

[color=lightgreen]BNLS message format:

(WORD) Message size, including this 3-byte header
(BYTE) Message ID
(....) Message-dependant data[/color]

Every message has a 3-byte header as explained above.

The two bytes of any message therefore represent the size of the message, in bytes.

For example, the BNLS_NULL (0x00) message contains no data. Therefore, the size of any BNLS_NULL message is exactly 3 bytes - the header only.

The first two bytes (length) therefore receive the value 3.
Written in hex: 0x0003
In little endian: 0x03, 0x00
So the first byte is 3, the second is 0.

The third byte is the ID. BNLS_NULL has ID 0x00. So the third byte is 0.

Complete message:
[color=lightgreen]03 00 00[/color]
August 19, 2004, 6:32 PM
Luxer
Ahhh... Thanks. So the first character of my packets should be the packets length?
August 19, 2004, 6:34 PM
Yoni
No, the first 2 bytes. In little endian format.

For example if the length is 0xABCD, then the first byte should be 0xCD, and the second should be 0xAB.
August 19, 2004, 6:36 PM

Search