예제 #1
0
        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);
        }
예제 #2
0
 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;
 }