Valhalla Legends Forums Archive | Battle.net Bot Development | What's wrong with this packet?

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

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
August 16, 2004, 10:03 PM
ChR0NiC
Are you sending Chr(1) first? To inititiate the Battle.net logon?
August 16, 2004, 10:24 PM
TangoFour
I am

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

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

Hey, I'll try that and see what happens...
August 16, 2004, 10:25 PM
ChR0NiC
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
August 16, 2004, 10:29 PM
Yoni
I looked at the packet contents and it looks good.
For your reference, here is the packet my BinaryChat sends.
[code]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.
[/code]

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:

[quote]Connecting to Battle.net
0000: 01 ☺

Connected to BNET
Sending 0x50
[/quote]
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.
August 16, 2004, 10:30 PM
ChR0NiC
Wow, TangoFour consider yourself lucky, Yoni personally replied to your post, I mean seriously man, feel honored :o !!
August 16, 2004, 10:34 PM
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
August 16, 2004, 10:48 PM
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.
August 16, 2004, 10:56 PM
UserLoser.
[quote author=Yoni link=board=17;threadid=8186;start=0#msg75785 date=1092695449]
3. Hmm, in your second post you're sending 'enUS' for "Product language", why? I think this needs to be zero.
[/quote]

Doesn't need to be 0.
August 17, 2004, 12:48 AM
ChR0NiC
[quote author=UserLoser. link=board=17;threadid=8186;start=0#msg75826 date=1092703703]
[quote author=Yoni link=board=17;threadid=8186;start=0#msg75785 date=1092695449]
3. Hmm, in your second post you're sending 'enUS' for "Product language", why? I think this needs to be zero.
[/quote]

Doesn't need to be 0.
[/quote]

But 0 would definitely work as opposed to being unsure about enUS
August 17, 2004, 1:08 AM
UserLoser.
[quote author=ChR0NiC link=board=17;threadid=8186;start=0#msg75829 date=1092704916]
But 0 would definitely work as opposed to being unsure about enUS
[/quote]

Unsure, no. Blizzard clients don't send 0 there (atleast, Warcraft III doesnt, iirc)
August 17, 2004, 1:56 AM
ChR0NiC
[quote author=UserLoser. link=board=17;threadid=8186;start=0#msg75832 date=1092707772]
[quote author=ChR0NiC link=board=17;threadid=8186;start=0#msg75829 date=1092704916]
But 0 would definitely work as opposed to being unsure about enUS
[/quote]

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

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
August 17, 2004, 2:09 AM
Soul Taker
[quote author=ChR0NiC link=board=17;threadid=8186;start=0#msg75836 date=1092708598]
[quote author=UserLoser. link=board=17;threadid=8186;start=0#msg75832 date=1092707772]
[quote author=ChR0NiC link=board=17;threadid=8186;start=0#msg75829 date=1092704916]
But 0 would definitely work as opposed to being unsure about enUS
[/quote]

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

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
[/quote]
I only use 0 for the first DWORD, which I have no idea what else could possibly go there!
August 17, 2004, 3:57 AM
ChR0NiC
[quote author=Soul Taker link=board=17;threadid=8186;start=0#msg75858 date=1092715038]
I only use 0 for the first DWORD, which I have no idea what else could possibly go there!
[/quote]

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. :-\
August 17, 2004, 4:30 AM
TangoFour
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
August 17, 2004, 7:24 AM
KkBlazekK
Maybe if you give us your 0x50 code we can simplify whats wrong with it....
August 17, 2004, 11:10 PM
TangoFour
I found the error - it seems that I didn't invoke the start() method on the thread responsible for handling Battle.net input...

Now I'm getting all sorts of other interesting errors - errors I can understand :-)
August 20, 2004, 5:11 PM

Search