• Welcome to Valhalla Legends Archive.
 

BNLS (not CSB) Help..

Started by R.a.B.B.i.T, January 20, 2004, 06:03 PM

Previous topic - Next topic

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
Tell me what code you want to see, I don't want to post unecessary code.  Here are my 0x51 and 0x50 packets..

       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

Mesiah / haiseM

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...

* MesiaH is hinting to the missing letter "L"...
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Eric

#2
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 "->"

UserLoser.

#3
Quote
               InsertDWORD CLng(GetSystemDefaultLCID)
               InsertDWORD CLng(GetSystemDefaultLangID)

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

R.a.B.B.i.T

#4
Quote from: UserLoser. on January 20, 2004, 07:07 PM
Quote
               InsertDWORD CLng(GetSystemDefaultLCID)
               InsertDWORD CLng(GetSystemDefaultLangID)

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

Righty-o!

Quote from: LoRd on January 20, 2004, 07:03 PM
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 "->"



   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



Quote from: MesiaH on January 20, 2004, 06:59 PM
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...

* MesiaH is hinting to the missing letter "L"...

I'll have to fix that...

ChR0NiC

When you get disconnected are you being IP Banned....??

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.

Tuberload

Quote from: R.a.B.B.i.T on January 22, 2004, 04:59 PM
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.

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"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

R.a.B.B.i.T

Quote from: Tuberload on January 22, 2004, 05:08 PM
Quote from: R.a.B.B.i.T on January 22, 2004, 04:59 PM
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.

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.

I can do that, but not now, too much for me to do.  I'll do it over the weekend and report back.