• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created about 3 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Header only wrapper around Hex-Rays API in C++20.

HexSuite

HexSuite is a header only wrapper around Hex-Rays API in C++20 designed to simplify the use of Hex-Rays and IDA APIs by modern C++ features. Some of the features it currently supports are as follows:

  • One-click linking to Hex-Rays API using Visual Studio.

  • Instruction wrappers and easy memory-management under hexsuite/architecture.hpp:

auto ci = hex::call_info(
	hex::pure_t{},
	tinfo_t{ BT_INT32 },
	hex::call_arg{ hex::reg( eax_arg, 4 ), tinfo_t{ BT_INT32 } },
	hex::call_arg{ hex::reg( ecx_arg, 4 ), tinfo_t{ BT_INT32 } }
);
auto call = hex::make_call( cg.insn.ea, hex::helper( extr ), std::move( ci ) );
auto mov =  hex::make_mov( cg.insn.ea, std::move( call ), hex::reg( reg, 4 ) );
  • Lambda visitors under hexsuite/visitors.hpp:
blk->for_all_insns( hex::minsn_visitor( [ & ] ( minsn_t* i )
{
	msg( "Instruction/Subinstruction: %s\n", hex::to_string( i ).c_str() );
} ) );
  • Lambda optimizers and microcode filters under hexsuite/components.hpp:
hex::microcode_filter filter = [ ] ( codegen_t& cg )
{
	if ( cg.insn.itype == NN_vmxoff )
		msg( "Found __vmxoff\n" );
	return false;
};
filter.install();
  • Vararg-less Hex-Rays callbacks:
hex::hexrays_callback cb = hex::hexrays_callback_for<hxe_maturity>( [ ] ( cfunc_t* cf, ctree_maturity_t mat )
{
	msg( "Maturity changed %p %d!\n", cf, mat );
	return 0;
} );
cb.install();
  • C++ range wrappers under hexsuite/ranges.hpp:
void list_types() {
	for ( const char* type_name : hex::named_types() )
		msg( "%s\n", type_name );
}
size_t count_instructions( mba_t* mba ) {
	size_t n = 0;
	for ( mblock_t* blk : hex::basic_blocks( mba ) )
	{
		msg( "Successors = %llu\n", hex::successors( blk ).size() );
		for ( minsn_t* ins : hex::instructions( blk ) )
			n++;
	}
	return n;
}
  • More stuff on the way!

Usage

If you're using Visual Studio:

  1. Add a new environment variable using SystemPropertiesAdvanced.exe like so IDA_PATH = S:\IDA Pro\.
  2. Unpack the SDK into %IDA_PATH%sdk.
  3. Add the HexSuite.vcxproj into your solution by using Solution > Add > Existing Project.
  4. Right click on the References tab of the dynamic library (which will be your plugin) and add a reference to HexSuite.
  5. Profit.

If you're not using Visual Studio, simply include the directory, however you will be responsible for linking against Hex-Rays API.

Note that in either case you need a STL library and a compiler fully supporting C++20.

License

HexSuite is licensed under BSD-3-Clause License.

More Repositories

1

NoVmp

A static devirtualizer for VMProtect x64 3.x. powered by VTIL.
C++
1,911
star
2

ThePerfectInjector

Literally, the perfect injector.
C
836
star
3

ByePg

Defeating Patchguard universally for Windows 8, Windows 8.1 and all versions of Windows 10 regardless of HVCI.
C++
822
star
4

NtRays

Hex-Rays microcode plugin for automated simplification of Windows Kernel decompilation.
C++
502
star
5

CVE-2018-8897

Arbitrary code execution with kernel privileges using CVE-2018-8897.
C++
408
star
6

NtLua

Lua in kernel-mode because why not.
C
304
star
7

haruspex

Exploration of x86-64 ISA using speculative execution.
C++
303
star
8

linux-pe

COFF and Portable Executable format described using standard C++ with no dependencies.
C++
250
star
9

simple_cnn

Simple Convolutional Neural Network Library
C++
181
star
10

physical_mem_controller

A library to read physical memory and system-wide virtual memory.
C++
118
star
11

vmware-rpc

Header-only VMWare Backdoor API Implementation & Effortless VMX Patcher for Custom Guest-to-Host RPCs
C++
96
star
12

IdaThemer

🎨 Seamlessly convert your favorite Visual Studio Code themes to IDA Pro themes.
Go
81
star
13

safe_capcom

Capcom wrapper with safety in mind.
C
77
star
14

xstd

A portable header only library extending the C++20 STL.
C++
64
star
15

hvdetecc

Collection of hypervisor detections
C++
17
star
16

llvm-patches

Personal curation of Clang/LLVM patches.
12
star
17

selene

Kernel-mode Paravirtualization in Ring 2, LLVM based linker, and some other things!
C++
11
star
18

troto

TypeScript to Protobuf transpiler.
TypeScript
11
star
19

gengo

Generate Go bindings for shared C libraries.
Go
10
star
20

retro

Experimental static analysis framework.
C++
10
star
21

Myelin

Header-only CUDA accelerated DNN library
Cuda
8
star
22

turing-incomplete

TypeScript
4
star
23

xedpp

Tiny wrapper around xed API.
C++
1
star