DLL Injector loads a DLL into a running Windows process using the most basic technique: a remote thread that calls LoadLibraryW.
The code is split into a small injector library and a thin command-line front end, so you can use it as a tool or reuse the library in your own project.
DEMO.mp4
Targets
- x86 and x64, Debug and Release
- Target a process by executable name or by PID
- Test programs (x86 / x64) available in the "Release" section
Injection
- Waits for the remote thread and reports the injection outcome
- Detects an architecture mismatch between the injector and the target
- Unicode entry point and wide Win32 APIs, with readable error messages
- Distinct exit codes for scripting
Code
- Reusable library in
include/injector/andsrc/ - RAII handle wrapper, no leaked handles
- Visual Studio solution
inject.exe <dll> <process>
<dll>: path to the DLL to inject (absolute or relative).<process>: target executable name (e.g.notepad.exe) or a numeric PID.
inject.exe test.dll notepad.exe
inject.exe test.dll 1234
Use -h / --help to display the usage.
Warning
The injector architecture must match the target process's architecture. An x86 injector cannot inject a 64-bit process and vice versa. The program detects a mismatch and reports it.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Usage error |
| 2 | Process not found |
| 3 | DLL path could not be resolved |
| 4 | Injection failed |
LoadLibraryis the most detectable injection technique; security products commonly flag it.- On 64-bit builds, the module handle returned by
LoadLibraryis truncated to 32 bits by the remote thread exit code. The injection result (success or failure) is still reliable.
- Open
DLL Injector.sln. - Build in Release (x86 or x64).
Every configuration is already set up.
This project is licensed under the GNU GPLv3.