Valhalla Legends Forums Archive | Battle.net Bot Development | BNLS (not CSB) Help..

AuthorMessageTime
R.a.B.B.i.T
Okay, I've gotten pretty far on my own, but now I'm stuck.
I get this series of responses from my bot:
[quote]
[19:01:37] BNLS: Connecting...
[19:01:37] BNLS: Connected
[19:01:37] BNLS: Authorized
[19:01:37] BNET: Connected
[19:01:37] Successfully connected in 571 milliseconds
[19:01:38] BNET: Version and CD-key check passed.
[19:01:38] BNET: Logon passed.
[19:01:38] BNLS: Disconnected
[/quote]
Tell me what code you want to see, I don't want to post unecessary code. Here are my 0x51 and 0x50 packets..
[code]
Case &H10 'BNLS return of VerByte
If Left(Data, 1) <> &H0 Then
Dim vb1
vb1 = Replace(Replace(Replace(CStr(StrToHex(Data)), vbNullChar, ""), " ", ""), "00", "")
vb1 = Right(vb1, 2)
InsertDWORD &H0
InsertNonNTString "68XI" & varproduct
InsertDWORD "&H" & vb1
InsertDWORD &H0
InsertDWORD &H0
InsertDWORD &H480
InsertDWORD CLng(GetSystemDefaultLCID)
InsertDWORD CLng(GetSystemDefaultLangID)
InsertNTString "USA"
InsertNTString "United States"
sendPacket &H50
End If

'----------------------==================

Public Sub Send0x51()
InsertDWORD GTC
InsertDWORD Version
InsertDWORD checksum
If varproduct = "PX2D" Then
InsertDWORD &H2
Else
InsertDWORD &H1
End If
InsertDWORD &H0
InsertNonNTString CdkeyHash
If varproduct = "PX2D" Or varproduct = "PX3W" Then
InsertNonNTString Cdkey2Hash
End If
InsertNTString exeinfo
InsertNTString varUser
sendPacket &H51
End Sub

'----------------------==================

Case &H51
Select Case GetWORD(Mid(Data, 5, 2))
Case &H0
AddI vbGreen, "BNET: Version and CD-key check passed."
If varproduct = "3RAW" Or varproduct = "PX3W" Then
InsertNTString varUser
InsertNTString varPass
sendBNLSPacket &H2
Else
Dim Tempb1 As String
InsertNonNTString "tenb"
sendPacket &H14
sendPacket &H2D
Tempb1 = String(7 * 4, vbNullChar)
rb = A(Tempb1, Servers, varPass)
InsertNonNTString Tempb1
InsertNTString varUser
sendPacket &H3A
End If
[/code]
January 21, 2004, 12:03 AM
MesiaH
This isn't related to your problem, but its funny, the image in your signature, says head moderator of http://www.blizzword.com, too bad the site doesn't exist, must be a pretty easy job...

[me=MesiaH]is hinting to the missing letter "L"...[/me]
January 21, 2004, 12:59 AM
LoRd
Packet ID: 0x51
Direction: Client -> Server (Sent)
Format:

-> (DWORD)       Client Token
-> (DWORD)       EXE Version
-> (DWORD)       EXE Hash
-> (DWORD)       Number of keys in -> ---> (BOOLEAN)    Using Spawn (32-bit)

For Each Key:
(DWORD)       Key Length
(DWORD)       Product
(DWORD)       CDKEY Value 1
(DWORD)       Unknown (0)
(DWORD[5])    Hashed Key Data

(STRING)       Exe Information
(STRING)       CD Key owner name

The parts you're missing are indicated with a "->"
January 21, 2004, 1:03 AM
UserLoser.
[quote]
InsertDWORD CLng(GetSystemDefaultLCID)
InsertDWORD CLng(GetSystemDefaultLangID)
[/quote]

CLng isn't necesary; those return as a long


