Skip to content

sublimnl/gpak_extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPAK Extractor

C++ library and CLI tool for extracting GPAK archive files used by games built with the Godot-derived engine.

Extraction only — no packing.

Building

# Linux
make

# Windows (cross-compile with MinGW)
make TARGET=windows

Requires C++17. Builds are output to build/linux/ or build/windows/.

Usage

gpak-extract [options] <file.gpak>

Options:
  -o, --output <dir>  Output directory (default: <name>_extracted)
  -h, --help          Show this help message

Library

libgpak.a can be linked into other programs. See include/gpak/gpak.hpp for the API.

gpak::Archive archive("resources.gpak");

// Extract everything
archive.extract_all("output_dir");

// Or read a single entry into memory
std::vector<uint8_t> data = archive.read_entry(0);

GPAK Format

GPAK files consist of a header followed by raw file data. All integers are little-endian.

Header:

Field Type Description
entry_count int32 Number of entries in the archive

Followed by entry_count entries:

Field Type Description
path_length int16 Length of the path string in bytes
path bytes UTF-8 encoded file path (path_length bytes)
data_length int32 Size of this entry's data in bytes

Data:

Raw file data starts immediately after the last header entry, stored sequentially with no padding.

[int32]  entry_count
For each entry:
  [int16]  path_length
  [bytes]  path (path_length bytes, UTF-8)
  [int32]  data_length
[bytes]  data for entry 0  (data_length_0 bytes)
[bytes]  data for entry 1  (data_length_1 bytes)
...

License

MIT

About

C++ library and CLI tool for unpacking .gpak resource files used by The End is Nigh and Mewgenics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors