• Welcome to Valhalla Legends Archive.
 

StarCraft BNLS logon packet sequence?

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

Previous topic - Next topic

Tontow

  I've been looking around and have yet to find a complet documentation of the StarCraft/BroodWar BNLS logon packet sequence (or for any of the games for that matter).
  I have found:
http://bnetdocs.valhallalegends.com/sequence.php lays out the packet order quite nicely but makes no mention of the BNLS packet order...

http://forum.valhallalegends.com/phpbbs/index.php?topic=8499.0
and

http://www.valhallalegends.com/yoni/BNLSProtocolSpec.txt gives the fist small portshion of the packet sequence.
 
  But, there is no complete documentation--(that I can find)--of the correct packet order.

edit: fixed incorrect url

Kp

Send your authorization first (if you bother to authorize at all), select your NLS version (if using NLS), and then send any messages you want in any order you choose.  Just beware that many NLS operations come in two parts, and you must perform the first part before the second.  Attempting to put the second one first will, at the least, return garbage data.  It may induce a server kill.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

MyndFyre

#2
You could have searched, I specified an algorithm that works in this thread.

[edit]I suppose that doesn't include BNLS packets.  But, you should be able to figure out what information you need from BNLS from that, and go from there.  So :P
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Blaze

#3
Warcraft 3{ROC/TFT}

'BNLS CONNECT
'BNLS CONNECTED
'BNLS: Send 0x0E        Optional
'BNLS: Receive 0x0E    Optional
'BNLS: Send 0x0F        Optional
'BNLS: Receive 0x0F    Optional
'BNLS: Send 0x0D
'BNLS: Receive 0x0D
'BNET CONNECT
'BNET CONNECTED
'BNET: Send 0x50
'BNET: Recieve 0x50
'BNET: Recieve 0x25
'BNET: Send 0x25        Optional
'BNLS: Send 0x09
'BNLS: Receive 0x09
'BNLS: Send 0x01
'BNLS: Receive 0x01
'BNET: Send 0x51
'BNET: Recieve 0x51
'BNLS: Send 0x02
'BNLS: Receive 0x02
'BNET: Send 0x53
'BNET: Recieve 0x53
'BNLS: Send 0x03
'BNLS: Recieve 0x03
'BNET: Send 0x54
'BNET: Recieve 0x54
'BNET: Send 0x0A
'BNET: Recieve 0x0A

'Legacy Clients (STAR, SEXP, W2BN(Well, not really but :P), D2DV, D2XP)

'BNLS: CONNECT
'BNLS: CONNECTED
'BNLS: Send 0x0E        Optional
'BNLS: Receive 0x0E     Optional
'BNLS: Send 0x0F        Optional
'BNLS: Receive 0x0F     Optional
'BNET: CONNECT
'BNET: CONNECTED
'BNET: Send 0x50
'BNET: Receive 0x50
'BNET: Recieve 0x25
'BNET: Send 0x25        Optional
'BNLS: Send 0x09
'BNLS: Receive 0x09
'BNLS: Send 0x01
'BNLS: Receive 0x01
'BNET: Send 0x51
'BNET: Receive 0x51
'BNLS: Send 0x0B
'BNLS: Receive 0x0B
'BNET: Send 0x3A
'BNET: Receive 0x3A
'BNET: Send 0x0A
'BNET: Receive 0x0A
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

UserLoser.

Quote from: Kp on June 23, 2005, 09:06 PM
Send your authorization first (if you bother to authorize at all), select your NLS version (if using NLS), and then send any messages you want in any order you choose.  Just beware that many NLS operations come in two parts, and you must perform the first part before the second.  Attempting to put the second one first will, at the least, return garbage data.  It may induce a server kill.

To my knowledge Sky fixed that where you must send one message before the other, so I don't think the server would die :P.  When I first got garbage data back from BNLS I told him immediately and he fixed the issue.

Warrior

It's pretty straight forward, use BNLS "as needed". When you need to send a password hash, thats when you send that packet. And so on.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Tontow

  "common sense" told be to make a post and ask people who already knew rather then taking a week or 2 trying to use common sense to figure out what went where; thus benefiting from the knowledge of others and an increased chance of getting it right the first time. ;D

and

  I think its more of a use "as required" because there are packets that you must send and receive packets before other packets can be sent and/or received; at least, that is what I concluded while i was trudging my way though the BNLSProtocolSpec.txt--
  Very useful and detailed information, but it defeats itself with the lack of cleanly presented packet order documentation like bnetdocs has.

  A web page that is formatted like bnetdocs would be very useful.
