• Welcome to Valhalla Legends Archive.
 

What's wrong with this packet?

Started by TangoFour, August 16, 2004, 05:03 PM

Previous topic - Next topic

TangoFour


0000:  ff 50 3a 00 00 00 00 00 36 38 58 49 33 52 41 57   ?P:.....68XI3RAW
0001:  10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ►...............
0002:  00 00 00 00 00 00 00 00 55 53 41 00 55 6e 69 74   ........USA.Unit
0003:  65 64 20 53 74 61 74 65 73 00                     ed States.


I pretty much filled in 0 for most trivial questions - and used the version byte BNLS tells me to use...

However, upon sending this, I get disconnected - any clues?

Edit: It seems the forum doesn't like the non-standard character for 0x10

ChR0NiC

Are you sending Chr(1) first? To inititiate the Battle.net logon?

TangoFour

#2
I am


Connecting to Battle.net
0000:  01                                                ☺

Connected to BNET
Sending 0x50
0000:  ff 50 3a 00 00 00 00 00 36 38 58 49 33 52 41 57   ?P:.....68XI3RAW
0001:  10 00 00 00 53 55 6e 65 00 00 00 00 00 00 00 00   ►...SUne........
0002:  00 00 00 00 09 04 00 00 55 53 41 00 55 6e 69 74   .....♦..USA.Unit
0003:  65 64 20 53 74 61 74 65 73 00                     ed States.


I sure hope my program's not sending the packets in reverse order...

Hey, I'll try that and see what happens...

ChR0NiC

#3
Your first packet log is different than your second one.

The first DWORD after the Version Byte is &H0 in your first one but not in the second one, and, I have never seen any bot have that first DWORD after the version byte programmed in, perhaps that's your problem. Most people just leave that as &H0

Yoni

#4
I looked at the packet contents and it looks good.
For your reference, here is the packet my BinaryChat sends.
00000001  ff 50 3a 00 00 00 00 00  36 38 58 49 33 52 41 57 .P:..... 68XI3RAW
00000011  10 00 00 00 00 00 00 00  0a 00 00 65 88 ff ff ff ........ ...e....
00000021  09 04 00 00 09 04 00 00  55 53 41 00 55 6e 69 74 ........ USA.Unit
00000031  65 64 20 53 74 61 74 65  73 00                   ed State s.


There are several problems I can think of.

1. You are IP banned from Battle.net. (Probably not, if it really only disconnects you after you send this packet.)

2. I was going to comment about sending the byte 0x01, but I see that's already been covered while I was typing this.

3. Hmm, in your second post you're sending 'enUS' for "Product language", why? I think this needs to be zero.

4. I think I had more reasons but I forgot them. Oh well.

Anyway, try copying the packet I pasted above and see if it still fails.

Also, use a packet logger (if you aren't already), to make sure your bot really sends...
1. The byte 0x01
2. The message 0x50
correctly. Good luck.

Edit: I thought of another reason why this may fail.

5. In your second post, you have written:

QuoteConnecting to Battle.net
0000:  01                                                ☺

Connected to BNET
Sending 0x50
Since you've provided no code, I am not sure when exactly your bot decides to print the messages "Connecting to Battle.net" and "Connected to BNET". But, my guess is that you print "Connecting" when you start attempting the connection, and "Connected" when it's acknowledged. In that case, you might not be sending the byte 0x01 at all!

The best practice is to receive the "connected" acknowledge, then send the byte 0x01, immediately followed by the packet 0x50.

Note: You don't need to await a response to the single byte 0x01. There is no response. But it must be the first byte sent to Battle.net.

Again, you should check with a packet logger to make sure.

ChR0NiC

#5
Wow, TangoFour consider yourself lucky, Yoni personally replied to your post, I mean seriously man, feel honored :o !!

TangoFour

There's definitely something wrong with my attempt to send the 0x01

It's also not sending 0x00 to BNLS...

So the problem is not with my packet, but with the code - I made 2 separate methods for sending single-byte messages and one for byte sequences (ie packets - it takes a Packet object as a parameter).

I guess I'll be rewriting it.

Thank you for your help.

And I do feel honoured

ChR0NiC

You do not need to initiate a connection with BNLS, just start at whatever packet you feel like, no login or anything is needed.

UserLoser.

Quote from: Yoni on August 16, 2004, 05:30 PM
3. Hmm, in your second post you're sending 'enUS' for "Product language", why? I think this needs to be zero.

Doesn't need to be 0.

ChR0NiC

Quote from: UserLoser. on August 16, 2004, 07:48 PM
Quote from: Yoni on August 16, 2004, 05:30 PM
3. Hmm, in your second post you're sending 'enUS' for "Product language", why? I think this needs to be zero.

Doesn't need to be 0.

But 0 would definitely work as opposed to being unsure about enUS

UserLoser.

Quote from: ChR0NiC on August 16, 2004, 08:08 PM
But 0 would definitely work as opposed to being unsure about enUS

Unsure, no.  Blizzard clients don't send 0 there (atleast, Warcraft III doesnt, iirc)

ChR0NiC

Quote from: UserLoser. on August 16, 2004, 08:56 PM
Quote from: ChR0NiC on August 16, 2004, 08:08 PM
But 0 would definitely work as opposed to being unsure about enUS

Unsure, no.  Blizzard clients don't send 0 there (atleast, Warcraft III doesnt, iirc)

Although the clients don't send 0 for that, BNET does accept that as a possible acceptable value for that area of the packet, most people use 0 for most of their 0x50 values

Soul Taker

Quote from: ChR0NiC on August 16, 2004, 09:09 PM
Quote from: UserLoser. on August 16, 2004, 08:56 PM
Quote from: ChR0NiC on August 16, 2004, 08:08 PM
But 0 would definitely work as opposed to being unsure about enUS

Unsure, no.  Blizzard clients don't send 0 there (atleast, Warcraft III doesnt, iirc)

Although the clients don't send 0 for that, BNET does accept that as a possible acceptable value for that area of the packet, most people use 0 for most of their 0x50 values
I only use 0 for the first DWORD, which I have no idea what else could possibly go there!

ChR0NiC

Quote from: Soul Taker on August 16, 2004, 10:57 PM
I only use 0 for the first DWORD, which I have no idea what else could possibly go there!

When I packet logged my BW client, it sent an IP address for the first DWORD, I have no clue how they came up with this number but yeah, that's what is supposed to be sent I think. :-\

TangoFour

#14
The BNLS document says I should send 0x00 first, but, since it hasn't been sending that byte anyway I guess it doesn't matter.

As for choosing between USen and 0, I put in the USen after packetlogging the real War3.

I now have my Bot indeed sending the 0x01 to Battle.net to initiate the connection, and now it does send me responses - but it still disconnects me.

I guess I'll find out after my holiday