betalphafai / hrdev

Hex-Rays Decompiler Enhanced View

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hex-Rays Decompiler Enhanced View (HRDEV)

What is this

This is a simple IDA Pro Python plugin to make Hex-Rays Decompiler output bit more attractive. HRDEV plugin retrieves standard decompiler output, parses it with Python Clang bindings, does some magic, and puts back.

How it works

Load plugin, then press "Alt + ," and listing will appear. Currently this is an alternative only to a standard "Alt + F5" (function decompilation), listing for complete files is currently not supported.

As this plugin is written in Python, parsing huge file may be time consuming, so it probably makes no sense to support complete file parsing.

Requirements

The only requirement is Clang Python binding. See https://pypi.python.org/pypi/clang. Clang binding is required to parse decompiler output and produce plugin output.

Options

HRDEV plugin has following key shortcuts:

  • Ctr+S - will save current document
  • Ctr+F - will pop up find-replace modal dialog

HRDEV plugin comes with several themes for syntax highlighting, however, you can edit them or add own. To add your own, simply paste file with certain theme name to folder "data/themes" and edit your file. The name of the file is the name of the theme.

For various editor options please take a look at "data/config.ini" and configuration files in "data/themes/*.ini". Files contain comments, so it should not be difficult to understand how to configure editor.

You can toggle line highlight on-off by clicking twice on line number bar.

Other things to know

Please note that Hex-Rays decompiler tab width has to match with plugin tab width setting, otherwise you get ugly indentation.

Plugin may print that there were some Clang parsing errors, but normally that is not of a big concern, usually you can ignore them.

Plugin saves all decompiled files to the "data/cache/MODULE_NAME" folder. It is done so you can save changes made to file. Next time when Alt+, is pressed, plugin will lookup for file in cache. If you want to discard changes made, simply delete file in "data/cache/MODULE_NAME" folder.

This is still beta-release, so I am pretty sure you will find some bugs. Don't hesitate to report them.

Plugin was tested on Windows only, however, I believe that there should be no problems on other platforms.

Examples

This is how usually output looks like:

Decompiler outut

This is how output looks by plugin:

Enhanced View

TODOs

  • Toggle casts
  • Show labels with data types

Work is still ongoing, and please, make feature requests!

About

Hex-Rays Decompiler Enhanced View


Languages

Language:Python 100.0%