Valhalla Legends Forums Archive | Battle.net Bot Development | BNLS Warcraft III Login (almost done)

AuthorMessageTime
Freeware
Well I got myself to recieve the Warcraft III cdkey and seed value, but I am unsure how to send it in 0x51. I have included code below how I *think* you are supposed to do it, any help you give would be great.

[code]
Public Function SendPacket0x51(Cdkeyhash as String, Seed as string) As String

packetbuf.InsertDWORD Seed
packetbuf.InsertDWORD version
packetbuf.InsertDWORDCheckSum
packetbuf.InsertDWORD &H1 ' number of cdkeys
packetbuf.InsertDWORD &H0 'spawn
packetbuf.InsertNonNTString CDKeyHash
packetbuf.InsertNTString exeinfo
packetbuf.InsertNTString CDOwner
packetbuf.SendPacket sckBNET, &H51

End Function
[/code]
October 6, 2003, 9:11 PM
UserLoser
Try reading this.
October 6, 2003, 9:13 PM
Freeware
I received "Invalid Game Version" from battle.net.

Hmmm... This is my BNLS call to get a hashed cdkey, maybe this is wrong?

[code]
Public Function GETcdkeyhash(Cdkey As String, SessionKey As Long) As Variant

InsertDWORD SessionKey
InsertNTString Cdkey
SendBNLSPacket sckBNLS, &H1

End Function
[/code]

Instead of using checkrevision to make my version packet, would using BNLS_VERSIONCHECK (0x09) fix this problem?
(Though I have checked the returns from using BNLS and using BNETAUTH.dll, and they seem to be the same)
October 6, 2003, 9:30 PM
Arthas
[quote author=Freeware link=board=17;threadid=2977;start=0#msg23202 date=1065474680]
Well I got myself to recieve the Warcraft III cdkey and seed value, but I am unsure how to send it in 0x51. I have included code below how I *think* you are supposed to do it, any help you give would be great.

[code]
Public Function SendPacket0x51(Cdkeyhash as String, Seed as string) As String

packetbuf.InsertDWORD Seed
packetbuf.InsertDWORD version
packetbuf.InsertDWORDCheckSum
packetbuf.InsertDWORD &H1 ' number of cdkeys
packetbuf.InsertDWORD &H0 'spawn
packetbuf.InsertNonNTString CDKeyHash
packetbuf.InsertNTString exeinfo
packetbuf.InsertNTString CDOwner
packetbuf.SendPacket sckBNET, &H51

End Function
[/code]
[/quote]

This looks TOO obvious, but look at this line:
[code] packetbuf.InsertDWORDCheckSum[/code]
I'd change it to:
[code] packetbuf.InsertDWORD CheckSum[/code]

Like I said, maybe to obvious...
October 6, 2003, 9:47 PM
Freeware
[quote author=Arthas link=board=17;threadid=2977;start=0#msg23211 date=1065476828]
[quote author=Freeware link=board=17;threadid=2977;start=0#msg23202 date=1065474680]
Well I got myself to recieve the Warcraft III cdkey and seed value, but I am unsure how to send it in 0x51. I have included code below how I *think* you are supposed to do it, any help you give would be great.

[code]
Public Function SendPacket0x51(Cdkeyhash as String, Seed as string) As String

packetbuf.InsertDWORD Seed
packetbuf.InsertDWORD version
packetbuf.InsertDWORDCheckSum
packetbuf.InsertDWORD &H1 ' number of cdkeys
packetbuf.InsertDWORD &H0 'spawn
packetbuf.InsertNonNTString CDKeyHash
packetbuf.InsertNTString exeinfo
packetbuf.InsertNTString CDOwner
packetbuf.SendPacket sckBNET, &H51

End Function
[/code]
[/quote]

This looks TOO obvious, but look at this line:
[code] packetbuf.InsertDWORDCheckSum[/code]
I'd change it to:
[code] packetbuf.InsertDWORD CheckSum[/code]

Like I said, maybe to obvious...
[/quote]

Just a mistype ignore it.
October 6, 2003, 10:25 PM
Skywing
Check that your 'version byte' is correct for SID_AUTH_INFO (0x50). You can always request the latest version byte using BNLS_REQUESTVERSIONBYTE.

Make sure that you are reading the correct 9 DWORDs (36 bytes) from the BNLS_CDKEY reply. Note that the client session key ("Seed" in your code) is the first DWORD in the BNLS_CDKEY reply. Following it are the 9 DWORDs of encrypted CD-key data that you should insert after the spawn flag.

The general layout of SID_AUTH_CHECK is this:
(DWORD) Client session key; this should be retrieved from the BNLS_CDKEY reply.
(DWORD) Version; this should be retrieved from the BNLS_VERSIONCHECK reply.
(DWORD) Checksum; this should be retrieved from the BNLS_VERSIONCHECK reply.
(DWORD) Number of CD-keys following.
(DWORD) Spawn (1 -> enable, 0 -> disable).
FOR EACH CD-KEY:
(DWORD * 9) CD-key data; this should be retrieved from BNLS_CDKEY. If you are using a product that involves more than one CD-key (i.e. Diablo II: Lord of Destruction or Warcraft III: The Frozen Throne), then you must use BNLS_CDKEY_EX to encrypt all CD-keys using the same client session key. Note that there can be 0 or more CD-key blocks transmitted, depending on the product. Ideally, your code would take an array or some similar structure of CD-key encrypted data blocks and insert each one. This will ease portability between products.
END FOR
(STRING) Primary game module information; this should be retrieved from the BNLS_VERSIONCHECK reply.
(STRING) Owner of CD-key.
October 6, 2003, 10:47 PM
Freeware
Hmm then I must be either sending/recieving the cdkey hash data incorrectly, my version byte is uptodate, and I also packet logged CleanSlateBot vrs MyBNLSControl and cant find much difference. I've posted my code for recieving the warcraft III cdkey hash below, maybe you could check to see If Im doing it right?

[code]
Select Case PacketHeader
Case &H1
Dim CDKeyHash As String
Dim Seed As Long
result = MKL(Mid(PacketData, 1, 4))

If Result = 0 then
Msgbox "Cdkey Hash Failed!"
Exit Sub
End if

CDKeyHash = Mid(Data, 12)
Seed = Val("&H" & StrToHex(StrReverse(Mid(Data, 8, 4))))
Seed = CLng(Seed)

RaiseEvent GOTcdkeyhash(CDKeyHash, Seed)

End Select
[/code]

And from here it calls the function I have posted above to send the 0x51 packet.
October 6, 2003, 11:02 PM

Search