首页
社区
课程
招聘
[转帖]HexRaysCodeXplorer by REhints
发表于: 2017-9-30 10:10 4115

[转帖]HexRaysCodeXplorer by REhints

2017-9-30 10:10
4115
_https://github.com/REhints/HexRaysCodeXplorer
 _   _          ______                _____           _     __   __      _                     
| | | |         | ___ \              /  __ \         | |    \ \ / /     | |                    
| |_| | _____  _| |_/ /__ _ _   _ ___| /  \/ ___   __| | ___ \ V / _ __ | | ___  _ __ ___ _ __ 
|  _  |/ _ \ \/ /    // _` | | | / __| |    / _ \ / _` |/ _ \/   \| '_ \| |/ _ \| '__/ _ \ '__|
| | | |  __/>  <| |\ \ (_| | |_| \__ \ \__/\ (_) | (_| |  __/ /^\ \ |_) | | (_) | | |  __/ |   
\_| |_/\___/_/\_\_| \_\__,_|\__, |___/\____/\___/ \__,_|\___\/   \/ .__/|_|\___/|_|  \___|_|   
                             __/ |                                | |                          
                            |___/                                 |_|

============================================================================

The Hex-Rays Decompiler plugin for better code navigation in RE process. CodeXplorer automates code REconstruction of C++ applications or modern malware like Stuxnet, Flame, Equation, Animal Farm ...

The CodeXplorer plugin is one of thefirst publicly availableHex-Rays Decompiler plugins. We keep updated this projectsince summer of 2013and continue contributing new features frequently. Also most interesting feutures of CodeXplorer have been presented on numerous security conferences like: REcon, ZeroNights, H2HC, NSEC and BHUS

Contributors:

Alex Matrosov (@matrosov)

Eugene Rodionov (@rodionov)

Rodrigo Branco (@rrbranco)

Gabriel Barbosa (@gabrielnb)

Supported versions of Hex-Rays products:everytime we focus on last versions of IDA and Decompiler because trying to use new interesting features in new SDK releases. It's also mean we tested just on last versions of Hex-Rays products and not guaranteed stable work on previous ones.

Why not IdaPython:all code developed on C/C++ because it's more stable way to support complex plugin for Hex-Rays Decompiler.

Supported Platforms:x86/x64 for Win, Linux and Mac.

HexRaysCodeXplorer- Hex-Rays Decompiler plugin for easier code navigation. Right-click context menu in the Pseudocode window shows CodeXplorer plugin commands:

Here are the main features of the CodeXplorer plugin:

Automatic type REconstructionfor C++ objects. To be able to reconstruct a type using HexRaysCodeXplorer one needs to select the variable holding pointer to the instance of position independed code or to an object and by right-button mouse click select from the context menu «REconstruct Type» option:

The reconstructed structure is displayed in “Output window”. Detailed information about type Reconstruction feature is provided in the blog post “Type REconstruction in HexRaysCodeXplorer”.

Also CodeXplorer plugin supports auto REconstruction type into IDA local types storage.

Virtual function table identification- automatically identifies references to virtual function tables during type reconstruction. When a reference to a virtual function table is identified the plugin generates a corresponding C-structure. As shown below during reconstructingstruct_local_data_storagetwo virtual function tables were identified and, as a result, two corresponding structures were generated:struct_local_data_storage_VTABLE_0andstruct_local_data_storage_VTABLE_4.

C-tree graph visualization– a special tree-like structure representing a decompiled routine in citem_t terms (hexrays.hpp). Useful feature for understanding how the decompiler works. The highlighted graph node corresponds to the current cursor position in the HexRays Pseudocode window:

Ctree Item View– show ctree representation for highlighted element:

Extract Ctrees to File– dump calculate SHA1 hash and dump all ctrees to file.

Extract Types to File– dump all types information (include reconstructed types) into file.

Navigation through virtual function callsin HexRays Pseudocode window. After representing C++ objects by C-structures this feature make possible navigation by mouse clicking to the virtual function calls as structure fields:

Jump to Disasm- small feature for navigate to assembly code into "IDA View window" from current Pseudocode line position. It is help to find a place in assembly code associated with decompiled line.

Object Explorer– useful interface for navigation through virtual tables (VTBL) structures. Object Explorer outputs VTBL information into IDA custom view window. The output window is shown by choosing «Object Explorer» option in right-button mouse click context menu:

Object Explorer supports following features:

Auto structures generation for VTBL into IDA local types

Navigation in virtual table list and jump to VTBL address into "IDA View" window by click

Show hints for current position in virtual table list

Shows cross-references list by click into menu on "Show XREFS to VTBL"

Support auto parsing RTTI objects:

The Batch mode contains following features:

Batch mode - useful feature to use CodeXplorer for processing multiple files without any interaction from user. We add this feature after Black Hat research in 2015 for processing 2 millions samples.
Example (dump types and ctrees for functions with name prefix "crypto_"):
idaq.exe -OHexRaysCodeXplorer:dump_types:dump_ctrees:CRYPTOcrypto_path_to_idb

Compiling:

Windows:

Open the solution in Visual Studio and build it

Linux:

cd src/HexRaysCodeExplorer/IDA_DIR=<PATH_TO_IDA> IDA_SDK=<PATH_TO_IDA_SDK> EA64=0 make -f makefile.lnxIDA_DIR=<PATH_TO_IDA> IDA_SDK=<PATH_TO_IDA_SDK> EA64=0 make -f makefile.lnx

Mac:

cd src/HexRaysCodeExplorer/IDA_DIR=<PATH_TO_IDA> IDA_SDK=<PATH_TO_IDA_SDK> make -f makefile.macThe Mac makefile might need some hand editing, pull requests welcome!

============================================================================

Conference talks about CodeXplorer plugin:

2015"Distributing the REconstruction of High-Level IR for Large Scale Malware Analysis", BHUS[slides]"Object Oriented Code RE with HexraysCodeXplorer", NSEC[slides]2014"HexRaysCodeXplorer: object oriented RE for fun and profit", H2HC[slides]2013"HexRaysCodeXplorer: make object-oriented RE easier", ZeroNights[slides]"Reconstructing Gapz: Position-Independent Code Analysis Problem", REcon[slides]

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 1
支持
分享
最新回复 (6)
雪    币: 817
活跃值: (1927)
能力值: ( LV12,RANK:2670 )
在线值:
发帖
回帖
粉丝
2
支持顶一下
2017-9-30 10:22
0
雪    币: 1036
活跃值: (1311)
能力值: ( LV3,RANK:35 )
在线值:
发帖
回帖
粉丝
3
这个插件目前支持7.0了吗?
2017-9-30 11:08
0
雪    币: 97697
活跃值: (200839)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
4
KuNgBiM [em_41]支持顶一下
2017-9-30 11:48
0
雪    币: 3279
活跃值: (1997)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
大佬们来说一下这个插件干嘛用的?
2017-9-30 15:37
0
雪    币: 46
活跃值: (18)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
可惜还不支持  7.0
2017-10-1 13:50
0
雪    币: 32
活跃值: (30)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
StriveXjun 这个插件目前支持7.0了吗?
目前还不支持。开发者说他们要重构
2017-10-6 15:59
0
游客
登录 | 注册 方可回帖
返回
//