• Welcome to Valhalla Legends Archive.
 

sc encoding keys

Started by Zer0, September 13, 2006, 03:14 PM

Previous topic - Next topic

Zer0

I have managed to get the keys decoded and all but i cant seem to get them re-encoded if someone would be willing to help me with this that would be great. I am also rather new to VB and still learning so, thx.

Zer0

rabbit

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.

Zer0

iv been trying but keep comming up with really weird output as soon as i get back from class ill post the code and see if i cant get it that way

edit: rabbit if ur the same person im thinkn of ur friends wit JTN (or jeff) arnt u?

l2k-Shadow



' Ported from C to VB by l2k-Shadow

Public Sub EncodeSCKey(ByRef CDKey As String, ByVal PublicValue As Long, ByVal PrivateValue As Long, Optional ByVal ProductValue As Long)
Dim tKey(11) As String, tStr As String, tlng As Long, hashKey As Long, pos As Integer, i As Integer
Dim tProduct As String, tPublic As String, tPrivate As String
    'Assemble values into a string
    If Product = 0 Then Product = 1
    If Len(Product) < 2 Then
        tProduct = CStr("0" & Product)
    Else
        tProduct = CStr(Product)
    End If
    tPublic = CStr(PublicValue)
    While Len(tPublic) < 7
        tPublic = "0" & tPublic
    Wend
    tPrivate = CStr(PrivateValue)
    While Len(tPrivate) < 3
        tPrivate = "0" & tPrivate
    Wend
    CDKey = tProduct & tPublic & tPrivate
    'Fill Array
    For i = 0 To 11
        tKey(i) = Mid$(CDKey, i + 1, 1)
    Next i
    'Final Vaues
    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
    'Unshuffling
    For i = 7 To &HC2 Step &H11
        tlng = i Mod &HC
        tStr = tKey(tlng)
        tKey(tlng) = tKey(pos)
        tKey(pos) = tStr
        pos = pos + 1
    Next i
    'Calculate check digit
    tlng = 3
    For i = 0 To 11
        tlng = tlng + (tKey(i) Xor (tlng * 2))
    Next i
    CDKey = Join(tKey, vbNullString) & CStr(tlng Mod 10)
End Sub

have fun
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.

Hero


l2k-Shadow

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.

Zer0

yes i was looking for SC also thank you shadow

Hero

Quote from: Zer0 on September 19, 2006, 11:12 PM
yes i was looking for SC also thank you shadow
I had a hunch  ;D