• Welcome to Valhalla Legends Archive.
 

cdkey generation

Started by aton, October 19, 2005, 10:52 AM

Previous topic - Next topic

aton

not really a bot topic, but i think it fits here best.

does anyone have information about the algorithm thats used to create cdkeys for starcraft?
i'd like to write a complete generator+tester, so that you just supply a list of proxies and press generate, and after a few minutes you have a valid b.net cdkey. (does this already exist?)

Falcon[anti-yL]

Use search, its been covered on here at least 100 times.

iago

All information on keys can be found here:
http://www.javaop.com/javaop2/src/BNetLogin/src/cdkey/CDKeyDecode.java

The best way to BFI the problem is to use this algorithm I reversed [it's in Java, email me for a C one]:
    protected boolean verify()
    {
        int accum = 3;
       
        for(int i = 0; i < (cdkey.length() - 1); i++)
            accum += ((cdkey.charAt(i) - '0') ^ (accum * 2));

        return ((accum % 10) == (cdkey.charAt(12) - '0'));
    }

But instead of comparing the last digit to the accumulator, just set the last digit to that value and go. 

However! There are some ways to streamline it a little.  For instance. decode the key, check the product, and make sure it's right.  If it's not, trash the key and try again. 
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Kp

Quote from: iago on October 28, 2005, 07:16 PM[it's in Java, email me for a C one]

Allowing for use of STL-like string objects, the only part of that code that wouldn't be legal C++ is specifying the protection on the function directly.  Maybe you should've just left the protection keyword off so it could be both Java and C++ at once. :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

iago

Quote from: Kp on October 28, 2005, 08:29 PM
Quote from: iago on October 28, 2005, 07:16 PM[it's in Java, email me for a C one]

Allowing for use of STL-like string objects, the only part of that code that wouldn't be legal C++ is specifying the protection on the function directly.  Maybe you should've just left the protection keyword off so it could be both Java and C++ at once. :)

Haha, I hadn't thought of that!  Good call.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*