A Windows DLL manual mapper written in modern C++23. Designed with a client <-> server architecture in mind.
Most existing manual mappers only handle one architecture, don't consider client <-> server separation, and lack basic features like import obfuscation. This project covers all of that in a single codebase with only the basic features so you can see how it could be implemented.
- x86/x64 support maps both x86 and x64 DLLs into target processes from a single x64 mapper
- Base relocation patches relocation entries when the DLL can't load at its preferred base
- Import fix resolves named imports, ordinal imports, and forwarded exports
- Import obfuscation replaces IAT entries with randomized XOR/ADD/SUB stubs that decode and jump at runtime
- Security cookie generates and patches
__security_cookie - TLS callbacks executes TLS callbacks before calling
DllMain - Section permissions sets per-section page protections (RX, RW, etc.)
- Header erasure erases PE header
| Flag | Description |
|---|---|
ERASE_HEADERS |
Erase header in mapped image |
ERASE_METADATA |
Strip discardable sections (partial currently only erases IMAGE_SCN_MEM_DISCARDABLE sections) |
FIX_RELOCATION |
Apply base relocations |
FIX_IMPORTS |
Resolve and patch the import address table |
FIX_COOKIE |
Generate and set __security_cookie |
FIX_SECTIONS_PERMISSIONS |
Set per section page protections |
GET_TLS_CALLBACKS |
Execute TLS callbacks before entrypoint |
OBFUSCATE_IMPORTS |
Replace IAT entries with encoded jump stubs (requires FIX_IMPORTS) |
Requires Visual Studio 2022 with the C++23 (/std:c++latest) toolset. The mapper itself must be built as x64.
Open manual_mapper.sln and build:
| Config | Platform |
|---|---|
| Debug | x64 |
| Release | x64 |
manual_mapper/
manual_mapper.cpp # example usage
c_pe.hpp # server
c_process.hpp # client
logger.hpp # logging
file.hpp # file I/O
string_utils.hpp # string utilities
json.hpp # nlohmann/json
Got suggestions or ideas? Open an issue. PRs are welcome. I might implement requested features if there's enough interest.