• Welcome to Valhalla Legends Archive.
 

Help 0X7F

Started by spear, April 03, 2005, 02:06 PM

Previous topic - Next topic

spear

Hey. Im trying to parse 0X7F (Clan member update), and I am almost totally lost. So far, all I have been able to get out of it is this:
(My packet dump:)

Unidentified Packet: 0x7F Recieved On: 4/3/2005 At: 1:55:23 PM
0000:  FF 7F 0D 00 41 72 6D 79 7A 00 03 01 00            ÿ..Spear.....



Asc(Mid(Data, 10 + Len(Trim(Split(Mid(Data, 10), Chr(0))(0))) + 1, 1))

This returns 0 or 1, depending if the user is going offline or comming offline.
That's all fine and dandy, but I am struggling to get the username and the rank, in the same way I got the the online/offline status, so I can use it appropriatley in my Clan list.
If somebody could show me how to get these, (username/rank), it would help me tons.
Any help would be greatly appreciated.

UserLoser.

I know you're new and all, and we should be nice to new people.. but if you wrote the rest of the bot you should be able to pick apart the packet into a string and three bytes

BaDDBLooD

Quote from: UserLoser on April 03, 2005, 02:23 PM
I know you're new and all, and we should be nice to new people.. but if you wrote the rest of the bot you should be able to pick apart the packet into a string and three bytes

It is possible he is using a Open Source Project as a starting point, or.... something else.
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Soul Taker

Then he should be researching this kind of stuff.

BaDDBLooD

Quote from: Soul Taker on April 03, 2005, 06:44 PM
Then he should be researching this kind of stuff.

Yeah.. ok, you got me on that one.
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

spear

Could anybody reccomend some sites where I could reasearch this?

spear

That doesnt help me find the stuff withing the packet and 'extract it', all that does is tell me that it's there. Well no duh...

Blaze

Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

spear

Quote from: Blaze on April 04, 2005, 02:23 PM
Learn VB?

Right, that was a pretty stupid reply. I'm asking for websites where I can learn about this stuff, so yeah...

Blaze

If you know the language, taking a string here, and a string there shouldn't be to difficult.
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Hdx

#11
0000:  FF 7F 0D 00 41 72 6D 79 7A 00 03 01 00            ÿ...Spear...
Quote(STRING)     Username
(BYTE)        Rank
(BOOLEAN)    Online (8-bit)
(BYTE)        Unknown
Hurm, lets work through this:
FF 7F 0D 00 ÿ... The header, Dont need this, toss it. So the next thing to come would be a String....
41 72 6D 79 7A 00 Spear. Strings for *most* Binary servers are Null terminated, so the string ends at Chr$(&H0), So you trim it off resulting in: Spear
Next to come is a Byte, for the rank.
03 . Byte = 1 byte.. the smallest thing above a bit... This byte is used to determin the rank, so compare it to this list:
Quote0x00: Initiate that has been in the clan for less than one week
0x01: Initiate that has been in the clan for over one week
0x02: Member
0x03: Officer
0x04: Leader
and you get the person is an Officer. Now next to come is a Boolean(8-bit).
01 .a boolean (8-bit) is just a byte, that only has two possible values, 0 and 1. 1 byte = 8 bits, Just fyi. The value ofp this one is 1, so he is online. Next is the unknow, dont need it so jsut get rid of it.

It's not that hard, just work form the biginning of the packet, and remove what you have parsed. Untill you eaither get good, or make a Packet-DeBuffer object, you'll use a lot of Data = Mid(Data, #)'s

I HIGHLY suggest you do some other work with binary values, before you get into a Bnet bot.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

MyndFyre

Quote from: HdxBmx27 on April 04, 2005, 06:12 PM
Strings for *most* Binary servers are Null terminated
I am not meaning to pick on you, but this particular statement is erroneous.  Strings for all of Battle.net's binary protocol are null-terminated.  However, it is often an inefficient way to store strings in terms of speed for reading.  The C language encodes strings with a null terminator, allowing for variable-length strings of as much length as memory allows.  Other languages -- Pascal comes to mind -- prefix the string with a byte indicating its length.  So for instance, the string "Spear" would be encoded:
05 53 70 65 61 72
Strings encoded this way are called "Pascal strings."
Other languages use a similar method of encoding strings, but instead of using a single byte to encode the length -- which limits the length of the string to 255 -- they use two bytes.  These strings are called "Wide Pascal" strings and can store up to 65,535 characters.

So just as a heads-up -- don't assume that all strings in all binary formats are null-terminated.  I know since .NET strings are interned, there is a performance hit associated with making strings by reading them a character at a time, and so .NET strings are stored as Wide Pascal when using the Framework's binary reader/writer classes.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Hdx

Well, Thanks for that information, But I was pertaing to the Chr$(&HA) terminated strings used in Some parts of D2GS, and D2 Realm. But thats for telling me things I don't know, I'll try and remeber it.

Anything else you fnd even slightly errorus? (besides grammar and spelling)
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Kp

Byte is not the next biggest thing after bit.  A nibble (4 bits) comes between them.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!