Check process before injection from driver

c++ / delphi package - dll injection and api hooking
Post Reply
ameetmalekar
Posts: 29
Joined: Thu Feb 16, 2012 5:12 am

Check process before injection from driver

Post 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.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Check process before injection from driver

Post 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.
Post Reply