Also, if using Starcraft or Broodwar; GetUserDefaultLCID and GetUserDefaultLangID is more accurate to the actual game client
January 21, 2004, 1:07 AM
R.a.B.B.i.T
[quote author=UserLoser. link=board=17;threadid=4823;start=0#msg40408 date=1074647274]
[quote]
InsertDWORD CLng(GetSystemDefaultLCID)
InsertDWORD CLng(GetSystemDefaultLangID)
[/quote]

CLng isn't necesary; those return as a long


Also, if using Starcraft or Broodwar; GetUserDefaultLCID and GetUserDefaultLangID is more accurate to the actual game client
[/quote]

Righty-o!

[quote author=LoRd link=board=17;threadid=4823;start=0#msg40407 date=1074647004]
Packet ID: 0x51
Direction: Client -> Server (Sent)
Format:

-> (DWORD) Client Token
-> (DWORD) EXE Version
-> (DWORD) EXE Hash
-> (DWORD) Number of keys in -> ---> (BOOLEAN) Using Spawn (32-bit)

For Each Key:
(DWORD) Key Length
(DWORD) Product
(DWORD) CDKEY Value 1
(DWORD) Unknown (0)
(DWORD[5]) Hashed Key Data

(STRING) Exe Information
(STRING) CD Key owner name

The parts you're missing are indicated with a "->"

[/quote]

[code]
InsertDWORD GTC 'Client Token..
InsertDWORD Version 'Exe ver
InsertDWORD checksum 'Exe hash
If varproduct = "PX2D" Then
InsertDWORD &H2 'key count
Else
InsertDWORD &H1 'key count
End If
InsertDWORD &H0 'False (Spawn)
InsertNonNTString CdkeyHash 'Key Hash
If varproduct = "PX2D" Or varproduct = "PX3W" Then
InsertNonNTString Cdkey2Hash 'second key hash
End If
InsertNTString exeinfo 'Exe info
InsertNTString varUser 'Key Owner
sendPacket &H51
[/code]


[quote author=MesiaH link=board=17;threadid=4823;start=0#msg40406 date=1074646752]
This isn't related to your problem, but its funny, the image in your signature, says head moderator of http://www.blizzword.com, too bad the site doesn't exist, must be a pretty easy job...

[me=MesiaH]is hinting to the missing letter "L"...[/me]
[/quote]

I'll have to fix that...
January 21, 2004, 1:15 AM
ChR0NiC
When you get disconnected are you being IP Banned....??
January 22, 2004, 1:52 PM
R.a.B.B.i.T
Nope, and thanks to Stealth's help (a very large bit of help, if you catch my drift), I have been able to send and parse 0x50 and 0x51 correctly, but my winsock closes. I have added a Debug.Print to every place where my code tells the winsock to close, but none are firing. It appears that the sock itself just...dies.
January 22, 2004, 10:59 PM
Tuberload
[quote author=R.a.B.B.i.T link=board=17;threadid=4823;start=0#msg40715 date=1074812351]
Nope, and thanks to Stealth's help (a very large bit of help, if you catch my drift), I have been able to send and parse 0x50 and 0x51 correctly, but my winsock closes. I have added a Debug.Print to every place where my code tells the winsock to close, but none are firing. It appears that the sock itself just...dies.
[/quote]

Is it possible you a still doing something wrong, and Battle.net itself is disconnecting you? I suggest you log the data sent between <insert your favorite game/emulator here> and battle.net and check for differences.
January 22, 2004, 11:08 PM
R.a.B.B.i.T
[quote author=Tuberload link=board=17;threadid=4823;start=0#msg40717 date=1074812884]
[quote author=R.a.B.B.i.T link=board=17;threadid=4823;start=0#msg40715 date=1074812351]
Nope, and thanks to Stealth's help (a very large bit of help, if you catch my drift), I have been able to send and parse 0x50 and 0x51 correctly, but my winsock closes. I have added a Debug.Print to every place where my code tells the winsock to close, but none are firing. It appears that the sock itself just...dies.
[/quote]

Is it possible you a still doing something wrong, and Battle.net itself is disconnecting you? I suggest you log the data sent between <insert your favorite game/emulator here> and battle.net and check for differences.
[/quote]

I can do that, but not now, too much for me to do. I'll do it over the weekend and report back.
January 22, 2004, 11:27 PM

Search