Roboto.Dbc.Reader 1.0.0

dotnet add package Roboto.Dbc.Reader --version 1.0.0
                    
NuGet\Install-Package Roboto.Dbc.Reader -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Roboto.Dbc.Reader" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Roboto.Dbc.Reader" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Roboto.Dbc.Reader" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Roboto.Dbc.Reader --version 1.0.0
                    
#r "nuget: Roboto.Dbc.Reader, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Roboto.Dbc.Reader@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Roboto.Dbc.Reader&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Roboto.Dbc.Reader&version=1.0.0
                    
Install as a Cake Tool

Roboto.Dbc.Reader

Reads World of Warcraft DBC files (DBFilesClient/*.dbc) in C#.

DBC files carry no schema of their own — just a header, fixed-size records and a string block. To interpret a record you supply a .dbd definition file from the community WoWDBDefs project, and this library turns the records into values.

Installation

dotnet add package Roboto.Dbc.Reader
Install-Package Roboto.Dbc.Reader

Targets netstandard2.0, so it works on .NET Framework 4.6.1+, .NET Core, and .NET 5+.

Getting definition files

Download the .dbd files for the tables you need from:

https://github.com/wowdev/WoWDBDefs/tree/master/definitions

Each one lists every column the table has ever had, plus per-build blocks saying which columns exist, in which order, for which client builds.

Usage

using DBDefsLib;
using Roboto.Dbc.Reader;

var definition = new DBDReader().Read(@"Definitions\ChrRaces.dbd");
var reader = new DbcReader(new Build("3.3.5.12340"), DbcLocale.EnUS, @"C:\Games\WoW-3.3.5a\dbc");

// Resolves "<dbcsDirectory>/ChrRaces.dbc"
foreach (Dictionary<string, object> row in reader.ReadAllRowsFromDirectory("ChrRaces", definition))
{
    var id    = (int)row["ID"];
    var name  = (string)row["NameLang"];
    var flags = (int)row["Flags"];

    Console.WriteLine($"{id}: {name} (flags {flags})");
}

Rows are Dictionary<string, object> with an ordinal-ignore-case comparer, so row["namelang"] works too. Column names are converted to PascalCase, so Name_lang in the definition becomes NameLang.

Three sources are available, each accepting either a DBDefinition or a pre-resolved FieldDefinition[]:

reader.ReadAllRowsFromDirectory("Map", definition);        // <dbcsDirectory>/Map.dbc
reader.ReadAllRowsFromFile(@"C:\tmp\Map.dbc", definition);
reader.ReadAllRowsFromStream(stream, definition);          // e.g. straight out of an MPQ/CASC archive

Array columns come back as typed arrays, and you can inspect a resolved schema before reading:

FieldDefinition[] fields = reader.GetOrderedDefinitions(definition);

foreach (var f in fields)
{
    Console.WriteLine($"{f.Name} {f.Type} {f.Size} bits" + (f.ArrayLength is int n ? $" x{n}" : ""));
}

Types and locales

.dbd types map to sbyte/byte, short/ushort, int/uint, long/ulong (from the declared bit size and signedness), float, and string for both string and locstring. Unrecognised types come back as raw byte[]. In a .dbd, <32> is signed and <u32> is unsigned.

Pass a DbcLocale to pick which language a locstring resolves to (EnUS, KoKR, FrFR, DeDE, ZhCN, ZhTW, EsES, EsMX, RuRU, PtPT, ItIT). The on-disk layout is derived from the build you supply: 8 string offsets for Vanilla, 16 for TBC/WotLK, and a single offset from Cataclysm onward — where the client selects a locale directory instead, so the argument is ignored.

Scope and limitations

  • WDBC only. The classic single-table layout (magic WDBC), i.e. Vanilla through roughly Cataclysm. The WDB2/WDB5/WDB6 and WDC1WDC5 .db2 formats used from Warlords of Draenor onward are not supported; a file whose magic isn't WDBC raises InvalidDataException.
  • Reading only. No writer, editor, or serialization back to .dbc.
  • No archive extraction. Supply loose files or streams; MPQ/CASC reading is out of scope.
  • No foreign-key resolution. Relation columns are read as plain integers.
  • The build must match a version block. If no block in the .dbd covers your build, GetOrderedDefinitions returns an empty array and you will read rows with no columns rather than get an error — check .Length if the build is uncertain.
  • Reads are eager. Despite the IEnumerable<> return types, all records are materialized before returning. Fine for DBC-sized tables; not a streaming API.

Want typed classes instead of dictionaries?

Install Roboto.Dbc.Generator instead — it depends on this package, so it brings the reader with it. It reads your .dbd files at compile time and emits a class per table, so the example above becomes:

foreach (ChrRaces race in reader.ReadChrRaces())
{
    Console.WriteLine($"{race.ID}: {race.NameLang} (flags {race.Flags})");
}

It uses this library for all the actual parsing, so the two always agree on types, sizes and field ordering.

Documentation and feedback

Full documentation, including the complete type-mapping and locale tables: https://github.com/r-o-b-o-t-o/dbc#readme

Issues and questions: https://github.com/r-o-b-o-t-o/dbc/issues

Built on DBDefsLib and the definitions maintained by the wowdev community.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Roboto.Dbc.Reader:

Package Downloads
Roboto.Dbc.Generator

A C# source generator library for reading World of Warcraft DBC files with ease and type safety.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 55 7/27/2026