public ModuleInfo(IServiceContainer ctx, SpanStream __stream) : base(__stream) { DBIReader dbi = ctx.GetService<DBIReader>(); this.EC = dbi.EC; OpenModuleHandle = ReadUInt32(); SectionContribution = new SectionContrib(this); Position += SectionContrib.SIZE; Flags = new ModuleInfoFlags(ReadUInt16()); StreamNumber = ReadInt16(); SymbolsSize = ReadUInt32(); LinesSize = ReadUInt32(); C13LinesSize = ReadUInt32(); NumberOfFiles = ReadUInt16(); ReadUInt16(); FileNameOffsets = ReadUInt32(); ECInfo = Read<ECInfo>(); ModuleName = ReadCString(); ObjectFileName = ReadCString(); }
/** * Layout of the DBI stream * -> Header * -> ModuleList * -> SectionContributions * -> SectionMap * -> FileInfo * -> TypeServerMap * -> EcSubstream * -> DebugHeader **/ public DBIReader(IServiceContainer ctx, byte[] data) : base(data) { this.ctx = ctx; if (Length == 0) { return; } if (Length < Marshal.SizeOf <DBIHeader>()) { throw new InvalidDataException(); } Header = Read <DBIHeader>(); if (Header.Signature != unchecked ((uint)-1) || !Enum.IsDefined(typeof(DBIVersion), (uint)Header.Version)) { throw new InvalidDataException(); } this.StreamTable = ctx.GetService <StreamTableReader>(); uint nStreams = StreamTable.NumStreams; if ( Header.GsSymbolsStreamNumber >= nStreams || Header.PsSymbolsStreamNumber >= nStreams || Header.SymbolRecordsStreamNumber >= nStreams ) { throw new InvalidDataException(); } lazyModuleContainers = LazyFactory.CreateLazy(ReadModules); Position += Header.ModuleListSize; if (Header.SectionContributionSize > 0) { SectionContribs = new SectionContribsReader(Header.SectionContributionSize, this); } Position += Header.SectionContributionSize; Position += Header.SectionMapSize; Position += Header.FileInfoSize; if (Header.TypeServerMapSize > 0) { TypeServerMap = new TypeServerMapReader(this); } Position += Header.TypeServerMapSize; if (Header.EcSubstreamSize > 0) { EC = new ECReader(this); } Position += Header.EcSubstreamSize; if (Header.DebugHeaderSize > 0) { DebugInfo = new DebugReader(ctx, this); } }