How hasherezade/exe_to_dll works
Project type and purpose
• This is a native C++ command-line utility (“exe_to_dll”) whose sole purpose is to take a Windows PE executable (EXE) and transform it into a loadable DLL by rewriting its headers and export table. It supports both 32-bit and 64-bit binaries.
File structure
• Top-level:
• CMakeLists.txt – build orchestration
• .gitmodules – brings in submodule “libpeconv”
• README.md, .gitignore, CI config
• exe_to_dll/
• main.cpp – CLI argument parsing and orchestrator
• pe_handler.cpp/.h – core logic for in-memory PE rewriting
• exports_block.h – helper for building the export directory
• libpeconv/ – third-party (submodule) library for PE parsing/manipulation
• tests/ – test harness invoking the built tool against sample EXEs
• tests/test_case1 – CMake + test binary
README for additional insights
• Describes the workflow:
Command-line → input.exe → exe_to_dll → output.dll “Start” export → optional rundll32 test
• Mentions supported architectures and the expected “Start” export
Detail
• If desired, include a side note about CMakeLists.txt driving the build of both the tool and its tests