DBCTool is a command-line utility for working with World of Warcraft
DBC files.
It lets you inspect, import, and export DBCs to/from a MySQL database
using flexible JSON meta definitions.
- Read DBC files: inspect records and headers directly from the binary file.
- Rebuild DBCs: output cleaned or modified versions of a DBC.
- Import: load DBC files into MySQL tables (schema is generated from metadata).
- Export: rebuild DBC files from MySQL tables, preserving field definitions.
- Configurable: paths and database connection are set via a simple
config.json.
Clone the repository and build with Go:
git clone https://github.com/foereaper/dbctool.git --recurse
cd dbctool
go build -C src -o dbctoolYou need Go 1.20+ and access to a MySQL server.
When run for the first time, DBCTool will generate a template
config.json:
{
"dbc": {
"user": "root",
"password": "password",
"host": "127.0.0.1",
"port": "3306",
"name": "dbc"
},
"paths": {
"base": "../dbc_files",
"export": "../dbc_export",
"meta": "../meta"
}
"options": {
"use_versioning": false
}
}- dbc: database connection details.
- paths.base: directory containing original DBC files.
- paths.export: output folder for rebuilt/exported DBCs.
- paths.meta: directory with
*.meta.jsonfiles describing each DBC's schema. - options.use_versioning: determines whether or not export uses the built in versioning checksum. If enabled, only tables determined to have data changes will be exported. Otherwise all DBCs will be exported.
General syntax:
dbctool <command> [options]-
read --- Read a DBC file and optionally rebuild it
dbctool read --name=Spell --record=5 --outOptions:
--name, -n: DBC file name without extension (required).--record, -r: record index to display.--out, -o: rebuild and write the DBC to export directory.
-
header --- Show header info of a DBC
dbctool header --name=Spell
Options:
--name, -n: DBC file name without extension (required).
-
import --- Import all DBCs into the database
dbctool import
Options:
--name, -n: DBC file name without extension (optional), imports only this DBC.
-
export --- Export all tables back into DBC files
dbctool exportOptions:
--name, -n: DBC file name without extension (optional), exports only this DBC.--force, -f: Force export even if versioning is enabled (overrides the use_versioning option).
-
verify --- Compare exported DBC files against originals
dbctool verify
Options:
--name, -n: DBC file name without extension (optional), verifies only this DBC.
--config=path/to/config.json: override path to config file.
Can be placed before or after the subcommand.
Each DBC requires a corresponding *.meta.json file in the meta
directory.
These describe field types, primary/unique keys, and sort order.
Example:
{
"file": "DBCName.dbc",
"primaryKeys": ["ID"],
"uniqueKeys": [["ID"]],
"sortOrder": [{ "name": "ID", "direction": "ASC" }],
"fields": [
{ "name": "ID", "type": "int32" },
{ "name": "Name", "type": "string" },
{ "name": "Description", "type": "Loc" }
]
}MIT License Β© 2025 --- [DBCTool]