Skip to content

Repository files navigation

DAT3 - Fallout DAT Tool

Fallout .dat management cli.

Crossplatform, static Rust re-implementation of DAT2, with minor differences.

Also supports Arcanum .dat archives.

Usage

dat3

Fallout .dat management cli

Usage: dat3 <COMMAND>

Commands:
  l     List files in a DAT archive (command: l)
  x     Extract files from a DAT archive with directory structure (command: x)
  e     Extract files without creating directories - all files go to one folder (command: e)
  a     Add files to a DAT archive (command: a)
  d     Delete files from a DAT archive (command: d)
  help  Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Extract all files

dat3 x master.dat

Extract all files into directory

dat3 x master.dat -o ./extracted/

Extract specific files

# Can use forward or backward slashes
dat3 x master.dat art/critters/HMMAXX.FRM scripts\generic.int

# Extract with glob pattern (quote to prevent shell expansion)
dat3 x master.dat 'art/critters/*.frm'

Extract without directory structure (flat)

dat3 e master.dat -o ./files/

List files in a DAT archive

# List all files
dat3 l master.dat

# List specific files. Can use forward or backward slashes. Output always shows OS-native slash.
dat3 l master.dat art/critters/vault.frm text\english\quotes.txt

# List with glob pattern (quote to prevent shell expansion)
dat3 l master.dat 'art/critters/*.frm'

# List files from response file
dat3 l master.dat @files_to_list.txt

Response file support

# Create a file listing files to process
echo "art/critters/vault.frm" > files.txt
echo "text\english\quotes.txt" >> files.txt
echo "scripts/generic.int" >> files.txt

# Use with any command (mutually exclusive with explicit file lists)
dat3 l master.dat @files.txt
dat3 x master.dat @files.txt -o extracted/
dat3 e master.dat @files.txt -o flat/
dat3 a master.dat @files.txt
dat3 d master.dat @files.txt

Add files to a DAT archive

# Add single file
dat3 a master.dat myfile.txt

# Add files relative to another directory
dat3 a master.dat -C patch000 file.txt  # patch000/file.txt
Adding: file.txt  # Added to archive root

# Add directory (automatically recursive)
dat3 a master.dat myfolder/

# Add with max compression level
dat3 a master.dat largefile.txt -c 9

# Add to specific directory in archive
dat3 a master.dat myfile.txt -t "art/graphics"

# Choose the format for a new archive (dat1, dat2, arcanum; default dat2)
dat3 a newarchive.dat myfiles/ --format dat1
dat3 a newarchive.dat myfiles/ --format arcanum

# Add files from response file
dat3 a master.dat @files_to_add.txt

Add-path normalization

  • ./ and .\ prefixes are removed before storing paths in the archive
  • absolute source paths have only their filesystem root/prefix stripped
  • the first real directory name is preserved
  • a -C DIR ... resolves add operands inside DIR and stores paths relative to DIR
  • a -C DIR ... rejects ./.. components and paths that resolve outside DIR

Examples:

dat3 a master.dat ./patch000/file.txt
# stores as patch000/file.txt

dat3 a master.dat ./patch000/*
# stores as patch000/...

dat3 a master.dat /tmp/patch000/file.txt
# stores as tmp/patch000/file.txt

Default format via .bgforge.yml

When a creates a new archive and no --format is given, an optional .bgforge.yml in the current directory picks the default:

dat3:
  default_format: arcanum

Supported values: dat1, dat2, arcanum. An unrecognized value prints a warning and dat2 is used. An explicit --format always wins, and existing archives always keep their format.

Delete files from archive

# Delete single file (cross-platform paths supported)
dat3 d master.dat text/english/quotes.txt

# Delete multiple files
dat3 d master.dat file1.txt art\critters\vault.frm

# Delete with glob pattern (quote to prevent shell expansion)
dat3 d master.dat 'art/critters/*.frm'

# Delete files from response file
dat3 d master.dat @files_to_delete.txt

Differences from DAT2

  • Directories are always processed recursively.
  • Shrink (k command) not implemented.
  • Flat extraction is a separate command, e.
  • DAT1 compression (LZSS) not implemented, only decompression. Fallout 1 style .dat files are thus created without compression.
  • Glob patterns (*, ?, [...]) supported for list/extract/delete.

Building

Requirements

  • Rust 1.87 or newer
  • Target-specific toolchains (install as needed)

Build

./build.sh

Builds are static.

Binaries will be at:

target/x86_64-unknown-linux-musl/release/dat3
target/x86_64-pc-windows-gnu/release/dat3.exe
target/i686-pc-windows-gnu/release/dat3.exe

Releases

Contributors

Languages