public bool IsValid() { if (_headerReader.Length > sizeof(ushort)) { try { if (HasValidDosSignature.Check()) { if (_headerReader.Length > PESignatureOffsetLocation) { return(HasValidPESignature.Check()); } } } catch (Exception ex) when(ex is InvalidVirtualAddressException || ex is BadInputFormatException) { } } return(false); }
private ImageFileHeader ReadFileHeader() { HasValidPESignature.CheckThrowing(); return(_headerReader.Read <ImageFileHeader>(PEHeaderOffset + 0x4)); }
private CoffFileHeader ReadCoffFileHeader() { HasValidPESignature.CheckThrowing(); return(_peHeaderReader.Read <CoffFileHeader>(PEHeaderOffset + 0x4)); }