{"id":23,"date":"2008-12-08T23:38:00","date_gmt":"2008-12-08T23:38:00","guid":{"rendered":"http:\/\/projects-sanil.co.cc\/ProjectsBlog\/post.aspx?id=9fd179c4-f79b-4189-8f6b-b1980e546e57"},"modified":"2008-12-08T23:38:00","modified_gmt":"2008-12-08T23:38:00","slug":"disabling-task-manager-on-windows-in-net-way-hack","status":"publish","type":"post","link":"https:\/\/inullable.in\/blog\/?p=23","title":{"rendered":"Disabling Task Manager on Windows in .NET way hack"},"content":{"rendered":"<p>\nBy now, all of you ( &amp; yours truly ) using windows must have encountered the situation, when you press your favorite savior Ctrl + Alt + Del, and your &quot;Task Manager&quot; doesn&#39;t pops up and you are in hell&#8230;\n<\/p>\n<p>\nSometimes, scanning registry fixes it, if poor virus has just disabled TM through reg key hack, but what if you don&#39;t want to hack reg\/ probably you don&#39;t know the hive in which TM keys are set.\n<\/p>\n<p>\nThere is a simple way to do this, Kill the poor TM, before it has a chance to help its poor user (and you are the murderer). The .NET base class provides a very easy way to do this (And me and you thought .NET is like angel Java, meant to do only good things), here it is:\n<\/p>\n<p>\nuse the static Process class defined in .NET namespace <strong>System.Diagnostics<\/strong>\n<\/p>\n<p>\n<font color=\"#0000ff\">using System; <br \/>\nusing System.Collections.Generic; <br \/>\nusing System.Windows.Forms; <br \/>\n<strong>using System.Diagnostics;<\/strong> <br \/>\nusing System.Threading; <br \/>\nnamespace ProcKiller <br \/>\n{ <br \/>\n&nbsp;&nbsp;&nbsp; static class Program <br \/>\n&nbsp;&nbsp;&nbsp; { <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/\/ &lt;summary&gt; <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/\/ The main entry point for the application. <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/\/ &lt;\/summary&gt; <\/font>\n<\/p>\n<p>\n<font color=\"#0000ff\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [STAThread] <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static void Main() <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string[] ProcName = new string[1];<\/font>\n<\/p>\n<p><font color=\"#0000ff\"><\/p>\n<blockquote>\n<p>\n\t<font color=\"#00ff00\"><font color=\"#008000\">\/\/ We are defining here our targets, which we will kill, if present | Hell yeah! its a bloody game&#8230;<\/font> <br \/>\n\t<\/font>ProcName[0] = &quot;taskmgr&quot;;\n\t<\/p>\n<\/blockquote>\n<p>\n<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (true) <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (string Proc in ProcName) <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Process[] Pro = Process.GetProcessesByName(Proc); <font color=\"#008000\">\/\/ using System.Diagnostics.Process<\/font>\n<\/p>\n<p>\n<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/dummy catch &#8211; do nothing <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Threading.Thread.Sleep(100); <font color=\"#008000\">\/\/ Use this line, if you don&#39;t want the CPU usage to pop to ~ 90 &#8211; 100%<\/font> <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br \/>\n&nbsp;&nbsp;&nbsp; } <br \/>\n}\n<\/p>\n<p><strong>Assignment : use this implementation to do something useful, non-annoying (really useful), by the way, I have already done one <\/strong><strong><\/p>\n<p>\n<strong>final word to my close friends:<\/strong> Don&#39;t even think of using it against me, I already have my own defenders and weaponery\n<\/p>\n<p>\n&nbsp;\n<\/p>\n<p>\np.s: if you get stuck in how to really make it, or how to get rid of it, once it start running, mail me your problem specifically and briefly to <a href=\"mailto:Sanil.Sun@Gmail.com\">mailto:Sanil.Sun@Gmail.com<\/a>\n<\/p>\n<p><\/strong><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By now, all of you ( &amp; yours truly ) using windows must have encountered the situation, when you press your favorite savior Ctrl + Alt + Del, and your &quot;Task Manager&quot; doesn&#39;t pops up and you are in hell&#8230; Sometimes, scanning registry fixes it, if poor virus has just disabled TM through reg key [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,81,91],"tags":[],"_links":{"self":[{"href":"https:\/\/inullable.in\/blog\/index.php?rest_route=\/wp\/v2\/posts\/23"}],"collection":[{"href":"https:\/\/inullable.in\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inullable.in\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inullable.in\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inullable.in\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23"}],"version-history":[{"count":0,"href":"https:\/\/inullable.in\/blog\/index.php?rest_route=\/wp\/v2\/posts\/23\/revisions"}],"wp:attachment":[{"href":"https:\/\/inullable.in\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inullable.in\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inullable.in\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}