Generate DLL proxy Visual Studio solutions
mainSpartacus can generate Visual Studio skeleton projects to create proxy DLLs. It supports two main approaches:
- Simple Redirection: Redirects all exported functions back to the legitimate DLL. Payloads must be executed from
DllMain. - Ghidra-powered Proxying: Uses Ghidra to extract function signatures. This allows you to execute payloads from specific proxied functions (e.g.,
GetFileVersionInfoExW) instead of relying onDllMain.
Usage Examples:
Simple redirection (no function proxying):
--mode proxy --dll C:\Windows\System32\version.dll --solution "C:\data\tmp\refactor-version" --overwrite --verbose --external-resourcesAdvanced proxying with Ghidra: Extract signatures to create proxy functions for as many functions as possible.
--mode proxy --ghidra C:\ghidra\support\analyzeHeadless.bat --dll C:\Windows\System32\userenv.dll --solution C:\Projects\spartacus-userenv --overwrite --verboseProxy specific functions only:
--mode proxy --ghidra C:\ghidra\support\analyzeHeadless.bat --dll C:\Windows\System32\version.dll --solution C:\Projects\spartacus-version --verbose --overwrite --external-resources --only "GetFileVersionInfoExW, GetFileVersionInfoExA"Manage function prototypes:
Generate a prototype database from .h files to assist Ghidra:
--mode proxy --action prototypes --path "C:\Program Files (x86)\Windows Kits" --csv C:\data\prototypes.csv --verbose