Check process before injection from driver

c++ / delphi package - dll injection and api hooking

Check process before injection from driver

Postby ameetmalekar » Thu May 26, 2016 6:14 am

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.
ameetmalekar
 
Posts: 29
Joined: Thu Feb 16, 2012 5:12 am

Re: Check process before injection from driver

Postby madshi » Thu May 26, 2016 7:18 am

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


Return to madCodeHook

Who is online

Users browsing this forum: No registered users and 2 guests