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.

Usage

Install with pip:

pip install rpycdec

or install from source after clone this repo:

pip install .

Decompile a file or directory:

rpycdec [--force] <path to rpyc file or dir>

Decompile and translate a file or directory:

rpycdec --translate <path to rpyc file or dir>

Library usage

import rpycdec

rpycdec.decompile(filename)

Development

Use pipenv to manage dependencies:

pipenv install --dev

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.4.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

rpycdec-0.1.4-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rpycdec-0.1.4.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for rpycdec-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9a286e68cc83bb8a164a940c7bd24f4a92b60faeb0de31dc11da756a743fff56
MD5 7cd17115c4ce25b53ff55754fd449085
BLAKE2b-256 de19c819e9bdb2c8394d9b11fcc1090f77e2cca9f26a6b21c6b44a22b530bc76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rpycdec-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for rpycdec-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0f22018d13eb5d0ffeb1e8e6a890ec1d2dcd03899ecad3463820d07309f27cc3
MD5 db84d1350d76236159d19450d7c0665a
BLAKE2b-256 b390ec3b35aedc21735ec9120f00ff4070ca04be19d39d225be4ad5c894245bc

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