Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Luxer on June 29, 2004, 05:51 PM

Title: CDKey connection.
Post by: Luxer on June 29, 2004, 05:51 PM
I am lost. After succsessfully creating a chat bot that uses the caht gateway (acsii 3)
I start wondering how to connect with a CDKey. I looked into BNLS. No thanks. I don't want to deal with bg3. What kind of encription does a cdkey use when connecting to battle.net?  :-\   :-[
Title: Re:CDKey connection.
Post by: BaDDBLooD on June 29, 2004, 06:50 PM
I am not really sure on what your asking, because i am not very Familiar with Local hashing myself.  There is a Public CDKey Decode/Encrypt for starcraft/broodwar Warcraft II/Diablo2. Unfortunately Warcraft III is still quite in it's Infancy.  I am sure you can either Find them by Searching google, or just searching these forums.
Title: Re:CDKey connection.
Post by: Zakath on June 29, 2004, 09:49 PM
The hashing algorithm used for all pre-War3 encryption operations is a pseudo-SHA1 method that is particular to Blizzard's software. You can find a freely available implementation written by Yobguls floating around in various places, although from what I understand it isn't especially optimized.
Title: Re:CDKey connection.
Post by: GoSuGaMING on June 29, 2004, 09:51 PM
Quote from: Zakath on June 29, 2004, 09:49 PM
The hashing algorithm used for all pre-War3 encryption operations is a pseudo-SHA1 method that is particular to Blizzard's software. You can find a freely available implementation written by Yobguls floating around in various places, although from what I understand it isn't especially optimized.

pseudo-SHA1 ?

its standard SHA-1 :X
Title: Re:CDKey connection.
Post by: MyndFyre on June 29, 2004, 09:56 PM
Quote from: GoSuGaMING on June 29, 2004, 09:51 PM
Quote from: Zakath on June 29, 2004, 09:49 PM
The hashing algorithm used for all pre-War3 encryption operations is a pseudo-SHA1 method that is particular to Blizzard's software. You can find a freely available implementation written by Yobguls floating around in various places, although from what I understand it isn't especially optimized.

pseudo-SHA1 ?

its standard SHA-1 :X

No, I believe it's called Broken SHA-1, because it uses SHA-1, then prepends the server key and appends the client key, then calculates the SHA-1 again.  That is not exactly standard SHA-1, but rather a variant of it, hence "pseudo."
Title: Re:CDKey connection.
Post by: Zakath on June 29, 2004, 09:58 PM
The accepted term for the SHA1 hash used by Blizzard's games has been "pseudo-SHA1" for much longer than you've been active in the bot-making community, Gosu. I suggest you do your research before criticizing me like that.
Title: Re:CDKey connection.
Post by: Luxer on June 29, 2004, 09:58 PM
nevermind. I wonuld not understand anyway. Thanks!
Title: Re:CDKey connection.
Post by: GoSuGaMING on June 29, 2004, 10:19 PM
Quote from: Zakath on June 29, 2004, 09:58 PM
The accepted term for the SHA1 hash used by Blizzard's games has been "pseudo-SHA1" for much longer than you've been active in the bot-making community, Gosu. I suggest you do your research before criticizing me like that.

i'm sorry im a ass! *YAY*
Title: Re:CDKey connection.
Post by: dxoigmn on June 30, 2004, 02:01 AM
Quote from: Myndfyre on June 29, 2004, 09:56 PM
No, I believe it's called Broken SHA-1, because it uses SHA-1, then prepends the server key and appends the client key, then calculates the SHA-1 again.  That is not exactly standard SHA-1, but rather a variant of it, hence "pseudo."

That's not the reason it is called "Broken SHA-1."  SHA-1 is a secure hash algorithm (SHA), not a method of hashing using a salt as you described.  The reason it is called "Broken SHA-1" is Blizzard's implementation of SHA doesn't adhere to the NIST standard (http://www.itl.nist.gov/fipspubs/fip180-1.htm), it's broken.  This has been discussed (http://forum.valhallalegends.com/phpbbs/index.php?board=45;action=display;threadid=3088) before as referenced in the Bot Dev Reference Forum.
Title: Re:CDKey connection.
Post by: hismajesty on June 30, 2004, 07:10 PM
Quote from: BaDDBLooD on June 29, 2004, 06:50 PM
I am not really sure on what your asking, because i am not very Familiar with Local hashing myself.  There is a Public CDKey Decode/Encrypt for starcraft/broodwar Warcraft II/Diablo2. Unfortunately Warcraft III is still quite in it's Infancy.  I am sure you can either Find them by Searching google, or just searching these forums.

Assuming he's programming in vb, the bnetauth.dll source is available and it's not too hard to convert the cd-key functions to vb.
Title: Re:CDKey connection.
Post by: Meh on July 01, 2004, 11:16 AM
http://www.dark-wire.net/exile/members/tutorials.php?view=15 This might be of help.
Title: Re:CDKey connection.
Post by: Eric on July 01, 2004, 04:42 PM
Quote from: The-Rabid-Lord on July 01, 2004, 11:16 AM
http://www.dark-wire.net/exile/members/tutorials.php?view=15 This might be of help.
A tutorial without explanations of what's going on isn't a helpful tutorial, not to mention that is one of the most horrid connection classes I've ever seen.
Title: Re:CDKey connection.
Post by: Warrior on July 01, 2004, 04:55 PM
I agree any tutorial that just spits out code is no good.
Title: Re:CDKey connection.
Post by: hismajesty on July 01, 2004, 05:09 PM
Quote from: LoRd[nK] on July 01, 2004, 04:42 PM
Quote from: The-Rabid-Lord on July 01, 2004, 11:16 AM
http://www.dark-wire.net/exile/members/tutorials.php?view=15 This might be of help.
A tutorial without explanations of what's going on isn't a helpful tutorial, not to mention that is one of the most horrid connection classes I've ever seen.

Most of it is public code, which may be why?
Title: Re:CDKey connection.
Post by: ChR0NiC on July 07, 2004, 01:45 AM
Keep in mind that not only do you need to "encrypt" the cd key, but you must do the same with the password as well. So you're way better off learning the language and then trying to figure out how to use this Standard Hash Algorithm method used.
Title: Re:CDKey connection.
Post by: Luxer on July 11, 2004, 08:14 AM
OK, how am I supposed to use SHA-1 in RealBASIC? Does anyone have an object?
Title: Re:CDKey connection.
Post by: tA-Kane on July 12, 2004, 07:38 PM
SHA-1 specially ported to Mac endian:

http://www.cubedivision.org/phpBB2/viewtopic.php?t=72

Note that BNCSHashData() is the SHA-1 algorithm you're looking for.

Give me a while and I'll be able to dig up a REALbasic port as well...

Edit 2: Correction, that link does NOT have my CDKeyDecode() in C ... oh well

Edit: Blah... my HashData() in REALbasic doesn't work correctly... and I'm too lazy to correctly port it.

If you can compile that code into a library, you can link the library into REALbasic.

Alternately, if you know how to create a REALbasic plugin, you could do that. But note that you'll need to have some middle-man function(s) to convert the data to and from REALbasic's crazy objects and types to the normal types. If you're interested, I can give you my plugin's middle-men functions...