A small educational utility for converting compatible Windows PE executables (.exe) into dynamic-link libraries (.dll) by patching PE headers and injecting an export directory into existing code caves.
exe2dll:
- validates the input with peforge
- requires an existing relocation directory
- sets the DLL characteristic
- injects a minimal
DllMainstub - preserves the original entry point as an exported function
- reserves cave ranges during conversion to avoid overlapping writes
This is an educational binary-rewriting tool. It does not make every executable safe to load as a DLL.
git clone --recurse-submodules https://github.com/sonx4444/exe2dll.git
cd exe2dll
build.batDuring peforge development, configure against a sibling checkout:
cmake -S . -B build-local -DPEFORGE_SOURCE_DIR=C:\path\to\peforge
cmake --build build-local --config Releaseexe2dll_x64.exe <input_exe> <output_dll> <exported_function_name>Example:
exe2dll_x64.exe test.exe test.dll RunFor a detailed walkthrough of the PE internals and conversion flow, read How to Convert EXEs to DLLs: PE Internals and Practical Steps.