Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suspending the execution of a remote process (C, Windows)

I can suspend a thread of another process by using SuspendThread(). Is there any way to also suspend the execution of that process altogether? If yes, please post code.

Thanks.

PS: Since you will ask "Why do you want to do this" I'll post it here. I am dealing with legacy software that is not maintained anymore. I don't have access to the source code. Right now I need it to pause until a file is filled with data and then resume the execution.

like image 786
wonderer Avatar asked Aug 07 '09 13:08

wonderer


People also ask

How do I suspend a process in Powershell?

Running PsSuspend with a process ID directs it to suspend or resume the process of that ID on the local computer. If you specify a process name PsSuspend will suspend or resume all processes that have that name. Specify the -r switch to resume suspended processes.

How do I suspend a thread in Windows?

If a thread is created in a suspended state (with the CREATE_SUSPENDED flag), it does not begin to execute until another thread calls the ResumeThread function with a handle to the suspended thread. This can be useful for initializing the thread's state before it begins to execute.

How to kill a process on a remote computer?

How to kill process on remote computer? In Windows, we can kill processes running on a remote computer using the taskkill command. We can specify process id/image file name/user name to identify the processes that need to be killed.

How do I manage Windows processes remotely?

Today, we’ll show you seven ways you can “manage” Windows processes remotely in general. By manage we mean start, query, and kill a remote Windows process. Keep in mind pretty much all of these tools and techniques here assume you have appropriate permissions on the remote computer. 1. PsExec, PowerShell, and WMI

How to query the current process list of a remote computer?

Without interactively connecting to a remote Windows computer you can easily query its current list of processes with a variety of tools. Since Windows XP there is a built-in command line utility named “ tasklist “.

What happens when a thread is suspended in C++?

A thread can suspend and resume the execution of another thread. While a thread is suspended, it is not scheduled for time on the processor. If a thread is created in a suspended state (with the CREATE_SUSPENDED flag), it does not begin to execute until another thread calls the ResumeThread function with a handle to the suspended thread.


1 Answers

The only way is to suspend all threads of that process.

If you want to see actual code, check the sample here.

like image 195
Kirill V. Lyadvinsky Avatar answered Oct 19 '22 11:10

Kirill V. Lyadvinsky