Example #1
0
		private void ReadLBL1(BinaryReaderX br)
		{
			// TODO: Continue reverse engineering the LBL1 section because the magic value below shouldn't be the end game
			long offset = br.BaseStream.Position;
			LBL1.Identifier = br.ReadBytes(4);
			LBL1.SectionSize = br.ReadUInt32();
			LBL1.Unknown1 = br.ReadBytes(8);
			LBL1.Unknown2 = br.ReadBytes(8);
			uint startOfLabels = 0x35C; // Magic LBL1 label start position
			LBL1.Unknown3 = br.ReadBytes((int)(startOfLabels - br.BaseStream.Position));

			while (br.BaseStream.Position < (offset + LBL1.Identifier.Length + sizeof(UInt32) + LBL1.Unknown1.Length + LBL1.SectionSize))
			{
				Entry lbl = new Entry();
				lbl.Length = Convert.ToUInt32(br.ReadByte());
				lbl.Value = br.ReadBytes((int)lbl.Length);
				lbl.Index = br.ReadInt32();
				LBL1.Labels.Add(lbl);
			}

			HasLabels = LBL1.Labels.Count > 0;

			PaddingSeek(br);
		}