pyREtic

class pyREtic.pyREtic(write_source=True, display_source=False, project_name='default', project_root=None, decompiler='unpyc')[source]

Main pyREtic decompilation functionality Encompasses both a way to walk a series of objects (filesystem or memory) as well as the way in which the bytecode is obtained (via unmarshalling or importing)

blind_mirror(orig_module, debug=False)[source]

Mirror all the attributes of the module we are masquearding as so that we can be called as that module would be from other areas of the code and expected functionality is maintained

IN:
orig_module - the name of the module we are masquearding as - string
OUT:
True/False - success or failure - boolean
fs_objwalk(fs_root, depth=None)[source]

Walk the filesystem from start directory indicated & to the depth indicated

For each object and traverse into children and decompile - no unmarshaling

No access to unmarshaling required

fs_unmarshal(fs_root, depth=None)[source]

Walk the filesystem from start directory indicated & to a depth inidicated

The unmarshal technique will be used on each .pyc/.pyo found

get_dump_dir()[source]

Get where the source code dump is

get_project()[source]

Get the current project name

get_project_mod_dir()[source]

Get the directory for the project specific modules

get_projectdir()[source]

Get the directory for the project

get_projectroot()[source]

Get current project root

init_project(py_ver)[source]

Setup the initial project structure on the filesystem

Return False on error & True on successful creation of new project dirs

mem_objwalk(obj)[source]

Pure in-memory decompile.

Start at the specified object and traverse into children and decompile

No file system access, marshal access or bytecode access required

new_project(name, py_version=None)[source]

Create a new project, setting the version of python it is for to the version supplied

normalise_path(path)[source]

Try and expand environment variables and ‘~’ etc that are in paths

Return:
expanded path - string
restore_previous_project_structure()[source]

If there was a problem creating the new project structure restore the previous values

set_projectroot(location)[source]

Set the root filesystem location for ALL projects, create on the filesystem if needed Calls set_projectdir to reassign & create the projectdir/dumps dirs etc

switch_project(name, set_env=True)[source]

Set variable for the location of the project directory & call init_project to initialise the whole project filesystem structure

Previous topic

Welcome to pyREtic’s documentation!

Next topic

REpdb

This Page