Valhalla Legends Forums Archive | Battle.net Bot Development | Connecting To Battle.net

AuthorMessageTime
Splinter
Hey all,

I'm having problems making a bot for a clan that i am involved with, if anyone could help. The problem im having is getting battle.net to allow me to move out of the public channels. I no i must send them information such as the product key and game name etc. From wat i understand this is to be sent just after connection. but what i dont understand is how to send it.

<Connect to Battle.net>

Its this point im stuk at, after connecting to the server i need to no what to send to send to the server.


<Login>

I no that sending the text bellow with out the + and spaces allows the user to login to battle.net.

Chr(3) + Chr(4) + Username + Chr(13) + Chr(10) + Password + Chr(13) + Chr(10)



I'm new to this so if anyone could help i would be very greatfull.

March 27, 2004, 7:30 PM
BaDDBLooD
that would be for Chat

you need to dl darkminion's packetbuffer class

http://botdev.valhallalegends.com ( Documents )

for BNET

you have to connect send Chr(1)

Followed by 0x50 ( sid_auth_info )

Format:

(DWORD)       Protocol ID (0)
(DWORD)       Platform ID
(DWORD)       Program ID
(DWORD)       Version Byte
(DWORD)       Product language
(DWORD)       Local IP for NAT compatibility*
(DWORD)       Time zone bias*
(DWORD)       Locale ID*
(DWORD)       Language ID*
(STRING)       Country abreviation
(STRING)       Country

you should be able to understand most of those by reading bnetdoc's.

i am sure you can figure out what is next by reading bnetdoc's:

Http://bnetdocs.valhallalegends.com

after you send 0x50, you recieve 0x50 ( sid_auth_info ) & 0x25 ( sid_ping )

remember you have to use a packetlogger, to see what bnet is sending you!
March 27, 2004, 7:34 PM
Splinter
So would i be right in thinking that i should send the following:


Chr(1) + 0 + 68XI + PXES + 7Cx0 + 0 + 0 + 0 + 0 + 0 + UK + United Kingdom

i have reversed the platform and game as instructed by bnet docs.
March 27, 2004, 9:05 PM
iago
There is *a lot* more to making a binary connection than a chat connection.

Basically, what you have to do, is emulate one of the real clients (starcraft, for example) and trick the server into thinking you're running a game of starcraft.

March 27, 2004, 10:11 PM
BaDDBLooD
[quote author=iago link=board=17;threadid=6023;start=0#msg52100 date=1080425503]
There is *a lot* more to making a binary connection than a chat connection.

Basically, what you have to do, is emulate one of the real clients (starcraft, for example) and trick the server into thinking you're running a game of starcraft.


[/quote]

Basically ;)
March 27, 2004, 11:36 PM
Eli_1
[quote]

These packet sequences are correct, but may vary from time to time. There is no guarantee that Battle.net will always send packets in the same order.

Starcraft/Broodwar/Diablo II/Lord of Destruction (STAR/SEXP/D2DV/D2XP)
X-Sha-1
SEND -> Protocol byte (01)
SEND -> SID_AUTH_INFO (0x50)
RECV <- SID_PING (0x25)
RECV <- SID_AUTH_INFO (0x50)
SEND -> SID_PING (0x25) [Optional]
SEND -> SID_AUTH_CHECK (0x51)
RECV <- SID_AUTH_CHECK (0x51)
SEND -> SID_LOGONRESPONSE (0x29)
RECV <- SID_LOGONRESPONSE (0x29)
SEND -> SID_UDPPINGRESPONSE (0x14) [Game Specific: SEXP/STAR/W2BN]
SEND -> SID_ENTERCHAT (0x0A)




Warcraft 2 BNE (W2BN)
SEND -> Protocol byte (01)
SEND -> SID_CLIENTID2 (0x1E)
SEND -> SID_LOCALEINFO (0x12)
SEND -> SID_STARTVERSIONING (0x06)
RECV <- SID_LOGONCHALLENGEEX (0x1D)
RECV <- SID_PING (0x25)
RECV <- SID_STARTVERSIONING (0x06)
SEND -> SID_PING (0x25) [Optional]
SEND -> SID_REPORTVERSION (0x07)
RECV <- SID_REPORTVERSION (0x07)
SEND -> SID_UDPPINGRESPONSE (0x14) [Optional]
SEND -> SID_CDKEY2 (0x36)
RECV <- SID_CDKEY2 (0x36)
SEND -> SID_LOGONRESPONSE (0x29)
RECV <- SID_LOGONRESPONSE (0x29)
SEND -> SID_ENTERCHAT (0x0A)
[/quote]

That's all the things your going to need to send/recv to log onto bnet useing said clients. And you don't literally send, "0x50, 0x25", you have to read the info at bnetdocs to find out what those packets actually consist of.


If your really serious about this, I suggest doing these:
1.) Get a packet logger (Hint: www.ethereal.com).

2.) Read the basic packet information
(Hint: http://botdev.valhallalegends.com/documents/bnetpacketedu.html)

3.) Take a look at Grok's DebugOutput function @ http://botdev.valhallalegends.com/documents/vbdebugoutput.html

4.) Read up on packet 0x0f information @ http://botdev.valhallalegends.com/documents/0x0feducation.html

5.) Read/understand/learn how to use DarkMinion's packetbuffer class (used to build each of those packets listed above). http://botdev.valhallalegends.com/documents/vbpacketbc.html

That should be enough to get you started, hope it helps...



[Edit 1] Fixed my [ url ] tags.
[Edit 2] Put spaces inbetween the url addys to make it easier on the eyes... ;D
March 28, 2004, 1:50 AM
Splinter
Thx People,

I'll let you's no how i get on.



:) :) :) :) :)
March 29, 2004, 3:49 PM

Search