MHDE is a modern C++ port of the Hacker Disassembler Engine (HDE). The current port leverages the features of the C++20 standard, providing a robust and efficient disassembly engine for modern applications.
- Utilizes C++20 features for enhanced performance and readability
- Compatible with both 32-bit and 64-bit disassembly
- Easy integration into existing projects
Make sure you have the following installed on your system:
- CMake (version 3.21 or higher)
- A C++20 compatible compiler (e.g., GCC 10+, Clang 10+, MSVC 2019+)
To build MHDE, follow these steps:
-
Clone the repository:
git clone https://github.com/Jasper1467/mhde.git cd mhde
-
Create a build directory:
mkdir build cd build
-
Generate build files using CMake:
cmake ..
If you want to build the test files as well, add
-DBUILD_TESTS=ON
:cmake .. -DBUILD_TESTS=ON
-
Build the project:
cmake -B .
After successfully building MHDE, you'll find the executable and any associated libraries in the build
directory.
Here is a simple example demonstrating how to use MHDE:
#if defined(__x86_64__) || defined(_M_X64)
#include <mhde64.hpp> // Include 64-bit version for x86_64 architecture
#else
#include <mhde32.hpp> // Include 32-bit version for other architectures
#endif
int main()
{
CMHDE mhde;
unsigned char code[] = { 0x90, 0x90, 0x90 }; // NOP instructions
unsigned int result = mhde.Disassemble(code);
if (result == 1)
std::cout << "Disassembly successful: 1 byte processed." << std::endl;
else
std::cerr << "Disassembly failed." << std::endl;
return 0;
}