Valhalla Legends Forums Archive | Battle.net Bot Development | VB: BNLS_CDKEY_EX

AuthorMessageTime
shadypalm88
BNLS closes my connection with no response after sending BNLS_CDKEY_EX, so I must be formatting the packet wrong, sending invalid data, or something of the sort. I'm hoping that someone can tell me where the fault is.

Here's an example BNLS_CDKEY_EX packet generated by my bot that causes the BNLS server to disconnect:[code]1B 00 0C 00 00 00 00 01 01 E6 01 7D 4F (CD-Key Data: 13 bytes) 00[/code]
Here is the code being used to generate the packet (B is a PacketBuffer object):[code]Case SID_AUTH_INFO:
'BotEvent ERR_DEBUG, "Recieved SID_AUTH_INFO:" & StrToHex(strData)
f = 0
PKS(f).Type = PKT_BYTE 'StartPacket
f = f + 1
PKS(f).Type = PKT_BYTE 'B.Net Packet Header
f = f + 1

PKS(f).Type = PKT_WORD 'Packet Length
IncI f
PKS(f).Type = PKT_DWORD 'Logon Type
f = f + 1
PKS(f).Type = PKT_DWORD 'Server Token
f = f + 1
PKS(f).Type = PKT_DWORD 'UDPValue
f = f + 1
PKS(f).Type = PKT_FILETIME 'MPQ Filetime
f = f + 1
PKS(f).Type = PKT_STRING 'IX86ver filename
PKS(f).ReadUntil = Chr(0) 'Null-terminator
f = f + 1
PKS(f).Type = PKT_STRING 'ValueString
PKS(f).ReadUntil = Chr(0) 'Null-terminator
f = f + 1
DividePacket PKD, PKS, f, strData
ServerToken = PKD(4).lngData
'MsgBox Val(Mid$(strData, 9, 12)), vbInformation
With B
.InsertDWORD &H0
If (BotData.Client = "D2XP" Or BotData.Client = "W3XP") Then
.InsertBYTE &H2
Else
.InsertBYTE &H1
End If
.InsertBYTE &H1
'CopyMemory DPData(i).lngData, ByVal Mid$(Data, CurPos, 4), 4
'CopyMemory lngWork, Mid$(strData, 9, 12), 4
.InsertDWORD_Raw CStr(PKD(4).Data)
.InsertNTString BotData.CDKey
If (BotData.Client = "D2XP" Or BotData.Client = "W3XP") Then _
.InsertNTString BotData.ExCDKey
.sendPacket BNLS_CDKEY_EX, BNLSSocket, True
End With
[/code]
October 25, 2003, 12:53 AM
Soul Taker
Well the format is
[quote](DWORD) Cookie. This value has no special meaning to the server and will simply be echoed to the client in the response.
(BYTE) Amount of CD-keys to encrypt. Must be between 1 and 32.
(DWORD) Flags.*
(DWORD or DWORDs) Server session key(s), depending on the flags.
(Optional DWORD or DWORDs) Client session key(s), depending on the flags.
(String or strings) CD-keys. No dashes or spaces. The client can use multiple types of CD-keys in the same packet.[/quote]
I see you inserting a DWORD for the cookie, a byte for the amount of keys to encrypt, but then a byte for the flags, when it should be a DWORD.
October 25, 2003, 3:27 AM
shadypalm88
Well, I guess that would do it, eh? ::)
October 25, 2003, 5:21 PM

Search