• Welcome to Valhalla Legends Archive.
 

StarCraft BNLS logon packet sequence?

Started by Tontow, June 23, 2005, 08:54 PM

Previous topic - Next topic

Hdx

Quote from: Tontow on June 24, 2005, 11:53 PM
BNET - recieve 0x50, I need to grap the second DWORD in this for later use.
  BNLS - send 0x09 ,  :-\
  BNLS - recieve 0x09 , My best guess is that this is a replacement for CheckRevision() that is used with BNET 0x51 because of a mention of lX86Ver, BUT I have no idea what the String and 2 DWORDs are.  Are the two DWORDs the EXE Version and EXE Hash with the string being the Exe Information???
  BNLS - send 0x01 , Need the second DWORD from BNET 0x50.
  BNLS - recieve 0x01 , I know that the DWORDs are for BNET 0x51, but I can't figure out where thay go. - there is no mention of a "Client session key" or a "(9 DWORDs) CD-key data" on bnetdocs documentation of 0x51
Quote(DWORD)       Logon Type
(DWORD)       Server Token
(DWORD)       UDPValue**
(FILETIME)    MPQ filetime
(STRING)     IX86ver filename
(STRING)     ValueString
The bolded parts are the important parts.

Quote(DWORD)       Product ID.
(DWORD)       Version DLL digit
(STRING)     Checksum formula.

Valid ProductIDs are:
0x01: Starcraft
0x02: Starcraft: Broodwar
0x03: Warcraft II: BNE
0x04: Diablo II
0x05: Diablo II: LoD
0x06: Starcraft: Japanese
0x07: Warcraft III
0x08: Warcraft III: The Frozen Throne
The quote explains the Prod ID, and the 2nd DWORD is the number found in the "IX86ver filename". EXA: IX86ver1.mpq, So the 2nd DWORD would be 0x01. And the string is the "ValueString" from 0x50.

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

For Each Key:
(DWORD)       Key Length
(DWORD)       CD key's product value
(DWORD)       CD key's public value
(DWORD)       Unknown (0)
(DWORD[5])    Hashed Key Data


(STRING)     Exe Information
(STRING)     CD Key owner name
Client token in BNLS:0x01 corrosponds to client token in BNET:0x51, And note the bolded area. 5 DWORDS +4 others = 9DWORDS, Thats where the "(DWORD[9])    CD key data" comes in.

Quote from: Tontow on June 24, 2005, 11:53 PM
BNET - send 0x51 , Use data gathered from BNLS 0x09 and 0x01 'Correct.
BNET - recieve 0x51 , Tells me weather or not I passed SID_AUTH_CHECK. 'Correct

  BNLS - send 0x0b , Send password for hashing. 'Yup
  BNLS - recieve 0x0b , Grab hashed password. 'yup

  BNET - send 0x3a , Need password that has be hashed by BNLS. 'yup
  BNET - recieve 0x3a , Tells me weather or not my logon was correct. 'yup
  BNET - send 0x14 , Do I really need to send this? 'No you don't this is what tells BNET to give you the Lag plug or not.
  BNET - send 0x0a , and this and the rest has nothing to do with BNLS? 'You sir, are againn correct.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Tontow

BLNS documentation says "Session key", BnetDocs says "Token". - I'm gessing that these are the same thing?  It would have been alot less confuseing if thay where to have used the same termenolgy....

Kp

Quote from: Tontow on June 25, 2005, 12:26 PMBLNS documentation says "Session key", BnetDocs says "Token". - I'm gessing that these are the same thing?  It would have been alot less confuseing if thay where to have used the same termenolgy....

Your posts would be a lot more readable if you spelled correctly, but we don't always get what we want.  BnetDocs and the BNLS documentation were written by different sets of authors.  To the best of my knowledge, the documents do not conflict on any data points, so it should be fairly simple to match up naming discrepancies.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Blaze

Tokens/SessionKeys are for identifying individual requests.
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Tontow

Ok, I think I've got it now; please correct me if I have anything wrong. (btw, this would be a good thred to put in the Battle.net Bot Development References forum after all is said and done)


BNET: (send) Protocol byte (01);
value for games: 0x01

BNET: (send) SID_AUTH_INFO 0x50, Gathering of client system information;
(DWORD)  Protocol ID - (0)
(DWORD)  Platform ID - IX86
(DWORD)  Product ID - STAR or SEXP
(DWORD)  Version Byte - 0xCB for STAR or 0xCB for SEXP
(DWORD)  Product language - 0
(DWORD)  Local IP for NAT compatibility - Client IP , What is NAT?
(DWORD)  Time zone bias* - determined by Client
(DWORD)  Locale ID - 0
(DWORD)  Language ID - can be retrieved using the GetUserDefaultLangID API.
(STRING)  Country abreviation - can be retrieved using the GetLocaleInfo API
(STRING)  Country - can be retrieved using the GetLocaleInfo API

