Skip to main content

casc_lib/
lib.rs

1//! Pure Rust library for reading Blizzard CASC (Content Addressable Storage Container) archives.
2//!
3//! CASC is the file storage format used by World of Warcraft (and other Blizzard titles) to
4//! bundle game data on disk. This crate provides the building blocks to open a local CASC
5//! installation, resolve file identifiers, and extract raw file content.
6//!
7//! # Architecture
8//!
9//! The extraction pipeline follows this path:
10//!
11//! 1. **Config** - parse `.build.info`, build config, and CDN config to discover keys and paths.
12//! 2. **Storage** - open `data.NNN` archives and their `.idx` index files.
13//! 3. **Encoding** - load the encoding file that maps content keys (CKeys) to encoding keys (EKeys).
14//! 4. **Root** - load the root file that maps file data IDs (FDIDs) to CKeys.
15//! 5. **BLTE** - decode the BLTE container (decompress, decrypt) to get raw file bytes.
16//!
17//! # Quick Start
18//!
19//! ```no_run
20//! use casc_lib::extract::pipeline::{CascStorage, OpenConfig};
21//! use casc_lib::root::flags::LocaleFlags;
22//!
23//! let config = OpenConfig {
24//!     install_dir: "E:\\World of Warcraft".into(),
25//!     product: None,
26//!     keyfile: None,
27//!     listfile: None,
28//!     output_dir: None,
29//! };
30//! let storage = CascStorage::open(&config)?;
31//! let data = storage.read_by_fdid(136235, LocaleFlags::EN_US)?;
32//! # Ok::<(), casc_lib::error::CascError>(())
33//! ```
34
35/// BLTE (Binary Large Table Entry) container decoding, compression, and encryption.
36pub mod blte;
37/// CASC configuration file parsers (`.build.info`, build config, CDN config).
38pub mod config;
39/// Encoding file parser - maps content keys (CKeys) to encoding keys (EKeys).
40pub mod encoding;
41/// Error types and the crate-wide [`Result`](error::Result) alias.
42pub mod error;
43/// High-level extraction pipeline for opening CASC storage and reading files.
44pub mod extract;
45/// Community listfile download and parsing (FDID to filename mapping).
46pub mod listfile;
47/// Root file parser - maps file data IDs (FDIDs) to content keys (CKeys).
48pub mod root;
49/// Low-level data archive and index file access.
50pub mod storage;
51/// Shared I/O and hashing utilities.
52pub mod util;