private bool e(ulong gn) { if (h[(uint)gn] == 13) { int num = Convert.ToInt32(decimal.Subtract(new decimal(a(Convert.ToInt32(decimal.Add(new decimal(gn), 3m)), 2)), 1m)); int num2 = 0; if (l != null) { num2 = l.Length; l = (ROW[])Utils.CopyArray(l, new ROW[l.Length + num + 1]); } else { l = new ROW[num + 1]; } int num3 = num; for (int i = 0; i <= num3; i++) { SZ[] array = null; ulong num4 = a(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(gn), 8m), new decimal(i * 2))), 2); if (decimal.Compare(new decimal(gn), 100m) != 0) { num4 += gn; } int num5 = c((int)num4); b((int)num4, num5); int num6 = c(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), decimal.Subtract(new decimal(num5), new decimal(num4))), 1m))); l[num2 + i].ID = b(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 = c((int)num4); num6 = num5; long num7 = b((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 = c(num5); array[num9].Type = b(num5, num6); if (array[num9].Type > 9) { if (ItIsOdd(array[num9].Type)) { array[num9].Size = (long)Math.Round((double)(array[num9].Type - 13) / 2.0); } else { array[num9].Size = (long)Math.Round((double)(array[num9].Type - 12) / 2.0); } } else { array[num9].Size = m[(int)array[num9].Type]; } num8 = num8 + (num6 - num5) + 1; num9++; } l[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 > 9) { if (!ItIsOdd(array[j].Type)) { if (decimal.Compare(new decimal(this.i), 1m) == 0) { l[num2 + i].RowData[j] = Encoding.Default.GetString(h, 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.i), 2m) == 0) { l[num2 + i].RowData[j] = Encoding.Unicode.GetString(h, 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.i), 3m) == 0) { l[num2 + i].RowData[j] = Encoding.BigEndianUnicode.GetString(h, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num7)), new decimal(num10))), (int)array[j].Size); } } else { l[num2 + i].RowData[j] = Encoding.Default.GetString(h, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num7)), new decimal(num10))), (int)array[j].Size); } } else { l[num2 + i].RowData[j] = Convert.ToString(a(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 (h[(uint)gn] == 5) { int num12 = Convert.ToUInt16(decimal.Subtract(new decimal(a(Convert.ToInt32(decimal.Add(new decimal(gn), 3m)), 2)), 1m)); for (int k = 0; k <= num12; k++) { ushort num13 = (ushort)a(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(gn), 12m), new decimal(k * 2))), 2); e(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(a((int)(gn + num13), 4)), 1m), new decimal(this.j)))); } e(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(a(Convert.ToInt32(decimal.Add(new decimal(gn), 8m)), 4)), 1m), new decimal(this.j)))); } return(true); }
private bool ReadDataEntriesFromOffsets(ulong Offset) { if (DataArray[(uint)Offset] == 13) { int num = Convert.ToInt32(decimal.Subtract(new decimal(ToUInt64(Convert.ToInt32(decimal.Add(new decimal(Offset), 3m)), 2)), decimal.One)); int num2 = 0; if (SqlRows != null) { num2 = SqlRows.Length; SqlRows = (ROW[])Utils.CopyArray(SqlRows, new ROW[SqlRows.Length + num + 1]); } else { SqlRows = new ROW[num + 1]; } int num3 = num; for (int i = 0; i <= num3; i++) { SZ[] array = null; ulong num4 = 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 values = GetValues((int)num4); CalcVertical((int)num4, values); int values2 = GetValues(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), decimal.Subtract(new decimal(values), new decimal(num4))), decimal.One))); SqlRows[num2 + i].ID = CalcVertical(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), decimal.Subtract(new decimal(values), new decimal(num4))), decimal.One)), values2); num4 = Convert.ToUInt64(decimal.Add(decimal.Add(new decimal(num4), decimal.Subtract(new decimal(values2), new decimal(num4))), decimal.One)); values = GetValues((int)num4); values2 = values; long num5 = CalcVertical((int)num4, values); long num6 = Convert.ToInt64(decimal.Add(decimal.Subtract(new decimal(num4), new decimal(values)), decimal.One)); int num7 = 0; while (num6 < num5) { array = (SZ[])Utils.CopyArray(array, new SZ[num7 + 1]); values = values2 + 1; values2 = GetValues(values); array[num7].Type = CalcVertical(values, values2); if (array[num7].Type > 9) { if (ItIsOdd(array[num7].Type)) { array[num7].Size = (long)Math.Round((double)(array[num7].Type - 13) / 2.0); } else { array[num7].Size = (long)Math.Round((double)(array[num7].Type - 12) / 2.0); } } else { array[num7].Size = SQLDataTypeSize[(int)array[num7].Type]; } num6 = num6 + (values2 - values) + 1; num7++; } SqlRows[num2 + i].RowData = new string[array.Length - 1 + 1]; int num8 = 0; int num9 = array.Length - 1; for (int j = 0; j <= num9; j++) { if (array[j].Type > 9) { if (!ItIsOdd(array[j].Type)) { if (decimal.Compare(new decimal(DataEncoding), decimal.One) == 0) { SqlRows[num2 + i].RowData[j] = Encoding.Default.GetString(DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num5)), new decimal(num8))), (int)array[j].Size); } else if (decimal.Compare(new decimal(DataEncoding), 2m) == 0) { SqlRows[num2 + i].RowData[j] = Encoding.Unicode.GetString(DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num5)), new decimal(num8))), (int)array[j].Size); } else if (decimal.Compare(new decimal(DataEncoding), 3m) == 0) { SqlRows[num2 + i].RowData[j] = Encoding.BigEndianUnicode.GetString(DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num5)), new decimal(num8))), (int)array[j].Size); } } else { SqlRows[num2 + i].RowData[j] = Encoding.Default.GetString(DataArray, Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num5)), new decimal(num8))), (int)array[j].Size); } } else { SqlRows[num2 + i].RowData[j] = Convert.ToString(ToUInt64(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(num4), new decimal(num5)), new decimal(num8))), (int)array[j].Size)); } num8 += (int)array[j].Size; } } } else if (DataArray[(uint)Offset] == 5) { int num10 = Convert.ToUInt16(decimal.Subtract(new decimal(ToUInt64(Convert.ToInt32(decimal.Add(new decimal(Offset), 3m)), 2)), decimal.One)); for (int k = 0; k <= num10; k++) { ushort num11 = (ushort)ToUInt64(Convert.ToInt32(decimal.Add(decimal.Add(new decimal(Offset), 12m), new decimal(k * 2))), 2); ReadDataEntriesFromOffsets(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(ToUInt64((int)(Offset + num11), 4)), decimal.One), new decimal(PageSize)))); } ReadDataEntriesFromOffsets(Convert.ToUInt64(decimal.Multiply(decimal.Subtract(new decimal(ToUInt64(Convert.ToInt32(decimal.Add(new decimal(Offset), 8m)), 4)), decimal.One), new decimal(PageSize)))); } return(true); }