mpq-rs
mpq-rs is a pure-Rust implementation of the MoPaQ archive format used in Blizzard titles such as Warcraft III. The crate lets you inspect MPQ archives, extract files, and build new archives without relying on native libraries.
Features
- Reads version 1 MPQ archives (classic Warcraft III maps).
- Extracts files, automatically handling the supported compression schemes.
- Builds new archives with sensible compression defaults.
- Operates on any data source that implements
Read + Seek.
Warning: the crate does not aim to support "protected" maps that intentionally violate the MPQ specification.
Installation
Add the dependency to your Cargo.toml:
[]
= { = "https://github.com/WarRaft/mpq-rs" }
Usage examples
Reading a file from an archive
use File;
use BufReader;
use Archive;
Listing files via (listfile)
use File;
use BufReader;
use Archive;
Creating an archive
use Cursor;
use ;
Test data
Sample Warcraft III maps for experimentation can be found under test-data/maps.
Running tests