Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Godot PCK

From ReverseEngineering.wiki
Format
Versions pack format 0-4
Magic 47 44 50 43 ("GDPC", uint32 0x43504447)
Extensions .pck, .exe with embedded pack, .apk
Endianness little endian
On this wiki Facts · Code · Notes · Topics

Resource pack of the Godot engine (.pck, or appended to the game executable): magic GDPC (47 44 50 43), a pack format version (0 to 4), the engine version that wrote it, flags, a directory of paths with offset, size and MD5, and the file data. Embedded packs are found by the trailer or by a pck section in PE/ELF.

Overview

Godot exports resources into a .pck next to the executable, or embeds it. Everything under res:// (scenes, scripts .gd/.gdc/.gde, imported resources) is stored in it, optionally AES-256 encrypted. gdsdecomp (GDRETools, MIT) reads, creates and patches PCKs and recovers projects; its PCK code is utility/gdre_packed_source.cpp (reader) and utility/pck_creator.cpp (writer).

Header (little endian)

Field Notes
magic uint32 0x43504447, bytes 47 44 50 43 ("GDPC")
pack format version 0 to 4; gdsdecomp refuses a larger value
engine major, minor, patch uint32 each; patch was 0 before Godot 3.2
flags (version 2+) uint32; bit 0 directory encrypted, bit 1 relative file base, bit 2 sparse bundle (values read in Godot's core/io/file_access_pack.h: PACK_DIR_ENCRYPTED, PACK_REL_FILEBASE, PACK_SPARSE_BUNDLE; per-file bit 2 is the delta flag). The Godot master reader accepts only pack versions 2, 3 and 4 and fails with 'Pack version unsupported' otherwise; it also refuses packs whose engine major.minor is newer than its own. See also Format:Godot binary resource, Format:Godot compressed texture and Format:GDScript binary tokens for the files inside a pack.
file base (version 2+) uint64, added to every file offset (relative to the pack start in versions 3 and 4)
directory offset (version 3+) uint64, relative to the start of the pack; the directory sits after the file data
16 reserved uint32 written by gdsdecomp's creator for every version; versions 0-2 have the directory right after them
version 4: salt 32 bytes, when directory encrypted and sparse bundle are set

Directory: uint32 file count, then per file a uint32 path length (padded to a multiple of 4), the path (res://... before Godot 4.4, a plain relative path from 4.4 on, per pck_creator.cpp), uint64 offset, uint64 size, 16-byte MD5, and from version 2 a uint32 file flags (bit 0 encrypted, bit 1 removal marker; patch packs also have a delta flag). Versions 0 and 1 store offsets that include the header size.

The pack format version depends on the engine release that exported the game; read the field and the engine version fields of your own file.

Embedded packs

  • PE and ELF executables get a section named pck; gdsdecomp finds it, and if absent searches for the trailer.
  • Trailer (pck_creator.cpp): the pack is followed by a GDPC magic, padding to a multiple of 8, a uint64 pack size and a final GDPC magic; the pack starts at end - 12 - size. The embedded pack starts at a multiple of 8.
  • Section headers: after embedding, gdsdecomp patches the PE section header (virtual size, raw size, raw offset) or the ELF section offset and size.

Encryption

If the directory-encrypted flag or a file flag is set, the data is AES-256 encrypted with a 32-byte key set when the project was exported (64 hex characters; gdsdecomp's --key option). The mode is AES-256 CFB (core/io/file_access_encrypted.cpp calls CryptoCore::decrypt_cfb); an encrypted blob is a 16-byte MD5, u64 length, 16-byte IV and the data, with a u32 magic in front for files but not for the pack directory. The key is compiled into the export template. gdsdecomp prints Can't open encrypted files in PCK! when the key is wrong.

GDScript bytecode

Compiled scripts (.gdc, .gde encrypted) carry a bytecode version; the table in gdsdecomp's BYTECODE_HISTORY.md maps releases: 1.0.0 version 3, 1.1.0 version 4, 2.0.0 to 2.1.x version 10, 3.0.x version 12, 3.1 to 3.5 version 13, 4.3 version 100, 4.5 version 101 (rows for the releases in between are in the file).

See Library:Godot Engine.

Code & repositories

  • https://github.com/GDRETools/gdsdecomp @ e2780fcc73ab14083967d3945e513d1f6af1dbd0 · license: MIT
    Godot reverse engineering tools: PCK extract/create/patch and project recovery. Useful without running: utility/gdre_packed_source.cpp (PCK reader), utility/pck_creator.cpp (PCK writer), BYTECODE_HISTORY.md (GDScript bytecode versions).
    Tested on: source read, not run: source read, not run: read the PCK reader and writer and the bytecode table; not built · checked 2026-10-18; last activity 2026-10-14; Note: the latest release ships binaries; the wiki links only the source, never the binaries
  • https://github.com/godotengine/godot @ 81ab961f91066a63bcbf3ec340962bb1a1ada558 · license: MIT
    Godot engine source (MIT). Useful without building: core/io/file_access_pack.cpp (PCK reader), core/io/resource_format_binary.cpp (RSRC), core/io/file_access_compressed.cpp (RSCC), core/io/file_access_encrypted.cpp, scene/resources/compressed_texture.cpp (GST2/GSTL), modules/gdscript/gdscript_tokenizer_buffer.cpp (GDSC).
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-18; Note: the latest release ships binaries; the wiki links only the source, never the binaries