Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Newtfeet on August 16, 2003, 10:25 AM

Title: Getting Started
Post by: Newtfeet on August 16, 2003, 10:25 AM
Are there any tutorials about connecting to Battle.net? I would like to make an application that can chat on Battle.net as well as create a bot, but I have found nothing that tells me where to connect to and what to do afterwards. I am a somewhat competent programmer, but this would be my first Internet application.

-Newtfeet
Title: Re:Getting Started
Post by: Tubby on August 16, 2003, 10:52 AM
Clean Slate Bot and Cuphead included a tutorial. Your also gonna need a BNLS account and password.
Title: Re:Getting Started
Post by: Newtfeet on August 16, 2003, 06:53 PM
Quote from: Tubby on August 16, 2003, 10:52 AM
Clean Slate Bot and Cuphead included a tutorial. Your also gonna need a BNLS account and password.
Where can I get these? Isn't there any tutorial that is available separately from bot downloads? Also, isn't it possible to connect to Battle.net without BNLS?
Title: Re:Getting Started
Post by: hismajesty on August 16, 2003, 06:55 PM
www.valhallalegends.com/cuphead

And yes through local hashing
Title: Re:Getting Started
Post by: Hazard on August 16, 2003, 07:09 PM
http://forum.valhallalegends.com/phpbbs/index.php?board=11;action=display;threadid=425

http://forum.valhallalegends.com/phpbbs/index.php?board=25;action=display;threadid=1976

Read those before you go any further.

!~!HaZaRD!~!
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 10:36 AM
Thanks guys. However, I am trying to write a bot from scratch (without BNLS), and I won't be using VB.  Does CupHead come with tutorials on the Battle.net protocol?

-Newtfeet
Title: Re:Getting Started
Post by: Soul Taker on August 18, 2003, 11:34 AM
CupHead is a person =P
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 01:31 PM
Quote from: Soul Taker on August 18, 2003, 11:34 AM
CupHead is a person =P
Yeah, I noticed that right after I posted. Sorry, CupHead. ;)
Title: Protocol documentation
Post by: Kp on August 18, 2003, 01:42 PM
For protocol documentation, I'd suggest BnetDocs (https://www.valhallalegends.com/arta/bnetdocs/).
Title: Re:Protocol documentation
Post by: Newtfeet on August 18, 2003, 01:46 PM
Quote from: Kp on August 18, 2003, 01:42 PM
For protocol documentation, I'd suggest BnetDocs (https://www.valhallalegends.com/arta/bnetdocs/).
Thanks, but I was aware of that. I am looking for tutorials, not documentation. I mostly just need to know how to start (where to connect to, what to send to log in, etc.).
Title: Re:Getting Started
Post by: RhiNo on August 18, 2003, 02:22 PM
Quote from: Newtfeet on August 18, 2003, 10:36 AM
Thanks guys. However, I am trying to write a bot from scratch (without BNLS), and I won't be using VB.  Does CupHead come with tutorials on the Battle.net protocol?

-Newtfeet

what lang will you be using??..
Title: ah, in that case:
Post by: Kp on August 18, 2003, 02:59 PM
Quote from: Newtfeet on August 18, 2003, 01:46 PMThanks, but I was aware of that. I am looking for tutorials, not documentation. I mostly just need to know how to start (where to connect to, what to send to log in, etc.).
Connect to any valid BNCS, send control-a ("\1" in C/C++) to specify binary logon, then send your product's initial handshake, which is SID_AUTH_INFO unless you're doing something old like War2 or Diablo.  The server will respond with SID_AUTH_INFO, to which you send SID_AUTH_CHECK.  It answers back with a SID_AUTH_CHECK specifying whether it will accept you or not (reasons for failuire include bad game version, bad CD key, CD key in use).  Once you have those working, post back and I'll dig up my notes on the rest of the sequence (or you could monitor the game's traffic on your own).
Title: Re:Getting Started
Post by: Hazard on August 18, 2003, 03:37 PM
Let me get this straight. You are trying to build a hashed Battle.Net bot in C++ with no prior experience of any kind?

!~!HaZaRD!~!
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 03:41 PM
Quote from: RhiNo on August 18, 2003, 02:22 PMwhat lang will you be using??..
REALbasic.
http://www.realsoftware.com/realbasic/ (http://www.realsoftware.com/realbasic/)

