wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
binary.hpp File Reference

The on-disk binary structures of the WDC family of .db2 formats (wowdev.wiki/DB2): WDC1 (Legion 7.3.5), WDC3 (BfA 8.1 . More...

#include <cstdint>
#include <type_traits>
#include <wowlib/formats/common/fourcc.hpp>
Include dependency graph for binary.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wowlib::db::wdc::Wdc1Header
 The 84-byte WDC1 top header. More...
struct  wowlib::db::wdc::Wdc3Header
 The 72-byte WDC3 top header (WDC4 reuses it verbatim; WDC5 prepends Wdc5HeaderPrefix in front of the fields after magic). More...
struct  wowlib::db::wdc::Wdc5HeaderPrefix
 The 132 bytes WDC5 splices between magic and recordCount: a numeric schema version and a zero-padded schema-name string (e.g. More...
struct  wowlib::db::wdc::Wdc3SectionHeader
 The 40-byte per-section header of WDC3/WDC4/WDC5. More...
struct  wowlib::db::wdc::WdcFieldStructure
 The 4-byte fieldStructure entry: (32 - size) / 8 is the field's storage byte width, position its byte offset in a record. More...
struct  wowlib::db::wdc::WdcFieldStorage
 The 24-byte field_storage_info entry: how one column is stored. More...

Namespaces

namespace  wowlib
namespace  wowlib::db
namespace  wowlib::db::wdc

Enumerations

enum  wowlib::db::wdc::WdcFlags : std::uint16_t { wowlib::db::wdc::WdcFlagSparse = 0x01 , wowlib::db::wdc::WdcFlagSecondary = 0x02 , wowlib::db::wdc::WdcFlagNoninlineId = 0x04 }
 WDC header flag bits (shared by the whole family). More...
enum class  wowlib::db::wdc::WdcCompression : std::uint32_t {
  wowlib::db::wdc::None = 0 , wowlib::db::wdc::Bitpacked = 1 , wowlib::db::wdc::CommonData = 2 , wowlib::db::wdc::Pallet = 3 ,
  wowlib::db::wdc::PalletArray = 4 , wowlib::db::wdc::BitpackedSigned = 5
}
 How a column is packed (field_storage_info.storageType). More...

Functions

constexpr bool wowlib::db::wdc::isWdcMagic (std::uint32_t magic)
 Whether magic names a format of the WDC family this codec speaks.

Variables

constexpr std::uint32_t wowlib::db::wdc::Wdc1Magic = formats::fourcc("WDC1", formats::FourCCEndian::Forward)
 The WDC1 magic as memcpy'd off the file front (the bytes "WDC1").
constexpr std::uint32_t wowlib::db::wdc::Wdc3Magic = formats::fourcc("WDC3", formats::FourCCEndian::Forward)
 The WDC3 magic as memcpy'd off the file front (the bytes "WDC3").
constexpr std::uint32_t wowlib::db::wdc::Wdc4Magic = formats::fourcc("WDC4", formats::FourCCEndian::Forward)
 The WDC4 magic as memcpy'd off the file front (the bytes "WDC4").
constexpr std::uint32_t wowlib::db::wdc::Wdc5Magic = formats::fourcc("WDC5", formats::FourCCEndian::Forward)
 The WDC5 magic as memcpy'd off the file front (the bytes "WDC5").

Detailed Description

The on-disk binary structures of the WDC family of .db2 formats (wowdev.wiki/DB2): WDC1 (Legion 7.3.5), WDC3 (BfA 8.1 .

. Dragonflight 10.1), WDC4 (DF 10.1 .. 10.2.5) and WDC5 (10.2.5+). All four share the same column-compression machinery — a field-structure table, a field-storage-info table naming how each column is packed, shared pallet and common-data blocks — and differ in framing:

  • WDC1 is a single implicit section with its own 84-byte header and a trailing block order of its own; string references are relative to the string block start (the pre-WDC2 convention).
  • WDC3/WDC4 share the 72-byte header and 40-byte per-section headers; string references are relative to the referencing field's position (the WDC2+ convention). WDC4 adds per-encrypted-section id lists after the common data and moves the sparse offset-map id list to the section tail.
  • WDC5 is WDC4 with a version number and a 128-byte schema-name string spliced in right after the magic.

DB magics are plain byte sequences read off the file front (fourCc FORWARD), unlike the reversed chunk ids of the world formats.

Definition in file binary.hpp.