This project includes a DLL-injector written in C++.
This project is related to Windows Operation System.
To achieve the injection goal the program uses the LoadLibrary function from the Windows API.
To inject the DLL into other processes, the injector uses the following sequence:
- VirtualAllocEx - Allocate memory in injected process space.
- WriteProcessMemory - Write the DLL path to the memory we have allocated.
- CreateRemoteThread - Create a remote "LoadLibrery" thread in the injected process.
Note
Build the project based on your target process's architecture (x86 or x64).
- Open the solution file (.sln).
- Build the project in the selected architecture (x86 or x64).
The project is a CLI tool and can be used in the command line with the following operations
Inject your DLL into the selected process by using the following command
DLL-Injector.exe inject <PID> <DLL-Path>
- <PID>: Process id of a running process
- <DLL-Path>: Path to DLL
Unload the selected DLL from the selected process by using the following command
DLL-Injector.exe unload <PID> <DLL-Path>
- <PID>: Process id of a running process
- <DLL-Path>: Path to DLL
Demonstrating the injector functionality and usage.
The injected DLL opens a MessageBox in the injected process with the message "Process Attach/Detach" based on the selected operation.