Hi,
Can we check if a process is running before injecting a dll from driver? I wanted to inject in target.exe only if check.exe is running.
Check process before injection from driver
-
- Posts: 29
- Joined: Thu Feb 16, 2012 5:12 am
Re: Check process before injection from driver
The driver itself doesn't support such a complicated check. However, you could use the following method:
Allow the driver to always inject into target.exe. But in DllMain of your hook dll check if check.exe is running. If it's not running, simply return TRUE and don't do anything else in DllMain. This way your hook dll is loaded, but is doing nothing at all.
Allow the driver to always inject into target.exe. But in DllMain of your hook dll check if check.exe is running. If it's not running, simply return TRUE and don't do anything else in DllMain. This way your hook dll is loaded, but is doing nothing at all.