extract_packageHow to REA Packaged Applications: PyInstaller CArchive, Godot PCK & Node SEA
Unpack single-executable bundled applications statically: carve PyInstaller CArchive/PYZ archives into clean .pyc bytecode, dump Godot .pck scene assets, and deconstruct Node.js Single-Executable Application (SEA) blobs.
In this official REA guide for Packaged Applications (PyInstaller / Godot / SEA), AI coding agents (Claude Code, Cursor, Windsurf) execute 'rea extract-package ./target_utility.exe --json' to safely extract file layout, symbols, and code logic without launching unverified binaries.
The Problem & Target Artifact
Malware analysis or tool reconstruction: You receive a standalone Windows .exe compiled with PyInstaller or a single Linux binary containing an embedded Node.js or Godot payload. You need the original source scripts without running the binary.
Natural Language Agent Instructions
Copy and paste this prompt directly into your AI coding agent when REA is registered via Model Context Protocol (MCP):
Use REA to extract ./target_utility.exe. Extract the embedded Python bytecode files (.pyc) and identify the primary entrypoint script.Run REA Analysis Command
Execute the following command in your terminal or inspect the MCP JSON-RPC call executed by your agent:
rea extract-package ./target_utility.exe --jsonWhat REA Extracts & Returns
Extracted Package Manifest & Bytecode Files
The verified findings and synthesized clean-room structures generated from this investigation:
# REA CLI Package Extraction
$ rea extract-package ./target_utility.exe --json
{
"carrier": "pyinstaller",
"python_version": "3.11",
"entrypoint": "main.pyc",
"extracted_members": [
{ "name": "main.pyc", "type": "bytecode", "bytes": 8420 },
{ "name": "crypto_helper.pyc", "type": "bytecode", "bytes": 4120 },
{ "name": "pyz_archive", "type": "zipstore", "members_count": 48 }
]
}In-Memory CArchive Footer Parsing & Decompression
PyInstaller appends its bundle payload to the end of a native bootloader executable. REA reads the file backward from the end of the PE/ELF container, searches for the 24-byte CArchive cookie, decodes the table of contents offset, and decompresses zlib streams into valid CPython .pyc files with authentic bytecode magic numbers intact.