History:

Some day in the past:

  • Ralek and Kynox firstly contributed with the auth sequence reversed from wow.

Pastebin documents

The Bit Stream

this example allmost explains how it woks:

example of the 
byte 1: 0x40
byte 2: 0x01

01000000 00000001
taking
 9 bits 01000000 1    result: 0x81
10 bits 01000000 01   result: 0x101
11 bits 01000000 001  result: 0x201

Types

 aligntobb align to byte boundary
 int:x < int of x bits length

Packets Header - before each packet

 int:6 PacketId
 int:1 hasChannel
 if (hasChannel)
	int:4 ChannelId

C->S Battlenet::Client::Authentication::InformationRequest - Cmd 0, Chan 0

 char[4] Program
 char[4] Platform
 char[4] Locale
 int:6 componentCount
 for (componentCount)
 {
         char[4] Program
 	char[4] Platform
 	int:32 Build
 }
 
 int:1 hasAccountName
 if (hasAccountName) {
 	int:9 accountLength. then add 3 to this
 	byte[accountLength] accountName
 }

S->C Battlenet::Client::Authentication::ProofRequest - Cmd 2, Chan 0

int:3 moduleCount
for (moduleCount)
{
 	{ // Battlenet::Cache::Handle
	aligntobb	char[4] "auth"
			char[4] locale
			byte[32] ModuleId
	}
	int:10 blobSize
	byte[blobSize] moduleData
}

C->S Battlenet::Client::Authentication::ProofResponse - Cmd 2, Chan 0

int:3 moduleCount
for (moduleCount)
{
	int:10 blobSize
	byte[blobSize] moduleData
}

S->C Battlenet::Client::Authentication::Complete - Cmd 0 Chan 0

int:1 success
if (success)
{
	int:3 moduleCount
	for (moduleCount)
	{
		{ // Battlenet::Cache::Handle
			char[4] "auth"
			char[4] locale
			byte[32] ModuleId
		}
		int:10 blobSize
		byte[blobSize] moduleData
	}
 
	int:32 pingTimeout. add 2147483648 to this
 
	int:1 hasOptSegment
	if (hasOptSegment)
	{
		int:1 bool
		if (bool)
		{
			// Battlenet::Regulator::LeakyBucketParams
			int:32 Threshold
			int:32 Rate
		}
	}
 
	int:7 accountNameSize
	byte[accountNameSize] accountName - asciistring
	int:64
	int:32	
}
else
{
	int:1 hasOptModule
	if (hasOptModule)
	{
		{ // Battlenet::Cache::Handle
			char[4] "auth"
			char[4] locale
			byte[32] ModuleId
		}
	}
	int:2 failType
	switch (failType)
	{
		case 0:
		case 2:
			break;
		case 1:
			{
				int:16 errorCode
				int:32 unk. must add 2147483648 to this to get real value
			}
	}
}

Modules download

GET /8f/52/90/6a/8f52906a2c85b416a595702251570f96d3522f39237603115f2f1ab24962043c.auth HTTP/1.1
User-Agent: Battle.net Web Client
Host: EUB.depot.battle.net:1119
Accept: */*

HTTP/1.1 200 OK
Server: Apache/2.2.3 (CentOS)
Last-Modified: Sun, 24 Jan 2010 01:41:57 GMT
ETag: "1d4004-10104-47ddf28786340"
Content-Type: text/plain; charset=UTF-8
Content-Length: 65796
Date: Tue, 23 Feb 2010 12:21:55 GMT
X-Varnish: 1658811527
Age: 0
Via: 1.1 varnish
Connection: keep-alive
 
 bnet2_protcol.txt · Last modified: 2018/03/10 22:35 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Driven by DokuWiki