-5

TLDR; Just like Voodooshield or other application whitelisters do.

I want to prevent apps from spawning or if not possible kill them as soon as they spawn. So my question is: would it be possible to subscribe and interfere the spawn process with C# or (more likely) with the win32 API?

  • It is done with a Driver and [CreateProcessNotifyEx](https://learn.microsoft.com/en-us/previous-versions/ff542860%28v%3Dvs.85%29) – Castorix Jul 14 '19 at 09:50

1 Answers1

-1

You can get all running processes using the Process class in System.Diagnostics.

class Program
{
    static void Main(string[] args)
    {
        while (true)
        {

            foreach (var item in Process.GetProcesses())
            {
                /*Kills all chrome.exe processes*/
                /*Replace chrome with the process you want to kill*/
                if (item.ProcessName == "chrome")
                {
                    //Kills the process
                    item.Kill();
                }
            }
        }
    }
}