Hack Forums
[.NET] Stopping certain processes - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Stopping certain processes (/showthread.php?tid=5057695)



Stopping certain processes - mr.sp00ks - Nov 14, 2015

Hello, I have a question on a certain project I am making.
Is it possible when a program is launched that it will stop certain processes like taskmgr.exe?

Like if something is launched it will immediatly kill a process with administrative privileges?


* - Odus - Nov 14, 2015

Sure. Put your (obsolete) evasive measures in the Form_Load event.


* - mr.sp00ks - Nov 14, 2015

Thank you so much for the fast response.


* - nathan72389 - Nov 14, 2015

(Nov 14, 2015 11:34 AM)Odus Wrote:  Sure. Put your (obsolete) evasive measures in the Form_Load event.

it makes it even funnier because he thanked you.


* - He B TeMy - Nov 14, 2015

https://msdn.microsoft.com/en-us/library/system.diagnostics.process%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396


* - mr.sp00ks - Nov 14, 2015

(Nov 14, 2015 11:55 AM)nathan72389 Wrote:  it makes it even funnier because he thanked you.

The sarcasm?


(Nov 14, 2015 12:36 PM)He B TeMy Wrote:  -snip-

Thanks for a serious actual response


* - nathan72389 - Nov 14, 2015

Thanks OP, this will help me out alot.


* - excr4sh - Nov 14, 2015

If you go for Win32, open a handle to the process with OpenProcess then call TerminateProcess. Note that TerminateProcess requires the handle to have PROCESS_TERMINATE access right.


* - He B TeMy - Nov 14, 2015

(Nov 14, 2015 03:42 PM)FordCl Wrote:  If you go for Win32, open a handle to the process with OpenProcess then call TerminateProcess. Note that TerminateProcess requires the handle to have PROCESS_TERMINATE access right.

Yea, and what do you use to get the PID? If you're telling someone to make calls to native api's using .net while there's built-in classes for it, at least specify the required API's.