Valhalla Legends Archive

Programming => Battle.net Bot Development => Battle.net Bot Development References => Topic started by: Lenny on August 24, 2003, 01:20 AM

Title: CD-Key Generator Discussion
Post by: Lenny on August 24, 2003, 01:20 AM
Is it possible to calculate the probability a generated key will work on Battle.net?
Title: Re:Probability of a generated key...
Post by: hismajesty on August 24, 2003, 01:45 AM
Yes, since there is a probability for virtually everything in one form or another- Though I do not know the equation. Maybe one of the smarter members do?
Title: Re:Probability of a generated key...
Post by: Camel on August 24, 2003, 02:14 AM
The idea is to get Value1 to match Value2. Both are DWORDs, so the probability is 1 in 2^32, or ~4.29 billion. Effective, no? :)
Title: Re:Probability of a generated key...
Post by: iago on August 24, 2003, 08:08 AM
Assuming you generated it from the public algorithm, there is a probability somewhere on the internet, search for the generating algorithm and it should turn up.

[edit] iirc, it was very low, <1%
Title: Re:Probability of a generated key...
Post by: Adron on August 24, 2003, 08:41 AM
The best way of generating keys that I am aware of gives you a 0.1% probability of success.
Title: Re:Probability of a generated key...
Post by: iago on August 24, 2003, 09:19 AM
Quote from: Adron on August 24, 2003, 08:41 AM
The best way of generating keys that I am aware of gives you a 0.1% probability of success.

That sounds right..
Title: Re:Probability of a generated key...
Post by: Hazard on August 24, 2003, 10:29 AM
Quote from: iago on August 24, 2003, 09:19 AM
Quote from: Adron on August 24, 2003, 08:41 AM
The best way of generating keys that I am aware of gives you a 0.1% probability of success.

That sounds right..

I agree with those guys... probably about 0.1%. You'd have to spend a lot of time to do that... If you were bored you could use Yoni's Google Calculator (http://forum.valhallalegends.com/phpbbs/index.php?board=2;action=display;threadid=2424) to figure it out :P

!~!HaZaRD!~!
Title: Re:Probability of a generated key...
Post by: Adron on August 24, 2003, 12:19 PM
Well, assuming there's no pattern that you can find, I'd say the probability is exactly 0.1% ;)

Edit: My statements in this thread are valid for SC/BW keys, because those are the ones I've generated.
Title: Re:Probability of a generated key...
Post by: UnderCover on August 24, 2003, 04:39 PM
Would jsut using a code such as rand(1000000000000, 5000000000000)

work or do you have ot have it add and substract numbers and stuff along with that?   Whats the best method to do it (make a generator)
Title: Re:Probability of a generated key...
Post by: DarkMinion on August 24, 2003, 05:06 PM
With starcraft keys, you could generate keys starting at 1000000000000 and incrementing up, then testing to see if they're valid for install, then testing on battle.net.

Of course, between the IP bans for invalid keys and the time used to generate all the keys, it would probably take you around 6 months to generate one usable key, and then there is a high probability that it is already in use.

So, in other words, forget it, you won't be able to do it.
Title: Re:Probability of a generated key...
Post by: UserLoser on August 24, 2003, 05:19 PM
Because I was curious, I did something with the public DecodeCDKey function out there, hoping I could find a pattern somehow to actual working CDkeys on Battle.net [never tried to figure anything out].  I ran a "bruteforce" like program starting at 0000000000000 up to 3999999999999.  If the number passed the function, it'd output it to a file.  You can find my results at http://darknet.darktech.org/test/keys.txt - 39MB file, I did stop it after a while, it tended to make my computer run just a bit slow. ;)
Title: Re:Probability of a generated key...
Post by: Adron on August 24, 2003, 05:34 PM
It would probably do you more good to just study the code... It's not all that hard to look at it and understand how a cd key is made up, and how to convert cd keys between different representations.
Title: Re:Probability of a generated key...
Post by: UnderCover on August 24, 2003, 06:17 PM
so i tihnk if you did a code where youget a rand number then add 2 to a digit then substract form a digit etc etc  does anoyne else have any suggestions


