This script generates a DLL from a specified file path. It supports both C++ and C# projects.
Usage
python dll_generator.py [-h] dll_path {cpp,cs}Here we use Integrator.exe and msi.dll as example.
- Generator dll code from a desired dll file.
python dll_generator.py C:\windows\system32\msi.dll cpp- Compile the code using Visual Studio
- Copy the compiled dll and rename to
\DLL\Integrator\ - CMD exeucte
Integrator.exeand discover the function to sideload. - We can found
MsiDatabaseGenerateTransformAfor dll sideloading.
Here we use Integrator.exe and msi.dll as example.
And we found MsiDatabaseGenerateTransformA to be the function to exeucte payload.
- Generator dll code from a desired dll file and it output to
cs_dll.txt.
python dll_generator.py C:\windows\system32\msi.dll cs- Copy the
cs_dll.txtcontent to a c# dll project. - Right Click Solution Explorer

- Browse and Install DllExport

- In the directory, run DllExport.bat

- Follow the setting and apply and reload the project to compile.

- Change
MsiDatabaseGenerateTransformAto execute the payload function. - Compile and copy dll and rename to
\DLL\Integrator\and exeucte.