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
<PackageReference Include="Roboto.Dbc.Reader" Version="1.0.0" />
<PackageVersion Include="Roboto.Dbc.Reader" Version="1.0.0" />
<PackageReference Include="Roboto.Dbc.Reader" />
paket add Roboto.Dbc.Reader --version 1.0.0
#r "nuget: Roboto.Dbc.Reader, 1.0.0"
#:package Roboto.Dbc.Reader@1.0.0
#addin nuget:?package=Roboto.Dbc.Reader&version=1.0.0
#tool nuget:?package=Roboto.Dbc.Reader&version=1.0.0
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. TheWDB2/WDB5/WDB6andWDC1–WDC5.db2formats used from Warlords of Draenor onward are not supported; a file whose magic isn'tWDBCraisesInvalidDataException. - 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
.dbdcovers your build,GetOrderedDefinitionsreturns an empty array and you will read rows with no columns rather than get an error — check.Lengthif 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 | Versions 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. |
-
.NETStandard 2.0
- DBDefsLib (>= 1.0.0.22)
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 |