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 uint ReadPEHeaderOffset() { HasValidDosSignature.CheckThrowing(); return(_headerReader.Read <uint>(PESignatureOffsetLocation)); }