A Python library and tools providing easy access to the retdec.com decompilation service through their REST API.
retdec-python =============
.. image:: https://readthedocs.org/projects/retdec-python/badge/?version=latest :target: https://retdec-python.readthedocs.io/en/latest/ :alt: Documentation Status
.. image:: https://travis-ci.org/s3rvac/retdec-python.svg :target: https://travis-ci.org/s3rvac/retdec-python :alt: Build Status
.. image:: https://coveralls.io/repos/s3rvac/retdec-python/badge.svg :target: https://coveralls.io/r/s3rvac/retdec-python :alt: Code Coverage Status
.. image:: https://badge.fury.io/py/retdec-python.svg :target: https://pypi.python.org/pypi/retdec-python :alt: PyPI Version
WARNING
The retdec.com <https://retdec.com>_ decompilation service is to be disabled (see the official announcement <https://retdec.com/news/2018-06-07-new-version-3-1/>_). This will render the library and tools in the present repository non-functional. I will keep the repository online in case it is helpful to anyone.
Description
A Python library and tools providing easy access to the retdec.com <https://retdec.com>_ decompilation service through their public REST API <https://retdec.com/api/>_.
You can either incorporate the library in your own scripts:
.. code-block:: python
from retdec.decompiler import Decompiler
decompiler = Decompiler(api_key='YOUR-API-KEY') decompilation = decompiler.startdecompilation(inputfile='file.exe') decompilation.waituntilfinished() decompilation.savehllcode()
or you can use the provided script for stand-alone decompilations:
.. code-block:: text
$ 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:
.. code-block:: text
$ 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
- Python >= 3.4 (CPython or PyPy)
- requests
_ module for making HTTPS calls
_
Installation
The recommended way of installing is from
Python Package Index _ (PyPI) with pip _:
.. code-block:: shell
$ 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:
.. code-block:: shell
$ pip install git+https://github.com/s3rvac/retdec-python
Documentation
The documentation is available on
readthedocs.io _:
latest (master) _
stable (0.5.2) _
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 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-rust _ - A library and tools
for accessing the service from Rust.
retdec-cpp _ - A library and tools
for accessing the service from C++.
retdec-sh