• Welcome to Valhalla Legends Archive.
 

[Resolved][vb6][bncsutil] Warcraft 2 Invalid Cdkey 0x36

Started by NetNX, March 09, 2005, 07:23 PM

Previous topic - Next topic

NetNX

Heyeveryone... im getting an invalid cdkey message i wrote this packet from scratch so i dont know if i did it right.... ugh gogo? what am i doing wrong :-/

Heres what i got for 0x36


Dim D&
Dim KeyHash As String
Dim HashSize As Long
Dim ValueProduct As Long
Dim Value1 As Long
    '//Tokens like at chucky cheeze
    If ClientToken = 0 Then
        ClientToken = GetTickCount()
        If ClientToken = 0 Then
            Sleep 1
            ClientToken = GetTickCount()
        End If
    End If
    If ServerToken = 0 Then
        Disconnect
        Exit Sub
    End If
   
'Starting Hashing...
'Cdkey hashing...
D = kd_create(Cdkey, Len(Cdkey))
If (D < 0) Then
    Disconnect
    kd_free D
    Exit Sub
End If

' ClientToken should be set to a somewhat random value.
HashSize = kd_calculateHash(D, ClientToken, ServerToken)
If (HashSize <= 0) Then
    ' hashing failed, abort
    kd_free D
    Disconnect
    Exit Sub
End If

KeyHash = String$(HashSize, vbNullChar)
kd_getHash D, KeyHash
Value1 = kd_val1(D)
ValueProduct = kd_product(D)
kd_free D
'(DWORD)      Spawn (0/1)
'(DWORD)      Key Length
'(DWORD)      CDKey Product
'(DWORD)      CDKey Value1
'(DWORD)      Server Token
'(DWORD)      Client Token
'(DWORD[5])   Hashed Data
'(STRING)     Key owner
With P
    .InsertDWORD Spawned
    .InsertDWORD Len(Cdkey)
    .InsertDWORD ValueProduct
    .InsertDWORD Value1
    .InsertDWORD ServerToken
    .InsertDWORD ClientToken
    .InsertNonNTString KeyHash
    .InsertNTString Register
    .SendPacket &H36, sckBnet
End With


if you need me to show something else i can :-/

Soul Taker

#1

    If ClientToken = 0 Then
        ClientToken = GetTickCount()
        If ClientToken = 0 Then
            Sleep 1
            ClientToken = GetTickCount()
        End If
    End If

What the hell...  horrible coding.

You're sending a DWORD containing Len(CDKey).  I can't see your packetbuffer function to construct DWORDs, but it's probably sending "16" or whatever the len of war2 keys is instead of 0x10.

NetNX

Quote from: Soul Taker on March 09, 2005, 09:22 PM

If ClientToken = 0 Then
ClientToken = GetTickCount()
If ClientToken = 0 Then
Sleep 1
ClientToken = GetTickCount()
End If
End If

What the hell... horrible coding.

You're sending a DWORD containing Len(CDKey). I can't see your packetbuffer function to construct DWORDs, but it's probably sending "16" or whatever the len of war2 keys is instead of 0x10.

lol i know its bad coding ~_^ dont worry about it im taking it out its just to make sure that there was nothing wrong with the server/client tokens ~_^

NetNX

oh and it still dosent work i changed it to &h10 since 0x36 can only be used for wc2 :-/

UserLoser.

Quote from: NetNX on March 09, 2005, 09:38 PM
Quote from: Soul Taker on March 09, 2005, 09:22 PM

If ClientToken = 0 Then
ClientToken = GetTickCount()
If ClientToken = 0 Then
Sleep 1
ClientToken = GetTickCount()
End If
End If

What the hell... horrible coding.

You're sending a DWORD containing Len(CDKey). I can't see your packetbuffer function to construct DWORDs, but it's probably sending "16" or whatever the len of war2 keys is instead of 0x10.

lol i know its bad coding ~_^ dont worry about it im taking it out its just to make sure that there was nothing wrong with the server/client tokens ~_^

Assuming the server you're using isn't broken, the server token will never be 0.  Lowest possible value is 1

NetNX

yea i learned that shortly after i wrote that :-/... ok now WC2 cdkey gogo no work ?!