Uninjection and global hooks

c++ / delphi package - dll injection and api hooking
Post Reply
edotan
Posts: 10
Joined: Mon Dec 10, 2007 9:40 pm

Uninjection and global hooks

Post by edotan »

Hi,
First of all, thanks again Madshi for your great software.
I've been using madchook for a long time now, and I've come to the conclusion that in some cases, for some hooks, uninjection simply isn't a good idea.
For example, consider hooking an API that can last for a long time (take for example MessageBox, or Sleep, etc etc). If an Uninject is called while the API is in use, it'll uninject after a certain timeout (default = 7sec) and then the API will crash when it returns (since the DLL code was removed from memory).

But this is not the point of my post (I'm getting there...)

To avoid such problem, I decided to never uninject my global hook DLL. However, I wondered if there is a way to tell madshi to stop injecting new processes.
In other words, I don't want to uninject from processes, but I also don't want to inject new processes (otherwise I'll have a hard time calling DllMain when I re-inject again).
Any tips?
Post Reply