Installation and Use
Currently, we support only Windows (7 or later), Linux, and unofficially macOS.Warning: Decompilations of larger binaries (1 MB or more) may require a lot of RAM. When running decompilations, we advise you to limit the maximal virtual memory for processes before decompiling to prevent potential swapping and unresponsiveness. On Linux, you can run e.g. ulimit -Sv 9863168 in your shell to limit the maximal virtual memory to 8 GB.

Windows

Either download and unpack a pre-built package from the following list, or build and install the decompiler by yourself (the process is described below):

Now, you are all set to run the decompiler. To decompile a binary file named test.exe, go into $RETDEC_INSTALL_DIR/bin and run:

./decompile.sh test.exe

For more information, run ./decompile.sh --help.

macOSWarning: macOS build was added based on community feedback and is not directly supported by the RetDec team. We do not guarantee you that these instructions will work for you. If you encounter any problem with your build, submit an issue so the macOS community can help you out.

There are currently no pre-built packages for macOS. You will have to build and install the decompiler by yourself. The process is described below.

After you have built the decompiler, you will need to install the following packages:

ProcessWarning: Currently, RetDec has to be installed into a clean, dedicated directory. Do NOT install it into /usr, /usr/local, etc. because our build system is not yet ready for system-wide installations. So, when running cmake, always set -DCMAKE_INSTALL_PREFIX=<path> to a directory that will be used just by RetDec. For more details, see #12.

Recursively clone the repository (it contains submodules):

git clone --recursive https://github.com/avast-tl/retdec

Linux:

cd retdec

mkdir build && cd build

cmake .. -DCMAKE_INSTALL_PREFIX=<path>

make && make install

Windows:

Open MSBuild command prompt, or any terminal that is configured to run the msbuild command.

cd retdec

mkdir build && cd build

cmake .. -DCMAKE_INSTALL_PREFIX=<path> -G<generator>

msbuild /m /p:Configuration=Release retdec.sln

msbuild /m /p:Configuration=Release INSTALL.vcxproj

Alternatively, you can open retdec.sln generated by cmake in Visual Studio IDE.

-DRETDEC_DOC=ON to build with API documentation (requires Doxygen and Graphviz, disabled by default).

-DRETDEC_TESTS=ON to build with tests, including all the tests in dependency submodules (disabled by default).

-DCMAKE_BUILD_TYPE=Debug to build with debugging information, which is useful during development. By default, the project is built in the Release mode. This has no effect on Windows, but the same thing can be achieved by running msbuild with the /p:Configuration=Debug parameter.

-DCMAKE_PROGRAM_PATH=<path> to use Perl at <path> (probably useful only on Windows).