• Welcome to Valhalla Legends Archive.
 

Starcraft Keys

Started by Guest, February 16, 2003, 01:29 PM

Previous topic - Next topic
|

~Mike~

Well, if the CD ends in 2 it puts 2 at end of private value, is it just a bad decode function?

Joe[x86]

Rabbit, your code automatically encodes keys with a product ID of 1, where the key in question has a product ID of 2. Might wanna fix that.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

rabbit

Meh.  I got that code from earlier in the thread.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

~Mike~

So how would i implement the encode function after decoding. I mean I read earlier that its the same, but the code must be different. like would u reverse the operations taken?

rabbit

Yep.

Any xor operation can be reversed by doing...the same operation.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

~Mike~

So lets say for sake of argument, the decode function is :

Public Sub DecodeSCKey(ByVal CDKey As String, ByRef Product As Long, ByRef PublicValue As Long, ByRef PrivateValue As Long)
Dim tKey(12) As String, tStr As String, tLng As Long, hashKey As Long, pos As Integer, i As Integer
    'Fill array
    For i = 0 To 12
        tKey(i) = Mid$(CDKey, i + 1, 1)
    Next i
    'Verify Key
    tLng = 3
    For i = 0 To 11
        tLng = tLng + (tKey(i) Xor (tLng * 2))
    Next i
    If tKey(12) = (tLng Mod 10) Then
        'Shuffling
        pos = &HB
        For i = &HC2 To 7 Step -&H11
            tStr = tKey(pos)
            tLng = i Mod &HC
            tKey(pos) = tKey(tLng)
            tKey(tLng) = tStr
            pos = pos - 1
        Next i
        'Final Values
        hashKey = &H13AC9741
        For i = 11 To 0 Step -1
            tStr = tKey(i)
            If Asc(tStr) <= 55 Then
                tKey(i) = (((hashKey And &HFF) And 7) Xor tStr)
                hashKey = hashKey \ 8
            ElseIf Asc(tStr) < 65 Then
                tKey(i) = ((i And 1) Xor tStr)
            End If
        Next i
        tStr = Join(tKey, vbNullString)
        Product = CLng("&H" & Left$(tStr, 2))
        PublicValue = CLng(Mid$(tStr, 3, 7))
        PrivateValue = CLng(Mid$(tStr, 10))
    End If
End Sub


I'm having trouble reversing that code.

effect

hmm they gonna love you around here
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

Joe[x86]

Quote from: effect on January 17, 2006, 01:48 AM
hmm they gonna love you around here

At least he's doing something with his life, more than trolling.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

l2k-Shadow

Quote from: ~Mike~ on January 16, 2006, 11:35 PM
So lets say for sake of argument, the decode function is :

Public Sub DecodeSCKey(ByVal CDKey As String, ByRef Product As Long, ByRef PublicValue As Long, ByRef PrivateValue As Long)
Dim tKey(12) As String, tStr As String, tLng As Long, hashKey As Long, pos As Integer, i As Integer
    'Fill array
    For i = 0 To 12
        tKey(i) = Mid$(CDKey, i + 1, 1)
    Next i
    'Verify Key
    tLng = 3
    For i = 0 To 11
        tLng = tLng + (tKey(i) Xor (tLng * 2))
    Next i
    If tKey(12) = (tLng Mod 10) Then
        'Shuffling
        pos = &HB
        For i = &HC2 To 7 Step -&H11
            tStr = tKey(pos)
            tLng = i Mod &HC
            tKey(pos) = tKey(tLng)
            tKey(tLng) = tStr
            pos = pos - 1
        Next i
        'Final Values
        hashKey = &H13AC9741
        For i = 11 To 0 Step -1
            tStr = tKey(i)
            If Asc(tStr) <= 55 Then
                tKey(i) = (((hashKey And &HFF) And 7) Xor tStr)
                hashKey = hashKey \ 8
            ElseIf Asc(tStr) < 65 Then
                tKey(i) = ((i And 1) Xor tStr)
            End If
        Next i
        tStr = Join(tKey, vbNullString)
        Product = CLng("&H" & Left$(tStr, 2))
        PublicValue = CLng(Mid$(tStr, 3, 7))
        PrivateValue = CLng(Mid$(tStr, 10))
    End If
End Sub


I'm having trouble reversing that code.

I have already ported the C++ code into VB6.. Here
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

shout

Quote from: ~Mike~ on January 16, 2006, 11:35 PM
I'm having trouble reversing that code.

You're not going to be reversing anything from that.

Joe[x86]

Quote from: Shout on January 17, 2006, 07:30 AM
Quote from: ~Mike~ on January 16, 2006, 11:35 PM
I'm having trouble reversing that code.

You're not going to be reversing anything from that.

He means literally reversing, not reverse engineering: he wants to encode.

PS: Get on AIM, shout.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

shout


rabbit

Quote from: ~Mike~ on January 16, 2006, 11:35 PM
I'm having trouble reversing that code.
Make it go backwards.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

MysT_DooM

                $                                    $
2410232920389           01   4319580   733
2661822870735           01   3302597   976
4504383083863           01   3255008   289
4801843752850           01   3306824   984
1463010740306           01   4363562   535
1114440170132           01   3310007   116
3004330937306           01   3271180   632
3937360771038           01   0442965   606
0010183599892           01   0838558   088
0012181999890           01   2878088   088

Ok look under the $ signs as you can see the middle digit in every private value is 11th digit in the cdkey.  Does anyone see any other similarites or something else related.


vb6, something about that combination of numbers and letters is sexy

dxoigmn

Quote from: MysT_DooM on January 18, 2006, 11:49 AM
                $                                    $
2410232920389           01   4319580   733
2661822870735           01   3302597   976
4504383083863           01   3255008   289
4801843752850           01   3306824   984
1463010740306           01   4363562   535
1114440170132           01   3310007   116
3004330937306           01   3271180   632
3937360771038           01   0442965   606
0010183599892           01   0838558   088
0012181999890           01   2878088   088

Ok look under the $ signs as you can see the middle digit in every private value is 11th digit in the cdkey.  Does anyone see any other similarites or something else related.

What is your point? What we're trying to establish is the relationship between the private, public and product values (i.e. there exists some function F such that F(public, product) = private). The encoded form of the cdkey does not matter what-so-ever.

|