tact-parser
Parser for TACT (Trusted Application Content Transfer) file formats used in Blizzard's NGDP distribution system.
Installation
Add this to your Cargo.toml
:
[]
= "0.4"
Overview
This crate provides parsers for various TACT file formats used by Blizzard's content delivery network:
- Encoding Files - Maps content keys (CKey) to encoded keys (EKey)
- Install Manifests - Lists files for installation with tag-based filtering
- Download Manifests - Defines download priorities and file grouping
- Size Files - Tracks file sizes for installation planning
- Build Configurations - Key-value format for build metadata
- WoW Root Files - Maps file IDs to content hashes
- TVFS (TACT Virtual File System) - Virtual filesystem structure
- ESpec Parser - Encoding specification parser for BLTE compression modes
Features
Implemented Parsers
-
✅ Encoding Table (
encoding.rs
)- CKey ↔ EKey bidirectional mapping
- Page-based structure with checksums
- Support for multiple encoding formats
-
✅ Install Manifest (
install.rs
)- Tag-based file filtering
- File metadata (name, MD5, size)
- Efficient tag matching
-
✅ Download Manifest (
download.rs
)- Priority-based download ordering
- File grouping for batch operations
- Size tracking for bandwidth planning
-
✅ Size Files (
size.rs
)- Installed and download size tracking
- File count statistics
- Installation planning support
-
✅ Build Config (
config.rs
)- Key-value configuration parsing
- Support for multi-value keys
- Build metadata extraction
-
✅ WoW Root (
wow_root.rs
)- File ID to content hash mapping
- Locale and content flag support
- Efficient lookup structures
-
✅ TVFS (
tvfs.rs
)- Virtual filesystem parsing with specification compliance
- Big-endian 40-bit integer support for modern game builds
- Directory structure recreation and file attribute support
-
✅ ESpec Parser (
espec.rs
)- Complete EBNF grammar implementation for BLTE compression
- Support for all modes: None, ZLib, Encrypted, BlockTable, BCPack, GDeflate
- Complex block specifications with size expressions (K/M units, multipliers)
- Integration with BLTE decompression system
Utility Features
- Enhanced 40-bit Integer Support - Complete big/little-endian implementation
- Standard 40-bit integers and TACT encoding format (1 byte + 4-byte BE u32)
- Support for file sizes up to 1TB with proper endianness handling
- Variable-length Integer Parsing - Efficient varint implementation
- Jenkins Hash - TACT's hash algorithm implementation
- Compression Support - Integration with BLTE decompression
Usage Examples
Parse Encoding File
use EncodingFile;
let data = read?;
let encoding = parse?;
// Look up EKey for a given CKey
if let Some = encoding.get_ekey
Parse Install Manifest
use InstallFile;
let data = read?;
let install = parse?;
// Filter files by tags
let files = install.filter_files;
for file in files
Parse ESpec Compression Specification
use ESpec;
// Parse a complex block table specification
let spec = parse?;
// Check compression properties
println!;
println!;
// Convert back to string format
println!;
Parse Build Configuration
use parse_build_config;
let data = read_to_string?;
let config = parse_build_config?;
// Access configuration values
if let Some = config.get
Performance
The parsers are optimized for:
- Memory efficiency with streaming where possible
- Fast lookups using appropriate data structures
- Minimal allocations during parsing
- Support for large files (GB+ encoding tables)
Integration
This crate integrates with other cascette-rs components:
- Uses
blte
for decompression - Works with
ngdp-crypto
for encrypted content - Compatible with
ngdp-cdn
for downloading files - Used by
ngdp-client
for CLI operations
License
This project is dual-licensed under either:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.