public void Read(ExtBinaryReader reader) { signature = reader.ReadArrayOfPrimitives(reader.ReadInt32(), reader.ReadByte); if (Equals(signature, CorrectSignature)) { throw new Exception("Incorrect file. Wrong signature"); } formatVersion = reader.ReadInt32(); platformNameIndex = reader.ReadInt32(); platformVersion = reader.ReadInt32(); entryPoint = reader.ReadInt64(); }
public void Read(ExtBinaryReader reader) { moduleHeader.Read(reader); tablesHeader.Read(reader); sections = reader.ReadArrayOfReadables <SectionLayout>(tablesHeader.sectionsCount); symbols = reader.ReadArrayOfReadables <SymbolLayout>(tablesHeader.symbolsCount); sourceFiles = reader.ReadArrayOfReadables <SourceFileLayout>(tablesHeader.sourceFilesCount); sourceTextRanges = reader.ReadArrayOfReadables <SourceTextRangeLayout>(tablesHeader.sourceTextRangesCount); sourceCodePoints = reader.ReadArrayOfReadables <SourceCodePointLayout>(tablesHeader.sourceCodePointsCount); int[] blobLengths = reader.ReadArrayOfPrimitives(tablesHeader.blobsCount, reader.ReadInt32); blobs = new BlobLayout[tablesHeader.blobsCount]; for (int i = 0; i < tablesHeader.blobsCount; i++) { blobs[i].data = reader.ReadBytes(blobLengths[i]); } strings = reader.ReadArrayOfReadables <StringLayout>(tablesHeader.stringsCount); }