Skip to main content

A tool to decrypt .rpyc files

Project description

rpycdec

A tools for decompiling and translating Ren'py compiled script files (.rpyc and .rpymc).

How it works

All rpyc files are compiled from rpy files, renpy SDK read every file and parse it to AST object(renpy), and then use pickle to serialize the AST to rpyc file. So we use pickle to deserialize the rpyc file to AST, and then restore the rpy file from AST.

We created a fake "renpy" package(unlikely unrpyc) and it's ast objects to make the pickle can be deserialized correctly. Another reason to create a fake "renpy" package is that we can separate code generate logic (the get_code(...) function) to each AST object, it will be easier to future maintain and for multi-version renpy support.

The most difficult part is generating the rpy file from AST. Different renpy version has different AST structure also different grammar.

Install

Install with pip:

pip install rpycdec

Or install from source:

git clone https://github.com/cnfatal/rpycdec.git
cd rpycdec
pip install .

Usage

Decompile a file:

rpycdec <path to rpyc file or dir>

Library usage

from rpycdec import decompile, translate

# decompile a file
decompile(input_file, output_file)

# decompile and translate a file
translate(input_file, output_file)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

FAQ

  • Q: It always raise pickle import ** \nModuleNotFoundError: No module named '***' error.

    A: It's because the our fake packages("renpy","store") is not contains the object you want to decompile. Please open an issue and tell us the renpy version and the rpyc file you want to decompile. Join our telegram group to get help also be better.

Community

Welcome to join our community to discuss and get help.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpycdec-0.1.5.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

rpycdec-0.1.5-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file rpycdec-0.1.5.tar.gz.

File metadata

  • Download URL: rpycdec-0.1.5.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rpycdec-0.1.5.tar.gz
Algorithm Hash digest
SHA256 62015d7961748c315313082cf5a943a2c99afed37ad060d5ffa10d8631b65d4c
MD5 5116a39d0f325540bfc7de4becadeb66
BLAKE2b-256 dcf9bb55b82355e2ee5f1fb29e81667dc2d2670fdcbccdb064a957eed99d9367

See more details on using hashes here.

File details

Details for the file rpycdec-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: rpycdec-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rpycdec-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f7e2504ab434cfa0444875d5196d3c6b5880ebba49a50ab2721febe76f790f6e
MD5 95c0a3a5c7c14fcfd98dc95792ea8098
BLAKE2b-256 afe3acab9764fb342fb5c19c2d23d07021f418eb38856f7a18af612babc63ecd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page