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

Overview

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();
  • 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.

You might also like...
πŸ” A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
πŸ” A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.

πŸ” ImHex A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM. Supporting If you like my work, plea

Edit a PF-DTA content in hex on a side-by-side display of EBCDIC character representation.
Edit a PF-DTA content in hex on a side-by-side display of EBCDIC character representation.

AS400 Hex Editor Edit a PF-DTA content in hex on a side-by-side display of EBCDIC character representation. Introduction This tool was written to edit

bviplusplus (bvi++) is an ncurses-based hex editor derived from bviplus

bviplusplus (bvi++) Overview bviplusplus (bvi++) is an ncurses-based hex editor derived from bviplus Links Other bviplus derivatives bviplus by Barano

CSteamworks is a C ABI Wrapper for Valve's Steamworks API

CSteamworks Note: This project is deprecated as Valve now prodives a C ABI wrapper built into steam_api.dll. CSteamworks is a C ABI Wrapper for Valve'

Direct3D wrapper for Sega's Kamui API

KAMUI Direct! Circa 1997 Sega was developing the KAMUI graphics API used for their newest console, the Dreamcast. There were no devkits yet, so the pr

C++ wrapper library for global weather API - hyperlocal weather forecasts

meteosource_cpp - Weather API library C++ wrapper library for Meteosource weather API that provides detailed hyperlocal weather forecasts for any loca

A Walkie-Talkie based around the ESP32 using UDP broadcast or ESP-NOW
A Walkie-Talkie based around the ESP32 using UDP broadcast or ESP-NOW

Overview We've made a Walkie-Talkie using the ESP32. Explanatory video Audio data is transmitted over either UDP broadcast or ESP-NOW. So the Walkie-T

around β€” adaptive rounding operation

around β€” adaptive rounding operation Attempts to perform nice rounding of a floating point number, like a human would do. Usage: around.h #include "ar

Growtopia internal cheat focused around enhancements and framework, that is loaded automatically. By: ama6nen
Growtopia internal cheat focused around enhancements and framework, that is loaded automatically. By: ama6nen

CREDITS TO AMA6NEN ORIGINAL REPO: https://github.com/ama6nen/INZERNAL INZERNAL INZERNAL has been discontinued for public usage and a private version t

Owner
Can BΓΆlΓΌk
Security researcher and reverse engineer; mostly interested in Windows kernel development and low-level programming.
Can BΓΆlΓΌk
Hex-Rays microcode plugin for automated simplification of Windows Kernel decompilation.

NtRays NtRays is a Hex-Rays microcode plugin for automated simplification of Windows Kernel decompilation. Features Cleanup of instrumentation and sch

Can BΓΆlΓΌk 359 Jan 3, 2023
Interactive-hex-meshing - Source code for "Interactive All-Hex Meshing via Cuboid Decomposition [SIGGRAPH Asia 2021]".

Interactive All-Hex Meshing via Cuboid Decomposition Video demonstration This repository contains an interactive software to the PolyCube-based hex-me

Lingxiao Li 131 Dec 5, 2022
Plugin wrapper around VCV Rack

DISTRHO Cardinal Cardinal, the Rack! ! THIS PROJECT IS A WORK IN PROGRESS ! This is a DPF-based plugin wrapper around VCV Rack, using its code directl

DISTRHO 1.1k Jan 7, 2023
γ€Œβš™οΈγ€Simple header for C language to encode and decode hex

γ€Œ βš™οΈ 」Simple header for C language to encode and decode hex Example: Encode: #include <stdio.h> #include <string.h> #include <stdlib.h> #include "hex.

null 3 Jan 1, 2023
A header-only version of Instagram Private API in C++

C++ Instagram API A header-only version of Instagram Private API in C++ Getting started. Writing your first bot General API Documentation Usage Error

Denis Beqiraj 36 Dec 1, 2022
Header-only VMWare Backdoor API Implementation & Effortless VMX Patcher for Custom Guest-to-Host RPCs

VmxHijack Header-only VMWare Backdoor API Implementation & Effortless VMX Patcher for Custom Guest-to-Host RPCs Sample // --- RPC Server Code (VmxHija

null 27 Sep 9, 2022
The purpose of this project is to create a modern C++17 header-only interface to the FreeRTOS kernel API

FreeRTOS-Cpp The purpose of this project is to create a modern C++17 header-only interface to the FreeRTOS kernel API. Goals of this project include:

Jon Enz 17 Nov 12, 2022
List of Persian Colors and hex colors for CSS, SCSS, PHP, JS, Python, and Ruby.

Persian Colors (Iranian colors) List of Persian Colors and hex colors for CSS, SCSS, PHP, C++, QML, JS, Python, Ruby and CSharp. Persian colors Name H

Max Base 12 Sep 3, 2022
A short and sweet hex dumper!

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘β–„β–„ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•

Victor Sarkisov 1 Nov 18, 2021
Dexe is a simple hex editor, written in Uxntal.

Dexe Dexe is a simple hex editor, written in Uxntal. Build You must have the Uxn assembler and emulator. uxnasm noodle.tal noodle.rom && uxnemu noodle

DeltaF1 3 Oct 15, 2021