A small C++ utility for concatenating two shellcode binaries into a single executable shellcode blob.
It generates a bootstrap stub that first calls ShellcodeA, then ShellcodeB, and finally returns to the caller.
The program:
- Loads two shellcode files (
ShellcodeAandShellcodeB) from disk. - Builds a small bootstrap code stub that ensures proper stack setup and execution flow.
- On x64, the stub adjusts
RSP, callsShellcodeA, realigns the stack, then callsShellcodeB. - On x86, the stub simply calls
ShellcodeAthenShellcodeB.
- On x64, the stub adjusts
- Concatenates the bootstrap +
ShellcodeA+ShellcodeBinto one final binary. - Saves the resulting shellcode into
FinalShellcode_x86.bin(orFinalShellcode_x64.bindepending on target). - Uses
VirtualProtectto make the memory executable and runs the final shellcode.
Compile with MSVC (x86 or x64):
- Uses VirtualProtect to mark the concatenated shellcode as executable.
- The bootstrap code ensures stack alignment before transferring control.
This project is for educational and research purposes only. Do not use it for malicious activity. The author assumes no responsibility for improper use.