reinject DLL

c++ / delphi package - dll injection and api hooking
Post Reply
Luiz.Bernardi
Posts: 31
Joined: Fri Apr 03, 2009 2:21 pm

reinject DLL

Post by Luiz.Bernardi »

Hello

I need to call UninjectDLL to reinject the same function in the same program?

Another program is injecting the same DLL and overlaying my hook. So I need to reinject the DLL each time the program runs.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: reinject DLL

Post by madshi »

Injecting the same dll? I'm confused. The other program is injecting your hook dll? Or what do you mean?
Luiz.Bernardi
Posts: 31
Joined: Fri Apr 03, 2009 2:21 pm

Re: reinject DLL

Post by Luiz.Bernardi »

madshi wrote:Injecting the same dll? I'm confused. The other program is injecting your hook dll? Or what do you mean?
See,

I have a logging system that records all file operations (copy, move, delete). For this, I hooked the Windows functions.

I found that another program can create a hook for these same functions, and using assembler, execute procedures without calling the Windows functions, preventing me of recording this operation.

I need put my functions back at the top of the list of hooks, to be called before other hooks, recording the operation.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: reinject DLL

Post by madshi »

Does your hook stop working completely? Or does it just not work for this one "other program"?
Luiz.Bernardi
Posts: 31
Joined: Fri Apr 03, 2009 2:21 pm

Re: reinject DLL

Post by Luiz.Bernardi »

While this program is running, my hook do not work. When it is closed, the hooks again function normally.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: reinject DLL

Post by madshi »

You mean your hooks don't work at all, not even for other processes like e.g. Explorer or Notepad etc?

Have you tried whether uninjecting and reinjecting works? Or are you asking whether I think it might work?
Luiz.Bernardi
Posts: 31
Joined: Fri Apr 03, 2009 2:21 pm

Re: reinject DLL

Post by Luiz.Bernardi »

Exactly.

I wonder if I need to call uninjectlibrary before injecting the dll again.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: reinject DLL

Post by madshi »

Have you tried whether uninjecting and reinjecting works? Or are you asking whether I think it might work?
Post Reply