Thread: Code Injection
View Single Post
  #14  
Old 10-27-2003, 19:33
R@dier
 
Posts: n/a
Hi Guys,

another approach you can try
is using WaitForInputIdle this should halt your process which will inject the code untill the target program has become unpacked.

It will kinda synchronise the loader/code injector with the target program

you can then if you wish throw in a Bp after the WaitForInputIdle

it would probably be a good idea to check for some bytes to make sure it is really unpacked with ReadProcessMemory

for a full description read the win32 SDK reference manual




DWORD WaitForInputIdle(

HANDLE hProcess, // handle to process
DWORD dwMilliseconds // time-out interval in milliseconds
);



The WaitForInputIdle function enables a thread to suspend its execution until a specified process has finished its initialization and is waiting for user input with no input pending.

--> thus once unpacked and waiting for input your code injector routine will then execute

I hope this helps

Best Wishes
R@dier

Last edited by R@dier; 10-28-2003 at 12:45.
Reply With Quote