

The Battle.Net Chat Server ("BNCS") is the unofficial name of the protocol that Blizzard's Battle.net-enabled games used to communicate. The games that historically used this protocol are Diablo, StarCraft, WarCraft II, Diablo II, WarCraft III, and their expansions. This is now referred to as "Classic" or "Classic Battle.net" these days. The protocol operates on TCP port 6112 (and UDP port 6112 for pre-Diablo II player-to-player communication).
It is a binary protocol with very little encryption (it's there for password and product key exchanges, but otherwise absent), stemming from the age where every byte mattered back in 1996.
BNCS Headers
Every BNCS message has the same header:
(UINT8) Always 0xFF
(UINT8) Message ID
(UINT16) Message length, including this header
(VOID) Message data
The BNCS protocol is aggressively enforced by Battle.net - at least, for clients - and violations of the protocol generally result in an IP ban.
Protocol Byte
When connecting to a BNCS server, you must first tell the server which protocol you wish to use by sending a protocol ID byte before any messages. Some of the protocol IDs are:
- Game:
0x01
(see below for the logon sequences) - BNFTP:
0x02
(see BNFTPv1 or BNFTPv2 for the protocols) - Telnet (Chat):
0x03
,0x63
(see Telnet Protocol for the protocol) DEFUNCT
Other Battle.net protocol IDs exist. We know of MCP to BNCS communication (0x04
). There is also the 0x06
and 0x81
protocols, which we know almost nothing about. At a guess, 0x06
is used for interserver synchronization (see this thread).
Logon Sequences
This section documents the sequences of messages that must be sent, and should be received, in order to log on using a particular product. Products may be able to use methods other than the ones shown here: this page documents the sequences observed in the official clients. These sequences may vary from time to time, as product updates are released.
You will also need the Product Identification document to understand how to identify as each product.
Prior to initiating any of the game protocol logon sequences, you will need to send the game protocol byte (0x01
).
Starcraft and Brood War (pre-1.18)
StarCraft 1.18 and later versions no longer use the BNCS protocol as detailed here. StarCraft Shareware and StarCraft Japanese products present a required update to the now-free StarCraft 1.18 client.
- C > S [0x50] SID_AUTH_INFO
- S > C [0x25] SID_PING
- C > S [0x25] SID_PING (optional)
- S > C [0x50] SID_AUTH_INFO
- C > S [0x51] SID_AUTH_CHECK
- S > C [0x51] SID_AUTH_CHECK
- C > S [0x2D] SID_GETICONDATA (optional)
- C > S [0x33] SID_GETFILETIME ("icons_STAR.bni") (optional)
- C > S [0x14] SID_UDPPINGRESPONSE (optional)
- S > C [0x2D] SID_GETICONDATA ("icons.bni") (optional response)
- C > S [0x33] SID_GETFILETIME ("tos_USA.txt") (optional)
- C > S [0x33] SID_GETFILETIME ("bnserver.ini") (optional)
- C > S [0x26] SID_READUSERDATA (optional)
- S > C [0x33] SID_GETFILETIME ("icons_STAR.bni") (optional)
- S > C [0x33] SID_GETFILETIME ("tos_USA.txt") (optional)
- S > C [0x33] SID_GETFILETIME ("bnserver.ini") (optional)
- S > C [0x26] SID_READUSERDATA (optional)
-
Client waits for user to enter account information (standard logon shown):
- Client then enters chat.
Diablo II and Lord of Destruction
- C > S [0x50] SID_AUTH_INFO
- S > C [0x25] SID_PING
- C > S [0x25] SID_PING (optional)
- S > C [0x50] SID_AUTH_INFO
- C > S [0x51] SID_AUTH_CHECK
- S > C [0x51] SID_AUTH_CHECK
- Client gets TOS file:
- C > S [0x33] SID_GETFILETIME ("tos_USA.txt") (optional)
- S > C [0x33] SID_GETFILETIME (one for each request)
- Connection to BNFTPv1 to do file downloads
- Client waits for user to enter account information (standard logon shown):
- Client does realm logon here for closed Battle.net:
- C > S [0x0B] SID_GETCHANNELLIST
- C > S [0x0A] SID_ENTERCHAT
- S > C [0x0B] SID_GETCHANNELLIST
- S > C [0x0A] SID_ENTERCHAT
- C > S [0x46] SID_NEWS_INFO (optional)
- S > C [0x46] SID_NEWS_INFO (optional response)
- Client waits until user wants to Enter Chat.
- C > S [0x0C] SID_JOINCHANNEL (D2 First Join if no home channel set)
- S > C [0x0F] SID_CHATEVENT
- A sequence of chat events for entering chat follow.
Warcraft II BNE
- C > S [0x1E] SID_CLIENTID2
- C > S [0x12] SID_LOCALEINFO
- C > S [0x06] SID_STARTVERSIONING
- S > C [0x05] SID_CLIENTID
- S > C [0x1D] SID_LOGONCHALLENGEEX
- S > C [0x25] SID_PING
- C > S [0x25] SID_PING (optional)
- S > C [0x06] SID_STARTVERSIONING
- C > S [0x07] SID_REPORTVERSION
- S > C [0x07] SID_REPORTVERSION
- C > S [0x14] SID_UDPPINGRESPONSE (optional)
- C > S [0x36] SID_CDKEY2
- S > C [0x36] SID_CDKEY2
- Client gets icons file, TOS file, and server list file:
- C > S [0x2D] SID_GETICONDATA (optional)
- S > C [0x2D] SID_GETICONDATA (optional response)
- C > S [0x33] SID_GETFILETIME (returned icons file name) (optional)
- C > S [0x33] SID_GETFILETIME ("tos_USA.txt") (optional)
- C > S [0x33] SID_GETFILETIME ("bnserver.ini") (optional)
- S > C [0x33] SID_GETFILETIME (one for each request)
- Connection to BNFTPv1 to do file downloads
- Client waits for user to enter account information (standard logon shown):
- Client then enters chat.
Warcraft III Reign of Chaos and The Frozen Throne
- C > S [0x50] SID_AUTH_INFO
- S > C [0x25] SID_PING
- C > S [0x25] SID_PING (optional)
- S > C [0x50] SID_AUTH_INFO
- C > S [0x51] SID_AUTH_CHECK
- S > C [0x51] SID_AUTH_CHECK
- Client gets icons file, TOS file, and server list file:
- C > S [0x2D] SID_GETICONDATA (optional)
- S > C [0x2D] SID_GETICONDATA (optional response)
- C > S [0x33] SID_GETFILETIME (returned icons file name) (optional)
- C > S [0x33] SID_GETFILETIME ("tos_USA.txt") (optional)
- C > S [0x33] SID_GETFILETIME ("bnserver.ini") (optional)
- S > C [0x33] SID_GETFILETIME (one for each request)
- Connection to BNFTPv2 to do file downloads
- Client waits for user to enter account information (standard logon shown, uses NLS):
- C > S [0x45] SID_NETGAMEPORT (optional)
- C > S [0x0A] SID_ENTERCHAT
- S > C [0x0A] SID_ENTERCHAT
- C > S [0x44] SID_WARCRAFTGENERAL (WID_TOURNAMENT) (optional)
- S > C [0x44] SID_WARCRAFTGENERAL (WID_TOURNAMENT) (optional response)
- C > S [0x46] SID_NEWS_INFO (optional)
- S > C [0x46] SID_NEWS_INFO (optional response)
- Client waits until user wants to Enter Chat.
- C > S [0x0C] SID_JOINCHANNEL (First Join, "W3")
- S > C [0x0F] SID_CHATEVENT
- A sequence of chat events for entering chat follow.
Warcraft III Demo (defunct)
- C > S [0x50] SID_AUTH_INFO
- S > C [0x25] SID_PING
- C > S [0x25] SID_PING (optional)
- S > C [0x50] SID_AUTH_INFO
- C > S [0x51] SID_AUTH_CHECK
- S > C [0x51] SID_AUTH_CHECK
- C > S [0x53] SID_AUTH_ACCOUNTLOGON*
- S > C [0x54] SID_AUTH_ACCOUNTLOGONPROOF
- C > S [0x45] SID_NETGAMEPORT (optional)
Note: W3DM does not enter chat, nor does it validate account passwords.
Starcraft Shareware (defunct)
StarCraft 1.18 and later versions no longer use the BNCS protocol as detailed here. StarCraft Shareware and StarCraft Japanese products present a required update to the now-free StarCraft 1.18 client.
- C > S [0x05] SID_CLIENTID
- C > S [0x12] SID_LOCALEINFO (optional)
- C > S [0x2B] SID_SYSTEMINFO (optional)
- C > S [0x06] SID_STARTVERSIONING
- S > C [0x05] SID_CLIENTID
- S > C [0x28] SID_LOGONCHALLENGE
- S > C [0x25] SID_PING
- C > S [0x25] SID_PING (optional)
- S > C [0x06] SID_STARTVERSIONING
- C > S [0x07] SID_REPORTVERSION
- S > C [0x07] SID_REPORTVERSION
- Client waits for user to enter account information (standard logon shown):
- C > S [0x14] SID_UDPPINGRESPONSE (optional)
- Client then enters chat.
Starcraft Japanese (defunct)
StarCraft 1.18 and later versions no longer use the BNCS protocol as detailed here. StarCraft Shareware and StarCraft Japanese products present a required update to the now-free StarCraft 1.18 client.
- C > S [0x05] SID_CLIENTID
- C > S [0x12] SID_LOCALEINFO (optional)
- C > S [0x2B] SID_SYSTEMINFO (optional)
- C > S [0x06] SID_STARTVERSIONING
- S > C [0x05] SID_CLIENTID
- S > C [0x28] SID_LOGONCHALLENGE
- S > C [0x25] SID_PING
- C > S [0x25] SID_PING (optional)
- S > C [0x06] SID_STARTVERSIONING
- C > S [0x07] SID_REPORTVERSION
- S > C [0x07] SID_REPORTVERSION
- C > S [0x30] SID_CDKEY
- S > C [0x30] SID_CDKEY
- Client waits for user to enter account information (standard logon shown):
- C > S [0x14] SID_UDPPINGRESPONSE (optional)
- Client then enters chat.
Diablo Shareware and Diablo Retail
- C > S [0x1E] SID_CLIENTID2
- C > S [0x12] SID_LOCALEINFO
- C > S [0x06] SID_STARTVERSIONING
- S > C [0x05] SID_CLIENTID
- S > C [0x1D] SID_LOGONCHALLENGEEX
- S > C [0x25] SID_PING
- C > S [0x25] SID_PING (optional)
- S > C [0x06] SID_STARTVERSIONING
- C > S [0x07] SID_REPORTVERSION
- S > C [0x07] SID_REPORTVERSION
- Client waits for user to enter account information (standard logon shown):
- C > S [0x14] SID_UDPPINGRESPONSE (optional)
- Client then enters chat.
Enter Chat Sequence (pre-Diablo II)
- C > S [0x0A] SID_ENTERCHAT
- C > S [0x0B] SID_GETCHANNELLIST
- C > S [0x0C] SID_JOINCHANNEL (First Join)
- S > C [0x0A] SID_ENTERCHAT
- S > C [0x0B] SID_GETCHANNELLIST
- S > C [0x0F] SID_CHATEVENT
- A sequence of chat events for entering chat follow.