C++ Assembler Library

Reverse engineering related content goes here. (No discussion of cracking commercial software)
Post Reply
User avatar
heapsoverflow
Site Admin
Posts: 2
Joined: Wed Jun 18, 2025 5:36 pm

C++ Assembler Library

Post by heapsoverflow »

Hello,

I was writing a static bin2bin obfuscator and needed a way to generate dynamic stubs with little runtime overhead. First thought of Asmjit however its emitter was too bloated for my use case. I don't even need to load generated assembly code into a runtime environment which is not exactly the thing I want. So I made a single-header library to generate assembly code at compile time with the help of C++ templates. It is done by directly manipulating bytes of instruction opcodes, providing you a pure std::array. You can then disassemble these bytes with for example Zydis to preserve their properties as well. If you wish you can also generate instructions that take random registers as operands. More in depth usage is in the documentation file. I'll be updating it soon but for now it is sufficient. Thought that might be useful for some other people and decided to release it.


454101743-97f339c1-a1e7-4b66-a3f6-4e8e3e774ead.png
454101743-97f339c1-a1e7-4b66-a3f6-4e8e3e774ead.png (121.59 KiB) Viewed 723 times

Here's the link:

https://github.com/0x1c1101/blazing_asm
Post Reply