IE:
C>S (packet name) (packet id) (requires data from (packet name) (packet id)
  Like Shout laid out in the last part of his post, but with each packet name/id being a link to documentation on that particular packet; it would make it easier for new people (like me) who want to start using BLNS.

LivedKrad

Quote from: Blaze on June 23, 2005, 09:27 PM
Warcraft 3{ROC/TFT}

'BNLS CONNECT
'BNLS CONNECTED
'BNLS: Send 0x0E        Optional
'BNLS: Receive 0x0E    Optional
'BNLS: Send 0x0F        Optional
'BNLS: Receive 0x0F    Optional
'BNLS: Send 0x0D
'BNLS: Receive 0x0D
'BNET CONNECT
'BNET CONNECTED
'BNET: Send 0x50
'BNET: Recieve 0x50
'BNET: Recieve 0x25
'BNET: Send 0x25        Optional
'BNLS: Send 0x09
'BNLS: Receive 0x09
'BNLS: Send 0x01
'BNLS: Receive 0x01
'BNET: Send 0x51
'BNET: Recieve 0x51
'BNLS: Send 0x02
'BNLS: Receive 0x02
'BNET: Send 0x53
'BNET: Recieve 0x53
'BNLS: Send 0x03
'BNLS: Recieve 0x03
'BNET: Send 0x54
'BNET: Recieve 0x54
'BNET: Send 0x0A
'BNET: Recieve 0x0A

'Legacy Clients (STAR, SEXP, W2BN(Well, not really but :P), D2DV, D2XP)

'BNLS: CONNECT
'BNLS: CONNECTED
'BNLS: Send 0x0E        Optional
'BNLS: Receive 0x0E     Optional
'BNLS: Send 0x0F        Optional
'BNLS: Receive 0x0F     Optional
'BNET: CONNECT
'BNET: CONNECTED
'BNET: Send 0x50
'BNET: Receive 0x50
'BNET: Recieve 0x25
'BNET: Send 0x25        Optional
'BNLS: Send 0x09
'BNLS: Receive 0x09
'BNLS: Send 0x01
'BNLS: Receive 0x01
'BNET: Send 0x51
'BNET: Receive 0x51
'BNLS: Send 0x0B
'BNLS: Receive 0x0B
'BNET: Send 0x3A
'BNET: Receive 0x3A
'BNET: Send 0x0A
'BNET: Receive 0x0A

I've never successfully received 0x0A without first sending 0x0C.

Blaze

LivedKrad: Don't you have to be in the chat before you can join a channel?
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Kp

Quote from: UserLoser on June 23, 2005, 11:08 PM
Quote from: Kp on June 23, 2005, 09:06 PMSend your authorization first (if you bother to authorize at all), select your NLS version (if using NLS), and then send any messages you want in any order you choose.  Just beware that many NLS operations come in two parts, and you must perform the first part before the second.  Attempting to put the second one first will, at the least, return garbage data.  It may induce a server kill.
To my knowledge Sky fixed that where you must send one message before the other, so I don't think the server would die :P.  When I first got garbage data back from BNLS I told him immediately and he fixed the issue.

"Server kill" refers to the server killing you (i.e. immediate and forcible termination of connection), not to the server dying. :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

QwertyMonster


Warrior

Not really Tontow, as you're writing your battle.net connection send/recv BNLS packets as needed.
I don't see what's so hard about that as opposed to someone spoon feeding it to you.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Tontow

What are the advantages of sending 0x3A instead of 0x29 ? - bnetdocs has 0x29 listed in the logon sequences.

shout

3A has additional error codes.

Apologies for my last post. It was out of line.

Tontow

ok, let me see if I'm understanding what is used where.  I also have a few questions.


BNLS - connect
BNLS - connected

I need to skip sending 0x0e and 0x0f for anonomyse logon.

BNET -  connect
BNET -  connected

BNET - send 0x50 ,  I don't think that there is anything too special being done, just system information gathering.
BNET - recieve 0x25 , I can just ignore this.
BNET - recieve 0x50, I need to grap the second DWORD in this for later use.
BNET - send 0x25 (optional) , If I don't bother sending this will my lag be displaed to other clients as 0 bars?

  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

BNET - send 0x51 , Use data gathered from BNLS 0x09 and 0x01
BNET - recieve 0x51 , Tells me weather or not I passed SID_AUTH_CHECK.

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

  BNET - send 0x3a , Need password that has be hashed by BNLS.
  BNET - recieve 0x3a , Tells me weather or not my logon was correct.
  BNET - send 0x14 , Do I really need to send this?
  BNET - send 0x0a , and this and the rest has nothing to do with BNLS?