public BinFileEntry(ref BinaryReader br, ref BinFilePropertiesTable propertiesTable) { this.Values = new List <BinFileValue>(); this.PropertiesTable = propertiesTable; this.Unknown = br.ReadUInt32(); }
public BinFileValue(ref BinaryReader br, BinFileValueType readType, ref object parent, ref BinFilePropertiesTable propertiesTable) { this.PropertiesTable = propertiesTable; this.Parent = RuntimeHelpers.GetObjectValue(parent); if (readType == (BinFileValueType)255) { this.bool_0 = true; this.Prop = this.PropertiesTable.GetProp(br.ReadUInt32()); this.ValueType = (BinFileValueType)br.ReadByte(); } else { this.bool_0 = false; this.ValueType = readType; } if (this.ValueType == BinFileValueType.StringValue) { ushort count = br.ReadUInt16(); this.Value = new string(br.ReadChars((int)count)); } else if (this.ValueType == BinFileValueType.SameTypeValuesList1) { this.Value = new BinFileValueList(ref br, this.ValueType, ref this.PropertiesTable); } else if (this.ValueType == BinFileValueType.SameTypeValuesList2) { this.Value = new BinFileValueList(ref br, this.ValueType, ref this.PropertiesTable); } else if (this.ValueType == BinFileValueType.ValuesList) { this.Value = new BinFileValueList(ref br, this.ValueType, ref this.PropertiesTable); } else if (this.ValueType == BinFileValueType.ValuesList2) { this.Value = new BinFileValueList(ref br, this.ValueType, ref this.PropertiesTable); } else if (this.ValueType == BinFileValueType.DoubleTypesValuesList) { this.Value = new BinFileValueList(ref br, this.ValueType, ref this.PropertiesTable); } else if (this.ValueType == BinFileValueType.FloatValue2) { this.Value = br.ReadSingle(); } else if (this.ValueType == BinFileValueType.const_4) { this.Value = br.ReadUInt32(); } else if (this.ValueType == BinFileValueType.const_3) { this.Value = br.ReadUInt32(); } else if (this.ValueType == BinFileValueType.const_11) { this.Value = br.ReadUInt32(); } else if (this.ValueType == BinFileValueType.BooleanValue) { this.Value = br.ReadBoolean(); } else if (this.ValueType == BinFileValueType.ByteVector4_2) { this.Value = br.ReadBytes(4); } else if (this.ValueType == BinFileValueType.ByteVector4_1) { this.Value = br.ReadBytes(4); } else if (this.ValueType == BinFileValueType.ByteValue2) { this.Value = br.ReadByte(); } else if (this.ValueType == BinFileValueType.FloatsVector2) { this.Value = new float[] { br.ReadSingle(), br.ReadSingle() }; } else if (this.ValueType == BinFileValueType.FloatsVector4) { this.Value = new float[] { br.ReadSingle(), br.ReadSingle(), br.ReadSingle(), br.ReadSingle() }; } else if (this.ValueType == BinFileValueType.FloatsVector3) { this.Value = new float[] { br.ReadSingle(), br.ReadSingle(), br.ReadSingle() }; } else if (this.ValueType == BinFileValueType.UShortsVector3) { this.Value = new ushort[] { br.ReadUInt16(), br.ReadUInt16(), br.ReadUInt16() }; } else { br = br; } }
public BinFileValueList(ref BinaryReader br, ValueType listType, ref BinFilePropertiesTable propertiesTable) { this.Entries = new List <BinFileValue>(); this.PropertiesTable = propertiesTable; this.ListType = ((listType != null) ? ((BinFileValueType)listType) : ((BinFileValueType)0)); checked { if (this.ListType == BinFileValueType.SameTypeValuesList1) { this.EntriesType = (BinFileValueType)br.ReadByte(); this.EntriesSize = br.ReadUInt32(); uint num = br.ReadUInt32(); long num2 = (long)(unchecked ((ulong)num) - 1uL); for (long num3 = 0L; num3 <= num2; num3 += 1L) { List <BinFileValue> arg_8E_0 = this.Entries; BinFileValueType arg_89_1 = this.EntriesType; object obj = this; arg_8E_0.Add(new BinFileValue(ref br, arg_89_1, ref obj, ref propertiesTable)); } } else if (this.ListType == BinFileValueType.SameTypeValuesList2) { this.EntriesType = (BinFileValueType)br.ReadByte(); byte b = br.ReadByte(); int num4 = (int)(b - 1); for (int i = 0; i <= num4; i++) { List <BinFileValue> arg_EA_0 = this.Entries; BinFileValueType arg_E5_1 = this.EntriesType; object obj = this; arg_EA_0.Add(new BinFileValue(ref br, arg_E5_1, ref obj, ref propertiesTable)); } } else if (this.ListType == BinFileValueType.ValuesList) { this.Prop = this.PropertiesTable.GetProp(br.ReadUInt32()); this.EntriesSize = br.ReadUInt32(); this.EntriesType = (BinFileValueType)255; ushort num5 = br.ReadUInt16(); int num6 = (int)(num5 - 1); for (int j = 0; j <= num6; j++) { List <BinFileValue> arg_164_0 = this.Entries; BinFileValueType arg_15F_1 = this.EntriesType; object obj = this; arg_164_0.Add(new BinFileValue(ref br, arg_15F_1, ref obj, ref propertiesTable)); } } else if (this.ListType == BinFileValueType.ValuesList2) { this.Prop = this.PropertiesTable.GetProp(br.ReadUInt32()); this.EntriesSize = br.ReadUInt32(); this.EntriesType = (BinFileValueType)255; ushort num7 = br.ReadUInt16(); int num8 = (int)(num7 - 1); for (int k = 0; k <= num8; k++) { List <BinFileValue> arg_1DE_0 = this.Entries; BinFileValueType arg_1D9_1 = this.EntriesType; object obj = this; arg_1DE_0.Add(new BinFileValue(ref br, arg_1D9_1, ref obj, ref propertiesTable)); } } else if (this.ListType == BinFileValueType.DoubleTypesValuesList) { this.EntriesTypes = new BinFileValueType[] { (BinFileValueType)br.ReadByte(), (BinFileValueType)br.ReadByte() }; this.EntriesSize = br.ReadUInt32(); uint num9 = br.ReadUInt32(); long num10 = (long)(unchecked ((ulong)num9) - 1uL); for (long num11 = 0L; num11 <= num10; num11 += 1L) { List <BinFileValue> arg_261_0 = this.Entries; BinFileValueType arg_25C_1 = this.EntriesTypes[0]; object obj = this; arg_261_0.Add(new BinFileValue(ref br, arg_25C_1, ref obj, ref propertiesTable)); List <BinFileValue> arg_280_0 = this.Entries; BinFileValueType arg_27B_1 = this.EntriesTypes[1]; obj = this; arg_280_0.Add(new BinFileValue(ref br, arg_27B_1, ref obj, ref propertiesTable)); } } } }