enfusion_pak

Crates.ioenfusion_pak
lib.rsenfusion_pak
version0.2.0
created_at2025-09-26 21:18:27.587048+00
updated_at2025-09-28 01:24:29.524127+00
descriptionA library/cli for reading Enfusion game engine `.pak` files.
homepagehttps://landaire.github.io/enfusion_tools
repositoryhttps://github.com/landaire/enfusion_tools
max_upload_size
id1856655
size110,450
Lander Brandt (landaire)

documentation

https://docs.rs/enfusion_pak

README

enfusion_pak

A library for reading Enfusion game engine .pak files.

Usage

For the CLI tool:

$ cargo install --locked enfusion_pak
$ enfusion_pak --help

A library/cli for reading Enfusion game engine `.pak` files.

Usage: enfusion_pak [OPTIONS] <FILE>

Arguments:
  <FILE>  Path to either a single file or a directory containing `.pak` files

Options:
  -l, --long     Print long file information
  -m, --merged   Virtually merge contents of files together so that duplicate directories across multiple `.pak` files are treated as a single filesystem entry
  -h, --help     Print help
  -V, --version  Print version

For the library:

cargo add enfusion_pak

Examples

There is currently one example of how to use this library, provided in examples/dump_file. After cloning the repo you can run it from the root repo directory with:

cargo run --release --example dump_file -- ARMA_DATA_FILES_DIR /scripts/Game/Campaign/

Support

This currently supports PAK files versioned at 0x10003. Currently older versions are not supported (although they wouldn't be difficult to add if needed).

Features

  • sans-io core parser with out-of-the-box support for sync callers. Async wouldn't be too hard to add.
  • VFS support through the vfs crate.
  • Performant file reading operations

PAK Format

The PAK format is somewhat similar to other container file formats like MP4, but does have inter-chunk references.

The main parsing logic can be found in src/parser.rs.

The following diagram describes the general format:

    Chunk format:

┌─────────────────────┬────────────────────┬──────────────────────────────┐
│  4 byte identifier  │  4 byte data len   │  Identifier-specific data... │
└─────────────────────┴────────────────────┴──────────────────────────────┘

                  ┌───────────────────────┐
                  │      Header Chunk     │
                  ├───────────────────────│
                  │                       │
                  │   Additional Chunks   │
                  │                       │
                  │                       │
                  ├───────────────────────│
                  │                       │
                  │      Data Chunk       │
                  │                       │
                  │                       │
                  │                       │
                  │    Casual 1.8GiB      │
               ┌─▶│       of data         │◀─┐
               │  │                       │  │┌───────────┐
               │  │                       │  ││ File Meta │
               │  │                       │  ││has offset │
               │  ├───────────────────────┤  ││ into data │
               │  │      File Chunk       │  ││   chunk   │
               │  │                       │  ││           │
               │  ├───────────┬───────────┤  │└───────────┘
               │  │ File Meta │ File Meta │──┘
               │  ├───────────┼───────────┤
               └──│ File Meta │ File Meta │
                  ├───────────┼───────────┤
                  │ File Meta │ File Meta │
                  └───────────┴───────────┘
Commit count: 0

cargo fmt