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:Ren'Py RPYC

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

Compiled Ren'Py script (.rpyc): the 10-byte magic RENPY RPC2 followed by three 12-byte slot records (slot, start offset, length) and zlib-compressed pickle data, with an MD5 of the source appended at the end; files without the magic are the older single zlib stream.

Layout (version 2)

  • Offset 0: RENPY RPC2 (10 bytes).
  • Then slot records of three u32 (slot number, start offset, compressed length); an all-zero record ends the list. The engine writes three records.
  • Slot data are zlib.compress streams placed after the header. Slot 1 is the pickled (data, statements) tuple before static transforms; slot 2 the same after them (translate nodes and similar).
  • The MD5 digest of the .rpy source plus an engine magic string (_ plus a date, bumped to force recompilation) is appended at the end of the file.

Legacy (version 1)

No magic: the whole file is a single zlib stream of slot 1.

Notes

The pickle uses classes from renpy.ast (Say, Label, Menu, Jump, Python ...) so a decompiler needs the matching engine. Do not unpickle untrusted files outside a sandbox.

See Library:Ren'Py and Format:Ren'Py RPA archive.

Code & repositories

  • https://github.com/renpy/renpy @ 6202e7fb43fd23594ab866af83bf928525a06410 · license: MIT (declared by the contributor; GitHub's detector did not recognize a license file)
    Ren'Py engine source: renpy/loader.py (RPA handlers) and renpy/script.py (rpyc reading and writing) are the format references.
    Tested on: source read, not run: source read only · checked 2026-10-18