Page 1 of 1

Check process before injection from driver

Posted: Thu May 26, 2016 6:14 am
by ameetmalekar
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.

Re: Check process before injection from driver

Posted: Thu May 26, 2016 7:18 am
by madshi
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.