How keyzm/dlltoshellcode works
DllToShellCode is a Windows utility that converts DLLs into shellcode, optionally compressing the result and selecting a payload mode. The documented workflow is CLI input → DLL-to-shellcode conversion → optional compression → generated shellcode; it also supports binary-to-hex and standalone file compression. The repository includes separate main, Ntdll, and aPLib shellcode projects. The CLI and payload-project entry points were not sampled, so their connections are documented at the README level; no unverified internal call sequence is asserted.
Main entry points: DllToShellCode.c DLL converter · compress.c Compression routines · ShellCode_Main/shellcode_base.c Main resolver helpers · ShellCode_Ntdll/shellcode_base.c Ntdll resolver helpers
Components 12
Conversion CLI
- DLL converter
DllToShellCode/DllToShellCode.c
Shellcode Payloads
- Payload byte arrays
DllToShellCode/shellcode_data.c - Payload accessors
DllToShellCode/shellcode_data.h - Main shellcode
ShellCode_Main/ShellCode_Main.c - Ntdll shellcode
ShellCode_Ntdll/ShellCode_Ntdll.c - aPLib shellcode
ShellCode_Aplib/ShellCode_Aplib.c
Compression
- Compression routines
DllToShellCode/compress.c - aPLib interface
DllToShellCode/aplib.h
Runtime Resolution
- Main resolver helpers
ShellCode_Main/shellcode_base.c - Ntdll resolver helpers
ShellCode_Ntdll/shellcode_base.c
Other components
- CLI user
- Windows APIs
Connections 9
- CLI user → DLL converter: invokes CLI
README.md - DLL converter → Compression routines: may compress
- Compression routines → aPLib interface: calls aP_pack
DllToShellCode/compress.c - DLL converter → Payload byte arrays: selects payload
- Payload accessors → Payload byte arrays: exposes accessors
DllToShellCode/shellcode_data.c - Main shellcode → Main resolver helpers: uses helpers
- Ntdll shellcode → Ntdll resolver helpers: uses helpers
- Main resolver helpers → Windows APIs: resolves APIs
- Ntdll resolver helpers → Windows APIs: resolves APIs