C++ library and CLI tool for extracting GPAK archive files used by games built with the Godot-derived engine.
Extraction only — no packing.
# Linux
make
# Windows (cross-compile with MinGW)
make TARGET=windowsRequires C++17. Builds are output to build/linux/ or build/windows/.
gpak-extract [options] <file.gpak>
Options:
-o, --output <dir> Output directory (default: <name>_extracted)
-h, --help Show this help message
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 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)
...