BNETDocs: Redux is no longer updated, this subdomain exists for archival purposes only. Visit the main site.


Generate Code: All packets

Packet Information

Message ID:0x3E
Direction:Server -> Client (Received)
Used By:Diablo II, Diablo
Format:(DWORD) MCP Cookie
(DWORD) MCP Status
(DWORD) [2] MCP Chunk 1
(DWORD) Port
(DWORD) [12] MCP Chunk 2
(STRING) unique name
Remarks:This packet supplies the data necessary to connect to an MCP server. The cookie value is defined in the first DWORD of SID_LOGONREALMEX and is simply returned by If the length of the message (not including header) is greater than 8, the client should continue to logon to the MCP. Otherwise, the Status field is interpreted as an error code:

0x80000001: Realm is unavailable
0x80000002: Realm logon failed

Any other value indicates failure.

The first part of the MCP Chunk that must be sent to the MCP server includes the Status and Cookie DWORDS, making MCP Chunk 1 the first 4 DWORDS of the packet.

There used to be a WORD at the end of this packet, which was apparently random.
Related:[0x3E] SID_LOGONREALMEX (C->S), [0x01] MCP_STARTUP (C->S)

User Comments

For detailed questions and discussion, visit the Research Forum

Sep 15, 2007
06:16 PM

Credit goes to l2k-Shadow for the following information:

To get the port # from the port DWORD, use the ntohs function.

Example code in C++:


#pragma comment(lib, "ws2_32")

void main()
char s[] = "\x17\xe0\x00\x00";
DWORD d = 0;
memcpy(&d, s, 4);
cout << ntohs(d) << endl;

Credits goes to for VB conversion:

Public Declare Function ntohs Lib "ws2_32" (ByVal netshort As Long) As Long

' Get the port
Port = ntohs(r.GetInt32())

Sep 10, 2008
04:09 AM

Diablo 2 realms went down the morning of 9/7/08, and when they came back up, this packet had changed, breaking a few clientless bots.

The (WORD) Unknown from this packet HAS been removed entirely.

Sep 11, 2008
11:09 PM

Hmm, strange. Guess we'll never know what it was.

Sep 14, 2008
02:41 AM

How to get the port # from DWORD with Python:
socket.ntohs(struct.unpack("< i", "\x17\xe0\x00\x00")[0])

How to convert port to DWORD with Python:
struct.pack("< i", socket.htons(6112))

Remove the space between < and i, these docs dont parse code comments well.

How to get the IP from DWORD with Python:

How to convert IP to DWORD with Python:

Remove the extra quotation marks, these docs dont parse code comments well.

We recommend you use Firefox to view this site. This site has been optimized for Firefox.

Get Firefox
BNLS Server Status

= Online       = Offline Server Status v1 v2




= Online       = Offline


Site scripts and design copyrights reserved to Don Cullen.
Contents copyrighted to Blizzard and their parent corporation, Vivendi.
Main credits for contents goes to Arta. View the rest of credits.
Demented Minds copyrights reserved to Don Cullen 2003-present.
Copyright infringements will be prosecuted to the fullest extent allowable by law.
Please view our legal disclaimer and terms of service.