public override bool Initialize() { var reader = new PeHeadersReader(file, peFileLayoutProviders); if (reader.Read()) { peHeadersImpl = new PeHeadersImpl(reader, file.Span); peHeadersSpan = GetSpan(peHeadersImpl.DosHeader.Span.Span, peHeadersImpl.FileHeader.Span.Span, peHeadersImpl.OptionalHeader.Span.Span, peHeadersImpl.Sections.Span.Span); } return(peHeadersImpl != null); }
public PeHeadersImpl(PeHeadersReader reader, HexSpan fileSpan) { if (reader == null) { throw new ArgumentNullException(nameof(reader)); } DosHeader = reader.DosHeader; FileHeader = reader.FileHeader; OptionalHeader = reader.OptionalHeader; Sections = reader.Sections; IsFileLayout = reader.IsFileLayout; SectionHeaders = reader.SectionHeaders; this.fileSpan = fileSpan; }