コード例 #1
0
 // Token: 0x0600001C RID: 28 RVA: 0x000033FC File Offset: 0x000015FC
 private bool ReadTableFromOffset(ulong Offset)
 {
     if (this.DataArray[(int)Offset] == 13)
     {
         int num  = Convert.ToInt32(decimal.Subtract(new decimal(this.ConvertToInteger(Convert.ToInt32(decimal.Add(new decimal(Offset), 3m)), 2)), 1m));
         int num2 = 0;
         if (this.DataRows != null)
         {
             num2          = this.DataRows.Length;
             this.DataRows = (DataRow[])Utils.CopyArray(this.DataRows, new DataRow[this.DataRows.Length + num + 1]);
         }
         else
         {
             this.DataRows = new DataRow[num + 1];
         }
         int num3 = num;
         for (int i = 0; i <= num3; i++)
         {
             FieldHeader[] array = null;
             ulong         num4  = this.ConvertToInteger(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.GVL((int)num4);
             this.CVL((int)num4, num5);
             int num6 = this.GVL(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), decimal.Subtract(new decimal(num5), new decimal(num4))), 1m)));
             this.DataRows[num2 + i].RowID = this.CVL(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.GVL((int)num4);
             num6 = num5;
             long num7 = this.CVL((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            = (FieldHeader[])Utils.CopyArray(array, new FieldHeader[num9 + 1]);
                 num5             = num6 + 1;
                 num6             = this.GVL(num5);
                 array[num9].Type = this.CVL(num5, num6);
                 if (array[num9].Type > 9L)
                 {
                     if (SQLiteManager.IsOdd(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.DataRows[num2 + i].Content = 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 (!SQLiteManager.IsOdd(array[j].Type))
                     {
                         if (decimal.Compare(new decimal(this.DataEncoding), 1m) == 0)
                         {
                             this.DataRows[num2 + i].Content[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.DataRows[num2 + i].Content[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.DataRows[num2 + i].Content[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.DataRows[num2 + i].Content[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.DataRows[num2 + i].Content[j] = Convert.ToString(this.ConvertToInteger(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)Offset] == 5)
     {
         int num12 = (int)Convert.ToUInt16(decimal.Subtract(new decimal(this.ConvertToInteger(Convert.ToInt32(decimal.Add(new decimal(Offset), 3m)), 2)), 1m));
         for (int k = 0; k <= num12; k++)
         {
             ushort num13 = (ushort)this.ConvertToInteger(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(Offset), 12m), new decimal(k * 2))), 2);
             this.ReadTableFromOffset(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ConvertToInteger((int)(Offset + (ulong)num13), 4)), 1m), new decimal((int)this.PageSize))));
         }
         this.ReadTableFromOffset(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ConvertToInteger(Convert.ToInt32(decimal.Add(new decimal(Offset), 8m)), 4)), 1m), new decimal((int)this.PageSize))));
     }
     return(true);
 }
