GitXplorerGitXplorer
s

retdec-sh

public
12 stars
6 forks
0 issues

Commits

List of commits on branch master.
Unverified
217e62bcbbc970e612b8c54ebaacb0afe14cffe2

Add a warning into README concerning the disabling of the retdec.com decompilation service.

ss3rvac committed 7 years ago
Unverified
37c271dbb13bdb752b2b1c10b20acbc1fd3517a4

Add a link to retdec-rust into README.

ss3rvac committed 8 years ago
Unverified
ca1b8d1d23da0867200387eb41810ed620d0165b

Remove the AUTHORS file.

ss3rvac committed 8 years ago
Unverified
189f3b50b1256a50d179510ee860d94dab79a447

Use HTTPS instead of HTTP for the URL to curl.

ss3rvac committed 9 years ago
Unverified
2cf8a4cd71b031fcd5c306ce764e257ec13c0832

Fix a typo in README.

ss3rvac committed 9 years ago
Unverified
89535b821b5dc094284b775f297e4fad30dab60a

Add a note about other available libraries and tools into README.

ss3rvac committed 10 years ago

README

The README file for this repository.

retdec-sh

WARNING

The retdec.com decompilation service is to be disabled (see the official announcement). This will render the scripts in the present repository non-functional. I will keep the repository online in case it is helpful to anyone.

Description

Shell scripts for decompiling and analyzing binary files through the retdec.com decompilation service by using their public REST API.

Two scripts are provided:

  • fileinfo.sh - Analyzes the given binary file and prints the obtained information to the standard output:

      $ scripts/fileinfo.sh --api-key YOUR-API-KEY file.exe
      Input file               : file.exe
      File format              : PE
      File class               : 32-bit
      File type                : Executable file
      Architecture             : x86 (or later and compatible)
      [..]
    
  • decompiler.sh - Decompiles the given binary file and downloads the decompiled C source code:

      $ scripts/decompiler.sh --api-key YOUR-API-KEY file.exe
      $ cat file.c
      //
      // This file was generated by the Retargetable Decompiler
      // Website: https://retdec.com
      // Copyright (c) 2015 Retargetable Decompiler <info@retdec.com>
      //
      [..]
    

Development Status

Although the very basic functionality is there, more features are under development.

For a list of changes, see the CHANGELOG file.

Requirements

  • shell (bash, dash, ...)
  • curl

The scripts should work with any POSIX shell, although they have been tested only on bash and dash.

Installation

Simply copy the scripts from the scripts directory to your machine, either directly or by cloning this repository.

Usage

Since the scripts use the retdec.com API, you need to provide them your API key. The API key can be obtained by registering at retdec.com. After logging in, go to your account, where you can generate an API key). After you have an API key, either pass it by using the -a/--api-key parameter, or set the RETDEC_API_KEY environment variable.

Synopsis:

scripts/{fileinfo,decompile}.sh [OPTIONS] FILE

For a detailed list of available options, run the scripts with the -h/--help parameter.

Exit Codes

The scripts may exit with the following codes.

  • 0 - everything went OK,
  • 1 - either curl is not installed or the given script parameters are invalid,
  • 2 - there was an error during script runtime (e.g. a decompilation failed).

Contributions

Contributions are welcomed as pull requests.

Bug Reporting

If you have found a bug, please report it by opening an issue.

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-python - A library and tools for accessing the service from Python.
  • retdec-rust - A library and tools for accessing the service from Rust.
  • retdec-cpp - A library and tools for accessing the service from C++.