NGDP - d07RiV/blizzget GitHub Wiki

NGDP (Next Generation Download Protocol) is a new content distribution system introduced together with CASC.

Supported games

The system provides configuration and data files for all recent Blizzard games, including the following (from wowdev Wiki):

Code Description
agent Battle.net Agent
bna Battle.net App
bnt Heroes of the Storm Alpha (Deprecated)
d3 Diablo 3 Retail
d3cn Diablo 3 China
d3t Diablo 3 Test
demo ? (Partial)
hero Heroes of the Storm Retail
herot Heroes of the Storm Test
hsb Hearthstone
pro Overwatch Retail
prodev Overwatch Dev
sc2 StarCraft II (Partial)
s2 StarCraft II
s2t StarCraft II Test (Partial)
s2b StarCraft II Beta
test ? (Partial)
storm Heroes of the Storm (Deprecated)
war3 Warcraft III (Partial)
wow World of Warcraft Retail
wowt World of Warcraft Test
wow_beta World of Warcraft Beta

Global configuration

Global configuration files can be obtained from the following URLs (where ProgramCode is a value from the above table):

Configuration table format

All global configuration files share the same table format. Here is an example of a /cdns file:

Name!STRING:0|Path!STRING:0|Hosts!STRING:0
us|tpr/d3|blzddist1-a.akamaihd.net blzddist2-a.akamaihd.net
eu|tpr/d3|blzddist1-a.akamaihd.net blzddist2-a.akamaihd.net
kr|tpr/d3|blzddistkr1-a.akamaihd.net blizzard.nefficient.co.kr blzddist1-a.akamaihd.net
tw|tpr/d3|blzddist1-a.akamaihd.net blzddist2-a.akamaihd.net
cn|tpr/d3|client01.pdl.wow.battlenet.com.cn client02.pdl.wow.battlenet.com.cn client03.pdl.wow.battlenet.com.cn client04.pdl.wow.battlenet.com.cn blzddist1-a.akamaihd.net

The first line describes the column names and formats, and can be ignored as it is always the same for a given file. The rest of the lines cointain table data, separated by vertical bars.

CDNS table

/cdns file (example above) lists available domains per region, and the download paths for the rest of configuration files and data. All files are accessed by a 16-byte MD5 hash, formatted as a 32-character hex string. The download URLs are formatted as follows:

http://*host*/*path*/*type*/*first-byte*/*second-byte*/*full-hash*

Where host and path are taken from the /cdns table, and first-byte and second-byte repeat the first two and second two characters of the hash string.

Known types include:

  • config - contains build config, CDN config and patch config files
  • data - contains game data files; smaller files are bundled together in archives
  • patch - contains patch data

An example URL:

http://blzddist1-a.akamaihd.net/tpr/d3/data/5a/6b/5a6b94ec102ce72e917f7284232ba6bb

Archive files also come with an index file, obtained by appending .index to the URL. See the Data archives section for details.

Versions table