コード例 #2
0
 // Token: 0x0600001B RID: 27 RVA: 0x00002BD4 File Offset: 0x00000DD4
 private void ReadMasterTable(ulong Offset)
 {
     if (this.DataArray[(int)Offset] == 13)
     {
         ushort num  = Convert.ToUInt16(decimal.Subtract(new decimal(this.ConvertToInteger(Convert.ToInt32(decimal.Add(new decimal(Offset), 3m)), 2)), 1m));
         int    num2 = 0;
         if (this.MasterEntries != null)
         {
             num2 = this.MasterEntries.Length;
             this.MasterEntries = (MasterEntry[])Utils.CopyArray(this.MasterEntries, new MasterEntry[this.MasterEntries.Length + (int)num + 1]);
         }
         else
         {
             this.MasterEntries = new MasterEntry[(int)(num + 1)];
         }
         int num3 = (int)num;
         for (int i = 0; i <= num3; i++)
         {
             ulong num4 = this.ConvertToInteger(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.GVL((int)num4);
             this.CVL((int)num4, num5);
             int num6 = this.GVL(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), decimal.Subtract(new decimal(num5), new decimal(num4))), 1m)));
             this.MasterEntries[num2 + i].RowID = this.CVL(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.GVL((int)num4);
             num6 = num5;
             long   value = this.CVL((int)num4, num5);
             long[] array = new long[5];
             int    num7  = 0;
             do
             {
                 num5        = num6 + 1;
                 num6        = this.GVL(num5);
                 array[num7] = this.CVL(num5, num6);
                 if (array[num7] > 9L)
                 {
                     if (SQLiteManager.IsOdd(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);
             if (decimal.Compare(new decimal(this.DataEncoding), 1m) == 0)
             {
                 this.MasterEntries[num2 + i].ItemType = Encoding.Default.GetString(this.DataArray, Convert.ToInt32(decimal.Add(new decimal(num4), new decimal(value))), (int)array[0]);
             }
             else if (decimal.Compare(new decimal(this.DataEncoding), 2m) == 0)
             {
                 this.MasterEntries[num2 + i].ItemType = Encoding.Unicode.GetString(this.DataArray, Convert.ToInt32(decimal.Add(new decimal(num4), new decimal(value))), (int)array[0]);
             }
             else if (decimal.Compare(new decimal(this.DataEncoding), 3m) == 0)
             {
                 this.MasterEntries[num2 + i].ItemType = Encoding.BigEndianUnicode.GetString(this.DataArray, Convert.ToInt32(decimal.Add(new decimal(num4), new decimal(value))), (int)array[0]);
             }
             if (decimal.Compare(new decimal(this.DataEncoding), 1m) == 0)
             {
                 this.MasterEntries[num2 + i].ItemName = Encoding.Default.GetString(this.DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(value)), new decimal(array[0]))), (int)array[1]);
             }
             else if (decimal.Compare(new decimal(this.DataEncoding), 2m) == 0)
             {
                 this.MasterEntries[num2 + i].ItemName = Encoding.Unicode.GetString(this.DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(value)), new decimal(array[0]))), (int)array[1]);
             }
             else if (decimal.Compare(new decimal(this.DataEncoding), 3m) == 0)
             {
                 this.MasterEntries[num2 + i].ItemName = Encoding.BigEndianUnicode.GetString(this.DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(value)), new decimal(array[0]))), (int)array[1]);
             }
             this.MasterEntries[num2 + i].RootNum = (long)this.ConvertToInteger(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]);
             if (decimal.Compare(new decimal(this.DataEncoding), 1m) == 0)
             {
                 this.MasterEntries[num2 + i].SqlStatement = Encoding.Default.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]);
             }
             else if (decimal.Compare(new decimal(this.DataEncoding), 2m) == 0)
             {
                 this.MasterEntries[num2 + i].SqlStatement = Encoding.Unicode.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]);
             }
             else if (decimal.Compare(new decimal(this.DataEncoding), 3m) == 0)
             {
                 this.MasterEntries[num2 + i].SqlStatement = Encoding.BigEndianUnicode.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)Offset] == 5)
     {
         int num8 = (int)Convert.ToUInt16(decimal.Subtract(new decimal(this.ConvertToInteger(Convert.ToInt32(decimal.Add(new decimal(Offset), 3m)), 2)), 1m));
         for (int j = 0; j <= num8; j++)
         {
             ushort num9 = (ushort)this.ConvertToInteger(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(Offset), 12m), new decimal(j * 2))), 2);
             if (decimal.Compare(new decimal(Offset), 100m) == 0)
             {
                 this.ReadMasterTable(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ConvertToInteger((int)num9, 4)), 1m), new decimal((int)this.PageSize))));
             }
             else
             {
                 this.ReadMasterTable(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ConvertToInteger((int)(Offset + (ulong)num9), 4)), 1m), new decimal((int)this.PageSize))));
             }
         }
         this.ReadMasterTable(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(this.ConvertToInteger(Convert.ToInt32(decimal.Add(new decimal(Offset), 8m)), 4)), 1m), new decimal((int)this.PageSize))));
     }
 }