Quote from: Kp on August 18, 2003, 02:59 PMConnect to any valid BNCS, send control-a ("\1" in C/C++) to specify binary logon, then send your product's initial handshake, which is SID_AUTH_INFO unless you're doing something old like War2 or Diablo.  The server will respond with SID_AUTH_INFO, to which you send SID_AUTH_CHECK.  It answers back with a SID_AUTH_CHECK specifying whether it will accept you or not (reasons for failuire include bad game version, bad CD key, CD key in use).  Once you have those working, post back and I'll dig up my notes on the rest of the sequence (or you could monitor the game's traffic on your own).
I wish there were awards for "Most Helpful Post in This Thread So Far". :) Just one question: what is a BNCS? I assume that is a Battle.net server? I thought I saw that you connect to uswest.battle.net, useast.battle.net, asia.battle.net, europe.battle.net? Thanks!

EDIT:
Quote from: HaZarD on August 18, 2003, 03:37 PM
Let me get this straight. You are trying to build a hashed Battle.Net bot in C++ with no prior experience of any kind?
Define 'experience'. I am not using C++, I have programmed before and, IMHO, am good at it, but this is my first Internet (i.e. using sockets) application and this is my first time using hashes.
Title: Re:Getting Started
Post by: Hazard on August 18, 2003, 03:47 PM
You obviously aren't versed on Battle.Net protocols. You want tutorials instead of documentation. You don't want to use the simpler langauge of vB to grasp an understanding before taking on C++. You don't want to use BNLS which, in the opinion of some, is easier to understand than hashing.  You don't want to use CSB or its tutorials to gain a better understanding of protocols and basic programming. Do you even understand how to program in C++ at all? I'm not talking about random number generators to simulate a dice roll either. You might want to start at the beginning rather than trying to skip ahead a few chapters.

!~!HaZaRD!~!
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 04:00 PM
Quote from: HaZarD on August 18, 2003, 03:47 PM
You obviously aren't versed on Battle.Net protocols. You want tutorials instead of documentation. You don't want to use the simpler langauge of vB to grasp an understanding before taking on C++. You don't want to use BNLS which, in the opinion of some, is easier to understand than hashing.  You don't want to use CSB or its tutorials to gain a better understanding of protocols and basic programming. Do you even understand how to program in C++ at all? I'm not talking about random number generators to simulate a dice roll either. You might want to start at the beginning rather than trying to skip ahead a few chapters.
I am not using C++. I am using REALbasic (see my above post).  I want tutorials as no documentation seems to tell me how to connect to Battle.net. I may use BNLS until I get a hash algorithm working., as you seem to be so vehemently opposed to me making a calculation. I suppose I should have told you that I'm doing this on a Mac, so I doubt CSB will help me.
Title: Re:Getting Started
Post by: SNiFFeR on August 18, 2003, 04:03 PM
I think you can find stuff here: http://www.gamegosu.net/ (Kain's web site)
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 04:09 PM
Quote from: SNiFFeR on August 18, 2003, 04:03 PM
I think you can find stuff here: http://www.gamegosu.net/ (Kain's web site)
Thanks. I saw that before, but forgot to bookmark it. Also, I just noticed something. On the BnetDocs, the BNLS Checksum Algorithm information that I assumed was how to compute the hash to get on Battle.net I now realize that it says BNLS, not BNCS. Is this required to connect to BNLS, or Battle.net?
Title: Re:Getting Started
Post by: Hazard on August 18, 2003, 04:21 PM
Using the BNetDocs along with some creativity and common sense should be enough to help you with understanding BNet protocols.

!~!HaZaRD!~!
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 04:28 PM
Quote from: HaZarD on August 18, 2003, 04:21 PM
Using the BNetDocs along with some creativity and common sense should be enough to help you with understanding BNet protocols.
Ok, thanks for the tips! About the checksum algorithm in the BnetDocs (see above post), do you have any answers?
Title: Re:Getting Started
Post by: Arta on August 18, 2003, 04:44 PM
The BNLS checksum algorithm is for connecting to BNLS, yes. There are 2 hashing algorithms involved in connecting to BNCS.

The first is CheckRevision. This is used to verify that you have a correct version of whatever game you're emulating. CheckRevision performs a check of your main game files (or 'hash files') which vary from game to game. For Starcraft, they're starcraft.exe, storm.dll, and battle.snp.