BNET: (receive) SID_PING 0x25, ignored

BNET: (receive) SID_AUTH_INFO 0x50, It seems I need 3 values from this packet?
(DWORD)  Logon Type
(DWORD)  Server Token - Need this session Key From battle.net for use in BNLS 0x01
(DWORD)  UDPValue**
(FILETIME)  MPQ filetime
(STRING)  IX86ver filename - Need this for the vershion DLL digit for use in BNLS 0x09
(STRING)  ValueString - Checksum formula to be used in BNLS 0x09

BNET: (send) SID_PING  0x25, ignored

= Start building data for BNET 0x51, Are BLNS 0x01 & 0x09 always used together?  If so, then why arn't thay just one packet?- I know that there shouldn't be more than 2 keys and even then, the way 0x01 is it could be made to have 2 cdkey strings with the second being null if there is only one key.

BNLS: (send) BNLS_VERSIONCHECK 0x09
(DWORD) Product ID. - 0x01 for SC or 0x02 for BW
(DWORD) Version DLL digit in the range 0-7. (For example, for IX86Ver1.mpq this is 1) -  Need the IX86ver filename from BNET: (receive) SID_AUTH_INFO 0x50 for this value.
(String) Checksum formula. - ValueString from BNET: (receive) SID_AUTH_INFO 0x50

BLNS: (receive) BNLS_VERSIONCHECK 0x09
(BOOL) Success (TRUE if successful, FALSE otherwise). If this is FALSE, there is no more data in this message.
(DWORD) Version. - BNET: (send) SID_AUTH_CHECK 0x51 's EXE Vershion
(DWORD) Checksum. - BNET: (send) SID_AUTH_CHECK 0x51 's EXE Hash
(String) Version check stat string. - BNET: (send) SID_AUTH_CHECK 0x51 's EXE Information

BNLS: (send) BNLS_CDKEY 0x01
(DWORD) Session key (Server Token) from Battle.net. This is the second DWORD in SID_AUTH_INFO (0x50).
(String) CD-key. No dashes or spaces.

BLNS: (receive) BNLS_CDKEY 0x01
(BOOL) Success (TRUE if successful, FALSE otherwise). If this is FALSE, there is no more data in this message.
(DWORD) Client session key. - SID_AUTH_CHECK 0x51 's Client Token
(9 DWORDs) CD-key data. - data needed for each key in SID_AUTH_CHECK 0x51, I'm assumeing that this is already in the correct order to be sent to BNET?

=

BNET: (send) SID_AUTH_CHECK 0x51
(DWORD)       Client Token - BNLS_CDKEY 0x01 's Client session key.
(DWORD)       EXE Version - BNLS_VERSIONCHECK 0x09 's Version.
(DWORD)       EXE Hash - BNLS_VERSIONCHECK 0x09 's Checksum.
(DWORD)       Number of keys in this packet - 1, Would "1" or "one" be the correct value?
(BOOLEAN)    Using Spawn (32-bit) - True or False depending on the client.
--For Each Key:-- BNLS_CDKEY 0x01 's CD-key data.
(DWORD)       Key Length
(DWORD)       CD key's product value
(DWORD)       CD key's public value
(DWORD)       Unknown (0)
(DWORD[5])    Hashed Key Data
----
(STRING)     Exe Information - BNLS_VERSIONCHECK 0x09 's Version check stat string.
(STRING)     CD Key owner name

BNET: (receive) SID_AUTH_CHECK 0x51 etc...

UserLoser.

#20
Quote
(DWORD)       Number of keys in this packet - 1, Would "1" or "one" be the correct value?

Um, 0x00000001.

Tontow

What typo?


I seem to be haveing a problem with the protocol byte.  I connect then send
sckbnet.SendData &H1
and then the socket goses to state 8 (Peer is closing the connection)

Should it be chr(1) instead of &H1 ?  Because I send sckbnet.SendData &H3 for chat and it works.....

R.a.B.B.i.T


UserLoser.

For chat:


Call sckBnet.SendData("c")

- or -

Call sckBnet.SendData(Chr(3))


For game:

Call sckBnet.SendData(Chr(1))

Tontow

hmm, If you send Chr(&H1) and fail to follow it with 0x50, will you get an ip ban?
Because I tryed logging on with BW (the game, not the bot) and it said that bnet wasnt responding...