• Welcome to Valhalla Legends Archive.
 

Battlenet Connection

Started by MindArchon, August 26, 2004, 02:43 AM

Previous topic - Next topic

MindArchon

Im moving away from CSB type things now..

I know how to send packets (i have a packet buffer) and I know how to parse packets. I know the sequence to send to battle.net.. so what do I do?

Do I connect to BNLS first, send those packets, then reconnect to BNET? I'm utterly confused on what I am supposed to connect to / how it works. Ive searched the forums - no luck. Can anyone help me out here?

BaDDBLooD

you can connect to either BNLS or BNet first.  If you want BNLS to give you the verbyte .. connect to BNLS first, if you know the verbyte.. bnet is the way to go.

After you recieve 0x50, you send 0x09 to BNLS, Than depending on how many keys you have you send 0x01 or 0x0C to BNLS, than send 0x51.
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Gangz

Quote from: MindArchon on August 26, 2004, 02:43 AM
Im moving away from CSB type things now..

I know how to send packets (i have a packet buffer) and I know how to parse packets. I know the sequence to send to battle.net.. so what do I do?

Do I connect to BNLS first, send those packets, then reconnect to BNET? I'm utterly confused on what I am supposed to connect to / how it works. Ive searched the forums - no luck. Can anyone help me out here?

If you know the sequence then you shouldn't need BNLS. the packet buffer you have is from another bot? if so then it probably has a sendpacket function

MyndFyre

Quote from: Gangz on August 26, 2004, 05:01 AM
If you know the sequence then you shouldn't need BNLS.

How do you figure?  I know the sequence for connecting, but I still use BNLS.
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.

Skeptical

There are other reasons for using BNLS other than the verByte, Hashes can be a pain for non-broadband users if they dont have the client. BNLS was created for a hashless connection, making your zip file for your bot alot smaller not needing hashes :D

ChR0NiC

Quote from: Gangz on August 26, 2004, 05:01 AM
If you know the sequence then you shouldn't need BNLS. the packet buffer you have is from another bot? if so then it probably has a sendpacket function

Let's all remember that, without Yobguls, all VB programmers would most likely be using BNLS unless Userloser or Maddox decided to make a Visual Basic Equivelant of SHA-1 in a DLL. But BNLS uses a much more efficient check revision according to Skywing, and I notice getting lower pings when using BNLS.

MindArchon

#6
Ugh. I cant log into bnet docs. I think its my crappy internet connection. Ok maybe I thought I knew the sequence. After looking at BNLSProtocolSpec I thought that the packets were listed in the correct order to connect. I think i was wrong :-\

I want to use BNLS, as I know nothing about hashes

So, I connect to bnls.valhallalegends.com on port 9367.

BNLS sends me 0x50 which contains the version byte

I then send 0x09 which is a version check. After recieving it I send 0x01 with my cdkey. After recieiving that I send 0x51 with the data recieved from 0x01 and 0x09.

After that I am not sure, but I beleive I send my account info to 0x02, after recieving that I send 0x53, If its successful I send 0x03, then send 0x54, if thats successful I then send 0x0a which enters chat (I think this is on bnet docs but I cant check it since my internet sucks).

Can anyone tell me if I'm correct?

Also. Where do I put the server? Like useast.battle.net, or do I have to connect to that or something

BaDDBLooD

You connect to bnls
send your BNLS product id ( 0x10 )
recieve verbyte ( 0x10 )
connect to bnet
send 0x50
send 0x09
send 0x01 or 0x0C depending on how many keys
Send 0x51
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

MindArchon

Quote from: BaDDBLooD on August 26, 2004, 03:39 PM
You connect to bnls
send your BNLS product id ( 0x10 )
recieve verbyte ( 0x10 )
connect to bnet
send 0x50
send 0x09
send 0x01 or 0x0C depending on how many keys
Send 0x51

Ahh. I see, so after sending 0x10 I would get the version byte.

I then disconnect from BNLS, and reconnect to BNET like on useast.battle.net. What port is BNET on?

So then I send 0x50, and I need the versionbyte from BNLS.  After I send 0x09 which is the versioncheck. Then I send 0x01 which encrypts the cdkey. Then I send 0x51 which sends the cdkey data to BNET. Then I beleive I send all the account data like I said in the above post correct?

BaDDBLooD

#9
you stay connected to bnls, you never Disconnect after connecting.
port 6112
everything else is right
it can be 0x01 *OR* 0x0C depending on how many cdkey's you have ( 1 or 2 )
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

MindArchon

Quote from: BaDDBLooD on August 26, 2004, 04:00 PM
you stay connected to bnls, you never Disconnect after connecting.
port 6112
everything else is right
it can be 0x01 *OR* 0x0C depending on how many cdkey's you have ( 1 or 2 )

So then I have to open 2 connections? Time to learn VB Winsock :)

MindArchon

Is there a reason why you have to have BNLS open while connecting to BNET?

Kp

Quote from: MindArchon on August 26, 2004, 04:25 PMIs there a reason why you have to have BNLS open while connecting to BNET?

Yes.  Battle.net will send you a versioning challenge, to which you must respond.  You can't reliably predict in advance what the challenge will be, so you must get the challenge, pass it to BNLS, then pass the answer to BNCS.  You could connect to BNLS before/during/after you connect to BNCS, but you can't avoid being connected to both of them if you want to have a decent chance at not failing vercheck due to stale info. :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

MindArchon

#13
In what packet does BNET send you the challenge?

And with Visual Basic, is it better to put two winsock controls on the form, or just one and connect with the index or whatever (its in bnet reference)

BaDDBLooD

i prefer 2 seperate winsock's
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.