A sophisticated DLL loader that pre-allocates memory space and maintains execution rights throughout the DLL lifecycle.
- Pre-allocates memory space at random address
- Continuously monitors and restores memory protection rights
- Supports dynamic DLL loading/unloading
- Memory protection against external modifications
- Detailed logging of all operations
- Open the project in Visual Studio
- Select the build preset (win-x64-release or win-x64-debug)
- Build the project
- Clone the repository
- Open console in the project directory
- Run
cmake --preset win-x64-release
- Run
cmake --build --preset win-x64-release
-
Initialization:
- Allocates memory space with PAGE_EXECUTE_READWRITE permissions
- Calculates required space by reading the target DLL's PE headers
- Chooses random memory location for allocation
- Starts memory protection monitoring thread
-
Memory Protection:
- Continuously monitors allocated memory region
- Automatically restores PAGE_EXECUTE_READWRITE permissions if changed
- Provides logging of any protection changes
-
DLL Management:
- Loads DLL on demand (F6 key)
- Properly initializes DLL entry point
- Supports clean unloading (F7 key)
- Graceful shutdown (F9 key)
-
Setup:
- Place your target DLL (named
example.dll
) in the same directory as the loader - Inject the loader DLL into your target process
- Place your target DLL (named
-
Controls:
F6
: Load example.dllF7
: Unload example.dllF9
: Exit loader
-
Monitoring:
- Console window shows real-time status and operations
- Displays memory addresses and protection states
- Reports any attempts to modify memory protection
- Uses Windows API for memory management
- Implements PE header parsing
- Maintains memory protection through VirtualProtect
- Supports x64 architecture
- Thread-safe operations
- Windows operating system
- Administrative privileges (for some operations)
- Target process must allow DLL injection
- Example.dll must be present in the same directory
- Random memory allocation
- Continuous memory protection monitoring
- Protection rights restoration
- Privilege verification
- Detailed error reporting
The loader provides comprehensive error reporting for:
- Memory allocation failures
- DLL loading issues
- Protection changes
- Access violations
- General operation errors
- Ensure your target DLL is compatible with the process architecture
- Monitor console output for operation status
- Memory protection monitoring runs until loader is unloaded
- Clean shutdown is recommended using F9 key