Valhalla Legends Forums Archive | Battle.net Bot Development | Generate List of Cd Keys

AuthorMessageTime
UnderCover
I used PHP to generate cd keys for bots on my website and I was wondering if anoyne knew how to add the "-" to the cd key so i don;t have to do it manually? Anyone know how?
August 24, 2003, 12:46 PM
Soul Taker
CD-keys don't actually have the "-" in them, and how do you generate keys for bots? Must be on a server like BnetD I guess?
August 24, 2003, 2:28 PM
UnderCover
Well I use a random number to generate starcraft cd keys. Im trying to figure out how to make it test my cd keys online. Like test them through maybe sockets? Does anyone know if that would work?
August 24, 2003, 2:34 PM
tA-Kane
I don't know PHP, but here would be valid VB code. I hope you're good at porting VB to PHP.

I don't have my CD keys in front of me, so I'll write this function according to my memory; hopefully it's correct.
[code]Function CreateDisplayKey(KeyStr As String) As String
Dim Length As Integer
Dim Buffer As String

Length = Len(KeyStr)
Select Case Length
Case 13 //JSTR & STAR CD key: 0123-4567-8901
Buffer = Mid(KeyStr, 1, 4) & "-" & Mid(KeyStr, 5, 5) & "-" & Mid(KeyStr, 10, 4)
Case 16 //W2BN & D2DV & D2XP: 0123-ABCD-4567-EFGH
Buffer = Mid(KeyStr, 1, 4) & "-" & Mid(KeyStr, 5, 4) & "-" & Mid(KeyStr, 9, 4) & "-" & Mid(KeyStr, 13, 4)
Case 26 //WAR3 (& W3XP?): ABCDEF-0123-GHIJKL-4567-MNOPQR
Buffer = Mid(KeyStr, 1, 6) & "-" & Mid(KeyStr, 7, 4) & "-" & Mid(KeyStr, 11, 6) & "-" & Mid(KeyStr, 17, 4) & "-" & Mid(KeyStr, 21, 6)
Else
Buffer = "Unsupported CD key length."
End Select
End Function[/code]
August 24, 2003, 3:40 PM
hismajesty
[quote author=UnderCover link=board=17;threadid=2439;start=0#msg19021 date=1061735690]
Well I use a random number to generate starcraft cd keys. Im trying to figure out how to make it test my cd keys online. Like test them through maybe sockets? Does anyone know if that would work?
[/quote]

use a key tester?
August 24, 2003, 3:52 PM
Stealth
[quote author=tA-Kane@Texas link=board=17;threadid=2439;start=0#msg19024 date=1061739627]
[code]Function CreateDisplayKey(KeyStr As String) As String
Dim Length As Integer
Dim Buffer As String

Length = Len(KeyStr)
Select Case Length
Case 13 //JSTR & STAR CD key: 0123-4567-8901
Buffer = Mid(KeyStr, 1, 4) & "-" & Mid(KeyStr, 5, 5) & "-" & Mid(KeyStr, 10, 4)
Case 16 //W2BN & D2DV & D2XP: 0123-ABCD-4567-EFGH
Buffer = Mid(KeyStr, 1, 4) & "-" & Mid(KeyStr, 5, 4) & "-" & Mid(KeyStr, 9, 4) & "-" & Mid(KeyStr, 13, 4)
Case 26 //WAR3 (& W3XP?): ABCDEF-0123-GHIJKL-4567-MNOPQR
Buffer = Mid(KeyStr, 1, 6) & "-" & Mid(KeyStr, 7, 4) & "-" & Mid(KeyStr, 11, 6) & "-" & Mid(KeyStr, 17, 4) & "-" & Mid(KeyStr, 21, 6)
Else
Buffer = "Unsupported CD key length."
End Select
CreateDisplayKey = Buffer
End Function[/code]
[/quote]

Forgot to return the buffer. :)
August 24, 2003, 6:31 PM
Maddox
Instead of mid() you would use substr(), just remember it is 0 based.
August 24, 2003, 7:45 PM
UnderCover
can anyone convert this to php lol im not that good with vb :)
August 24, 2003, 9:32 PM
Camel
[quote author=UnderCover link=board=17;threadid=2439;start=0#msg19060 date=1061760773]
can anyone convert this to php lol im not that good with vb :)
[/quote]
How about you at least make an effort?
August 24, 2003, 9:50 PM
St0rm.iD
Why don't you give up...it won't be feasible.
August 24, 2003, 10:13 PM
UnderCover
im going ot start working on trying to convert this to make a good generator...
August 24, 2003, 11:18 PM
UnderCover
What do you think of this code? I think it may need some more randomizing....

[code]
<?
$refresh_rate = "20";

header( 'refresh: 20; url=http://www.saclans.com/d2kitems/cdkey/starcraftcdkeygen2.php' );

$tot = "0";

while ($tot < "100") {
$rand1 = rand(1000,5000);

$rand2 = rand(10000, 90000);

$rand3 = rand(1000, 9000);

$rand .= "<li>
$rand1-$rand2-$rand3</li>";

$add = $tot + 1;
$tot = $add;


}

?>
[/code]
August 24, 2003, 11:28 PM
K
I think that there is an effective chance of 0% for you to generate a working battle.net key with that code.
August 25, 2003, 12:38 AM
UnderCover
wut code would you recommend :)
August 25, 2003, 1:23 AM
K
If you look at the CD Key decoding functions that are floating around or even a cd key generator for offline play, you'll at least have some idea of how the keys are chosen -- you won't just be shooting in the dark. I still think it's not a very practical endevour, though -- even with a partially correct encoding function the chance to generate a working battle.net key (that isn't in use!) is very small.
August 25, 2003, 1:30 AM

Search