Git Product home page Git Product logo

retdec-sh's Introduction

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 <[email protected]>
      //
      [..]
    

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 ([email protected]) 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++.

retdec-sh's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.