hrtng IDA plugin is a collection of tools, ideas and experiments from different sources I've found interesting and useful in my reversing work.
A practical guide to the reverse of a complex malware using the example of dissecting a FinSpy module with help of hrtng IDA plugin on securelist
There is no one place in menu where all functionality of the plugin grouped together. hrtng menu items placed closer to logically related standard IDA & Hex-Rays decompiler functions. Messages, menu items, popup windows and dialog boxes belong to this plugin are marked with "[hrt]
" prefix.
The plugin requires Hex-Rays decompiler presence in your IDA installation. The plugin can be compiled with IDA SDK >= 7.3 but not well tested with old versions.
Special thanks to following peoples for their great plugins were used as base for my work:
- Milan Bohacek, hexrays_tools and hexrays_hlight
- HexRaysDeob by Rolf Rolles and Takahiro Haruyama
- Karthik Selvaraj Krypton plugin
- Ali Rahbar, Ali Pezeshk and Elias Bachaalany GraphSlick plugin
- Markus Gaasedelen AVX support for the Hex-Rays x64 Decompiler
- Pull up comments from disasm to pseudocode view
- Automatic renaming local and global variables, struct members
- Automatic enum substitution
- COM helper
- User interactive renaming/retyping assistance
- Assists with changing type of structure member or local/global variable
- reinterpret_cast
- Collapse selection
- "offsetof" convertor
- Strings/data/const decryption
- Build stack strings (optionally with decryption)
- Build array strings (optionally with decryption)
- Mass strings decryption
- Get API help
- AVX lifter
- Dump strings, comments and names from the IDA database
- Offsets table creation
- Convert function to __usercall, detect spoiled registers
- Set calling conventions bit closer to Go-lang
- Patch custom area with NOPs
- Patch from debugger / Patch from file
- Search & Patch
- Create patched (DEC) file
- Clone or download Crypto++® Library CMake source code to
hrtng/src/cryptopp-cmake
folder.
cd src
git clone https://github.com/abdes/cryptopp-cmake
- Copy
IDA_DIR/plugins/hexrays_sdk/include/hexrays.hpp
file to theinclude
directory of the IDA SDK. (Not necessary for IDA 9.0) - Edit
hrtng/src/CMakeLists.txt
file to set correct path and version of used IDA SDK. To build later with another SDK version you may change cmake'sIDASDK_VER
variable with usingcmake -D
,ccmake
orcmake-gui
tools. - Create build directory, go into it, configure and build cmake project
mkdir bld && cd bld
cmake <path-to/hrtng/src>
cmake --build . --config Release -j 4 --clean-first
- On the first build attempt there will be compiling error looks like:
hrtng/src/deob.cpp:912:60: error: ‘class rangeset_t’ has no member named ‘getbag’
fc.create("tmpfc2", ranges.getbag(), 0);//!!! add line into range.hpp, class rangeset_t: "const rangevec_t &getbag() const { return bag; }"
- To fix the error, edit
IDA_SDK/include/range.hpp
file, adding line withgetbag
function implementation intoclass rangeset_t
declaration as in the following example:
class rangeset_t
{
rangevec_t bag;
...
public:
const rangevec_t &getbag() const { return bag; }
...
};
- Copy built binaries into
IDA_DIR/plugins
folder togeter withapilist.txt
andliteral.txt
files fromhrtng/bin/plugins
- Profit
This program is released under GPL v3 license
- Sergey.Belov at kaspersky.com