The /versions table contains the current build config and CDN config hashes per region, along with build ID and version strings. An example file (http://us.patch.battle.net:1119/d3t/versions):

Region!STRING:0|BuildConfig!HEX:16|CDNConfig!HEX:16|BuildId!DEC:4|VersionsName!String:0
us|e583b35f5a4de27d3b35cf484b439ee7|2505e067a5ef12d869fcaf406e5e6360|35056|2.4.0.35056
xx|e583b35f5a4de27d3b35cf484b439ee7|2505e067a5ef12d869fcaf406e5e6360|35056|2.4.0.35056
eu|e583b35f5a4de27d3b35cf484b439ee7|2505e067a5ef12d869fcaf406e5e6360|35056|2.4.0.35056
kr|e583b35f5a4de27d3b35cf484b439ee7|2505e067a5ef12d869fcaf406e5e6360|35056|2.4.0.35056
cn|e583b35f5a4de27d3b35cf484b439ee7|2505e067a5ef12d869fcaf406e5e6360|35056|2.4.0.35056
tw|e583b35f5a4de27d3b35cf484b439ee7|2505e067a5ef12d869fcaf406e5e6360|35056|2.4.0.35056

The two hash strings can be used in the config URL described in the previous section to obtain the CDN and build config files.

Config file format

cdn-config, build-config and patch-config files all follow a similar plain text format, described in the following sections.

CDN config

Here is a sample cdn-config file:

# CDN Configuration

archives = 01d7d7a9521d7c2b5967956e222f9574 020efa2db06256f66745e256c06838c7 031257b98ca9541724a8a0db5f82be0e 0641814e4e408af39ab4fd978b34c7cc 07bcfe50e5eee70259b03305eff64674 (... truncated)
archive-group = 2733101a7cba6700622e6577f02973c3
patch-archives = 0971385dd158b7042e035b2ba1eff726 0b8de0764a11cae2d7c8fc97e0e969d2 0f608f2cdc323881b1ca1dd74cc62108 1315d52a7760321139359b88cd732862 13a32e79d5207274a73355c87465d9c3 (... truncated)
patch-archive-group = 6e9fd3a2223eadac8f08a908a7f431b7
builds = af3638124f30c66fa023535687a7467e 71b3a5c01ae99a901d4ec481c614f405 1c353144a9669cf679dd89fe55a69c14 a90149335cb0b07c267ed0db30eea6b4 116eded6425fe0fdb77273a72e7c967e (... truncated)

builds line lists the build-config hashes for game builds available for download. The current build should be somewhere among these values, but it will also often contain unreleased builds available for download.

archives line lists the archive hashes containing bundled small files (usually under 2MB) - see the Data archives section. archive-group is supposed to be the hash for a combined archive index file, but it doesn't seem to work anymore - apparently one has to download all the archive index files individually.

patch-archives and patch-archive-group are the same hashes for patch data.

Build config

A sample build-config file:

# Build Configuration

root = 6b33ad763eaa584e5ec58d8ed14b22e5
download = 7003599b393ed655d2a6ad3a6ba9b316
install = 60a2c130895abd7ee6599c59c62bb88b
encoding = b413a998fe69c032eebc03b3a434a07d 1dd1cf5ae8b9fd3f6c14ad12bc8406a6
encoding-size = 38386464 38386624
build-branch = 2_4_1
build-comments = Full PC Public Build - 2_4_1 PTR (RC1)
build-creator = jahughes
build-name = 35989_Win32_2_4_1_ptr
build-playbuild-installer = ngdptool_casc2
build-product = Diablo3
build-uid = d3t
patch = 77f5e97ddfd322d04611c4512330fe8b
patch-size = 41861519
patch-config = 6e2f2d7e0fc0baa700a87aa40571f49e

This file contains the general build information, along with hashes used for obtaining patch or full build files.

All data files are addressed by two hashes - a content hash (MD5 of the uncompressed file), and a CDN hash (MD5 of some header, perhaps). The CDN hash is used to download files from the CDN (and is listed in archive indices for smaller files), and address files in the /data folder of the local CASC storage. Content hash can be converted to CDN hash by using the [Encoding](Encoding file) file.

Build configuration lists the content hashes for four special files in the archive - the [root](Root file), [download](Download file), [install](Install file) and [encoding](Encoding file). It also lists the CDN hash for the encoding file, since it cannot be obtained otherwise. The rest of the CDN hashes can only be obtained after downloading and decoding the encoding file.

The encoding-size field lists the size for uncompressed and compressed encoding file (yes, the uncompressed file is actually smaller most of the time, because only one small portion of it is actually compressed).

Data files

All files from the /data URLs (except .index files) are encoded in [BLTE](BLTE Containers) containers. Key files and most larger files can be downloaded individually, while most smaller files can only be downloaded as part of an archive file.

Data archives

Files below 2MB are typically packaged in archive files. archives field in CDN config contains the list of available archives.

Each archive consists of two files - the data file (downloaded from a regular data URL), and the index file (obtained by appending .index to the data file URL). The data file is simply a bunch of individual file BLTE containers concatenated together, forming a large file (up to 256MB).

The index file consists of zero-padded 4096 byte blocks, each filled with IndexEntries of 24 bytes each. After the last block there can be some additional data of unknown format (possibly some checksums?). One should stop parsing the file after the first incomplete block, to avoid confusing the additional data with further index entries.

  • IndexEntry (24 bytes)
Offset Type Name Description
0x00 char[16] Hash CDN hash of the file
0x10 uint32 [BE] Size Compressed size of the file
0x14 uint32 [BE] Offset File position inside the archive