A Python library and tools providing easy access to the retdec.com decompilation service through their REST API.
Python Makefile
Latest commit 4f0a40b Jan 28, 2017 @s3rvac Show missed lines in the output from test coverage.
This is needed since coverage.py 4.1. See
http://stackoverflow.com/a/37746141/2580955 for more details.
Permalink
Failed to load latest commit information.
docs Added new parameters to the decompiler tool: --ar-index and --ar-name. Sep 15, 2016
retdec Release version 0.5.1. Sep 24, 2016
scripts Emit "Error:" instead of "error:" when there is an error. Sep 15, 2016
tests Fix tests due to os.path.basename() failures on Python 3.6. Jan 23, 2017
.coveragerc Show missed lines in the output from test coverage. Jan 28, 2017
.gitignore
.travis.yml
CHANGELOG.rst
LICENSE Bump copyright year to 2015-2016. Mar 8, 2016
MANIFEST.in Remove the AUTHORS file. Aug 5, 2016
Makefile Fix PEP8 warnings in setup.py. Mar 14, 2016
README.rst Release version 0.5.1. Sep 24, 2016
setup.py Drop support for Python 3.2. Sep 7, 2016
tox.ini

README.rst

retdec-python

Documentation Status Build Status Code Coverage Status PyPI Version

A Python library and tools providing easy access to the retdec.com decompilation service through their public REST API.

You can either incorporate the library in your own scripts:

from retdec.decompiler import Decompiler

decompiler = Decompiler(api_key='YOUR-API-KEY')
decompilation = decompiler.start_decompilation(input_file='file.exe')
decompilation.wait_until_finished()
decompilation.save_hll_code()

or you can use the provided script for stand-alone decompilations:

$ decompiler -k YOUR-API-KEY file.exe
v23bmYb67R
----------

Waiting for resources (0%)...                    [OK]
Pre-Processing:
  Obtaining file information (5%)...             [OK]
  Unpacking (10%)...                             [OK]
Front-End:
  Initializing (20%)...                          [OK]
[..]
Done (100%)...

Downloading:
 - file.c

Either way, file.c then contains the decompiled C code:

$ cat file.c
//
// This file was generated by the Retargetable Decompiler
// Website: https://retdec.com
// Copyright (c) 2016 Retargetable Decompiler <info@retdec.com>
//

#include <stdio.h>
[..]

Status

The library provides support for the decompilation, fileinfo, and test services. For a more detailed list, see the status page in the documentation.

Requirements

Installation

The recommended way of installing is from Python Package Index (PyPI) with pip:

$ pip install retdec-python

This will install the latest stable version, including all dependencies. You can also install the latest development version directly from GitHub:

$ pip install git+https://github.com/s3rvac/retdec-python

Documentation

The documentation is available on readthedocs.io:

Contact and Support

I will be very glad to get your feedback, pull requests, issues, or just a simple Thanks. Feel free to contact me for any questions you might have!

License

Copyright (c) 2015-2016 Petr Zemek (s3rvac@gmail.com) and contributors.

Distributed under the MIT license. See the LICENSE file for more details.

Access from Other Languages

If you want to access the retdec.com decompilation service from other languages, check out the following projects:

  • retdec-cpp - A library and tools for accessing the service from C++.
  • retdec-sh - Scripts for accessing the service from shell.