Pause Code execution in a foreign process
-
- Posts: 75
- Joined: Sun Oct 31, 2004 5:45 am
Pause Code execution in a foreign process
Is it possible to inject some kind of API into a foreign process and Pause it's Code execution until i notify it to finish.
kind of like using Sleep() api in our own code to pause the execution but i want it done on a foreign process...
By the way i tried using that but it didn't work... instead my own application stoped processing while the foreign application was still doing it's business as usual.
Thanks.
kind of like using Sleep() api in our own code to pause the execution but i want it done on a foreign process...
By the way i tried using that but it didn't work... instead my own application stoped processing while the foreign application was still doing it's business as usual.
Thanks.
Sleep only impacts the current thread. So it won't help. You could use SuspendThread for all threads of the target process. But this can have strange effects. If you suspend a thread while it's doing something *very* important, you might freeze the whole OS. This can happen on Hyperthreading and SMP machines. Rarely, but possible.
If you don't care about that (though you should) you can use madKernel like this:
uses madKernel;
begin
Process('someProcess.exe').Suspend;
As easy as that.
If you don't care about that (though you should) you can use madKernel like this:
uses madKernel;
begin
Process('someProcess.exe').Suspend;
As easy as that.
-
- Posts: 75
- Joined: Sun Oct 31, 2004 5:45 am
-
- Posts: 75
- Joined: Sun Oct 31, 2004 5:45 am
-
- Posts: 75
- Joined: Sun Oct 31, 2004 5:45 am