The second is a modified version of the SHA-1 hashing algorithm. This is used to protect sensitive information - namely, your CD Key and Password - in transit. It means that anyone who intercepted your packets while they were being sent to Battle.net would not be able to read your CD Key or Password. It also means that Battle.net does not 'know' your password - it is never stored in plain text.

Source code for both of these functions is fairly widely distributed. There are also a variety of DLLs (not that they'll be any use to you) that export them. BNLS also supports them both. The advantage of BNLS is that you don't need to have any hash files locally - BNLS takes care of it for you. If you do it locally you'll need the hash files for the product you're emulating. Using BNLS also means you have to establish 2 connections instead of one. This may or may not be a problem.
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 04:55 PM
Quote from: Arta[vL] on August 18, 2003, 04:44 PM
The BNLS checksum algorithm is for connecting to BNLS, yes. There are 2 hashing algorithms involved in connecting to BNCS.

The first is CheckRevision. This is used to verify that you have a correct version of whatever game you're emulating. CheckRevision performs a check of your main game files (or 'hash files') which vary from game to game. For Starcraft, they're starcraft.exe, storm.dll, and battle.snp.

The second is a modified version of the SHA-1 hashing algorithm. This is used to protect sensitive information - namely, your CD Key and Password - in transit. It means that anyone who intercepted your packets while they were being sent to Battle.net would not be able to read your CD Key or Password. It also means that Battle.net does not 'know' your password - it is never stored in plain text.

Source code for both of these functions is fairly widely distributed. There are also a variety of DLLs (not that they'll be any use to you) that export them. BNLS also supports them both. The advantage of BNLS is that you don't need to have any hash files locally - BNLS takes care of it for you. If you do it locally you'll need the hash files for the product you're emulating. Using BNLS also means you have to establish 2 connections instead of one. This may or may not be a problem.
I see, thanks! I didn't know that BNLS was so useful. I guess I'll be using it.

BTW, Arta, my BnetDocs password seems to have become useless. I've registered as Newtfeet, could you check it out? My 'session has expired or become invalid.'
Title: Re:Getting Started
Post by: Arta on August 18, 2003, 05:32 PM
That happens if you're idle for too long. Just log in again.
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 05:34 PM
Quote from: Arta[vL] on August 18, 2003, 05:32 PM
That happens if you're idle for too long. Just log in again.
Ah, but it seems that in this case, 'too long' is 1 second. No matter how many times I log in, it still says the same thing.
Title: Re:Getting Started
Post by: Arta on August 18, 2003, 05:38 PM
Enable cookies.
Title: Re:Getting Started
Post by: Camel on August 18, 2003, 05:57 PM
Tip to Arta: when a user logs in check if they have cookies enabled (by trying to store one) and warn them if they don't.
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 06:04 PM
Quote from: Arta[vL] on August 18, 2003, 05:38 PM
Enable cookies.
:) Thanks. I did have them on, but only for sites I navigate to. For some reason, BnetDocs didn't count as being 'navigated' to.
Title: Re:Getting Started
Post by: Maddox on August 18, 2003, 06:32 PM
Quote from: HaZarD on August 18, 2003, 03:47 PM
You obviously aren't versed on Battle.Net protocols. You want tutorials instead of documentation. You don't want to use the simpler langauge of vB to grasp an understanding before taking on C++. You don't want to use BNLS which, in the opinion of some, is easier to understand than hashing.  You don't want to use CSB or its tutorials to gain a better understanding of protocols and basic programming. Do you even understand how to program in C++ at all? I'm not talking about random number generators to simulate a dice roll either. You might want to start at the beginning rather than trying to skip ahead a few chapters.

!~!HaZaRD!~!

Nowhere does it say he is using C++, he just stated he is using REALBasic. Also, CSB does not help any understanding of battle.net protocol.
Title: Re:Getting Started
Post by: Newtfeet on August 18, 2003, 06:35 PM
Quote from: Maddox on August 18, 2003, 06:32 PMNowhere does it say he is using C++, he just stated he is using REALBasic. Also, CSB does not help any understanding of battle.net protocol.
Thanks, you said what I was itching to say, at the expense of being rude. It's not as rude if someone else says it. (No offense meant to either party, of course. ;))