Crate ra2_mix

Source
Expand description

§RA2 MIX Library

A Rust library for reading and writing Red Alert 2 MIX archive files. Supports both encrypted and unencrypted MIX formats.

§Features

  • Read and parse MIX files
  • Extract files from MIX archives
  • Support for encrypted MIX files
  • Checksum calculation for filenames
  • File operations (read/write)

§Installation

Add this to your Cargo.toml:

[dependencies]
ra2-mix = "0.0.0"

§Basic Usage

use ra2_mix::{MixPackage,MixError};
use std::path::Path;

fn main() -> Result<(), MixError> {
    // Load a MIX file
    let mix = MixPackage::load(Path::new("example.mix"))?;
    
    // Access files in the MIX archive
    for (filename, data) in mix.files.iter() {
        println!("Found file: {}", filename);
    }
    
    Ok(())
}

§API Documentation

See the full API documentation for detailed usage.

§Examples

Check the examples/ directory for complete usage examples:

  1. basic.rs - Basic MIX file operations
  2. encrypted.rs - Working with encrypted MIX files
  3. extract.rs - Extracting files from MIX archives RA2 MIX file format library

This library provides functionality for reading and writing Red Alert 2 MIX files. It supports both encrypted and unencrypted MIX files, and can extract files from MIX archives.

Structs§

MixDatabase
The reverse of the MIX database
MixPackage
MIX package

Enums§

CncGame
Enum representing different games that use XCC format
Ra2Error
Error type for RA2 MIX file operations

Functions§

decompress
Recursively unpack all mix files in the game directory
extract
Extract single file from the MIX file to a folder
patch
Patch a folder into the MIX file

Type Aliases§

Result
Result type for RA2 MIX file operations