• Welcome to Valhalla Legends Archive.
 

Format to send packets in vb?

Started by Undeadwarrior, August 27, 2006, 09:48 AM

Previous topic - Next topic

Undeadwarrior

I know how to send data with vb but i cant seem to send data to the battle.net servers in the proper format so to speak. Im logging using ethereal and i am sending data to the server but no matter what i seem to do its never the proper format. Any help or links to information would be awsome.

l2k-Shadow

Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Undeadwarrior

Im well aware of those im asking how to to send them to the server it seems simply sending them as a string or in hex dont work. I send them and log it and it never seems to be correct so the server ignores it. Is there something else i have to do?

rabbit

Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Undeadwarrior

i did sent 01 1e 1a 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 12 3c 00 40 19 38 5c 25 c5 c6 01 40 41 d9 af ea c4 c6 01 e0 01 00 00 09 04 00 00 09 04 00 00 09 04 00 00 45 4e 55 00 31 00 55 53 41 00 55 6e 69 74 65 64 20 53 74 61 74 65 73 00 ff 06 14 00 36 38 58 49 4c 54 52 44 2a 00 00 00 00 00 00 00

and when logging packets with ethereal it seems that winsock took than and converted it to hex so i ended up sending the hex of the hex. Ive tried sending the string but theres multiples .'s in the string and those all get switched to the hex value of 2e even though thats not what they are suppose to be. Im inputting the correct data it seems as though im missing a step somewhere where i need to do some form of conversion on the data?

l2k-Shadow

#5
lol, man u just gotta learn what hex is and how internet works. in simple terms each one of those numbers represents a single character so when you see ff you would send Chr$(&HFF), also having a packet buffer helps GREATLY for forming DWORDS, WORDS, etc... also learning what those are would help as well.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Undeadwarrior

I know what hex is and i know what a dword is ive been reversing games for some time now. Im just new to visual basic im assuming Chr$(&HFF) is how i need to send my data? the &h showing that the ff is hex and not just a text string correct?

Yegg

#7
Quote from: Undeadwarrior on August 27, 2006, 11:25 AM
I know what hex is and i know what a dword is ive been reversing games for some time now. Im just new to visual basic im assuming Chr$(&HFF) is how i need to send my data? the &h showing that the ff is hex and not just a text string correct?

If you have been "reversing games for some time now", you wouldn't be experiencing this problem regardless of language. Chr(&HFF) simply converts 0xFF into a character ("\xFF").  I don't know what the hell Chr$ is, I don't know the VB language. Anyways, hex are just numbers with a base of 16, nothing special about them really. Ethereal should show each packet in hex form, and the same packet in a string format so that you, as a human, can read it easier.

When you do, Socket.Send(Chr(&HFF)), it should be the same as if you did Socket.Send("\xFF"). I don't know if VB6 allows you to even use "\xFF" the way I did, I don't see why it shouldn't. Anyways, ask someone for their VB PacketBuffer class and they can explain to you how it works, because apparently you don't know what one is. Creating a word, a double word, etc. should be no problem, VB6 probably makes that task pretty easy for you.

By the way, in your data, right after the protocol byte, you should be sending 0xFF and then the length of the message. Look at the protocol formats for BNCS on BnetDocs.valhallalegends.com. It also looks like you're using the logon sequence for W2BN/DRTL/DSHR, you could be using the sequence that Starcraft uses. It will work for W2BN, I don't know if it will work for DRTL or DSHR. The sequence that Starcraft uses is much easier and there's less work to it.

Undeadwarrior

Thats a D1 retail packet. And yes i knew hex was a base 16 numbering system but thanks anyway. I was logging D1 and using it to start with to avoid having to worry about cd key hashing until i can actually send the data properly. As for putting together a packet builder/parser im not worried about that at the moment what i have set up currently isnt even a bot really just connecting and sending the packet and listening for a a message back. Once i get it sending correctly ill put together a layout and actually build the program correctly. I had a busy day so i dont have time to piss with it tonight ill check into what you said tomorrow and hopefully get it figured out :) Thanks for the help.