Also how would i test the cd keys could i make a online cd key tester thorugh php :)  I love php
Title: Re:Probability of a generated key...
Post by: Camel on August 24, 2003, 06:35 PM
Well, considering testing a cd key doesn't require a persistant connection to battle.net, it may actually be feasable to connect with php. Perhaps you could write a PHP extention (dll) to assist with hashing/checkrevision?
Title: Re:Probability of a generated key...
Post by: UnderCover on August 24, 2003, 07:34 PM
perhaps  amybe there is a way a can connect through sockets...

how would i send and recieve data thorugh them does anyone else ebsides me know php?
Title: Re:Probability of a generated key...
Post by: Arta on August 25, 2003, 08:16 AM
UserLoser: Most of those keys will be invalid. They'd get past the installer, but not past Batle.net.

UnderCover: You're wasting your time. To my knowledge, no one knows the algorithm for generating valid CD keys except Blizzard, and since Battle.net IPBans you for supplying an invalid key, trying to test randomly generated ones would be a futile excersise. I'd find something better to do, if I were you.
Title: Re:Probability of a generated key...
Post by: Banana fanna fo fanna on August 25, 2003, 11:02 AM
If you're serious about a key generator, there are several "alternative" ways you can go about it.

Perhaps the easiest way would be to circumvent the firewall and access Blizzard's internal corporate network (not hard, as they use outlook). From there, located their SCCS and download the Battle.net source code.

You could also kidnap one of the Battle.net programmer's daughters and ransom her for the cd-key algorithm.

The most fun way (IMO), is to go Mission Impossible-style into their headquarters and download the noc list...err...the Battle.net code.

You could get a large sum of money and pay off an employee to get it.

You could look for unchecked SQL in the Battle.net daemon by sending crafted packets.

You could take over a Cisco immediately upstream from their servers by ping flooding it and cracking the password files, and then redirect traffic until they give you the algorithm.

Those, my friends, are the only plausible solutions, according to the mathematical probability of finding a CD-key that works on Battle.net and isn't in use.
Title: Re:Probability of a generated key...
Post by: UserLoser on August 26, 2003, 03:35 PM
Yes I know that Arta, I really just did that for fun and curiousity and see some the results of it.  I really don't need any more keys, I have plenty of working cdkeys :)
Title: Re:Probability of a generated key...
Post by: drivehappy on August 27, 2003, 02:22 PM
Is there an algorithm for testing DiabloII cdkeys (doesn't need to work on battle.net)? I've written a crappy app to run off of onlyer's cdkey changer to test them. It would test only about 30/s and took five minutes to find one key, that of course never worked on battle.net. I guess he used one of the MPQ functions to check it though, does anyone know how to go about this in VB?
Title: Re:Probability of a generated key...
Post by: Adron on August 27, 2003, 02:25 PM
I'm pretty sure a checkbyte will fall out when decoding a d2 cd key yes.
Title: Re:Probability of a generated key...
Post by: Skywing on August 27, 2003, 05:58 PM
Quote from: drivehappy on August 27, 2003, 02:22 PM
Is there an algorithm for testing DiabloII cdkeys (doesn't need to work on battle.net)? I've written a crappy app to run off of onlyer's cdkey changer to test them. It would test only about 30/s and took five minutes to find one key, that of course never worked on battle.net. I guess he used one of the MPQ functions to check it though, does anyone know how to go about this in VB?
His program probably passes iscript/vscript to install.exe that calls the EncryptKey and EncryptFile predefined functions.

My SCKeySet program (http://www.valhallalegends.com/skywing/files/SCKeySet/SCKeySet.zip) also uses these functions, though it dispenses with the iscript/vscript overhead.
Title: Re:Probability of a generated key...
Post by: UserLoser on August 27, 2003, 07:40 PM
0000000000003 works. :)
Title: Re:Probability of a generated key...
Post by: Camel on August 28, 2003, 02:28 AM
Quote from: UserLoser on August 27, 2003, 07:40 PM
0000000000003 works. :)

ProductID = 0
Value1 = 2353113
Value2 = 501


I don't think there are any valid products using a ProductID of zero...