Valhalla Legends Forums Archive | Battle.net Bot Development | [Resolved][vb6][bncsutil] Warcraft 2 Invalid Cdkey 0x36

AuthorMessageTime
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

[code]
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
[/code]

if you need me to show something else i can :-/
March 10, 2005, 1:23 AM
Soul Taker
[code]
    If ClientToken = 0 Then
        ClientToken = GetTickCount()
        If ClientToken = 0 Then
            Sleep 1
            ClientToken = GetTickCount()
        End If
    End If
[/code]
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.
March 10, 2005, 3:22 AM
NetNX
[quote author=Soul Taker link=topic=10874.msg103132#msg103132 date=1110424923]
[code]
If ClientToken = 0 Then
ClientToken = GetTickCount()
If ClientToken = 0 Then
Sleep 1
ClientToken = GetTickCount()
End If
End If
[/code]
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.
[/quote]

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 ~_^
March 10, 2005, 3:38 AM
NetNX
oh and it still dosent work i changed it to &h10 since 0x36 can only be used for wc2 :-/
March 10, 2005, 3:38 AM
UserLoser.
[quote author=NetNX link=topic=10874.msg103140#msg103140 date=1110425894]
[quote author=Soul Taker link=topic=10874.msg103132#msg103132 date=1110424923]
[code]
If ClientToken = 0 Then
ClientToken = GetTickCount()
If ClientToken = 0 Then
Sleep 1
ClientToken = GetTickCount()
End If
End If
[/code]
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.
[/quote]

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 ~_^
[/quote]

Assuming the server you're using isn't broken, the server token will never be 0.  Lowest possible value is 1
March 10, 2005, 4:00 AM
NetNX
yea i learned that shortly after i wrote that :-/... ok now WC2 cdkey gogo no work ?!
March 10, 2005, 4:06 AM

Search