diff --git a/pe/file.go b/pe/file.go index 6945904..06c46b6 100644 --- a/pe/file.go +++ b/pe/file.go @@ -98,7 +98,7 @@ func newFileInternal(r io.ReaderAt, memoryMode bool) (*File, error) { binary.Read(sr, binary.LittleEndian, &f.DosHeader) dosHeaderSize := binary.Size(f.DosHeader) - if dosHeaderSize > int(f.DosHeader.AddressOfNewExeHeader) { + if dosHeaderSize < int(f.DosHeader.AddressOfNewExeHeader) { binary.Read(sr, binary.LittleEndian, &f.DosStub) f.DosExists = true } else { @@ -441,7 +441,7 @@ func (e *FormatError) Error() string { return "unknown error" } -//RVAToFileOffset Converts a Relative offset to the actual offset in the file. +// RVAToFileOffset Converts a Relative offset to the actual offset in the file. func (f *File) RVAToFileOffset(rva uint32) uint32 { var offset uint32 for _, section := range f.Sections { @@ -452,7 +452,7 @@ func (f *File) RVAToFileOffset(rva uint32) uint32 { return offset } -//IsManaged returns true if the loaded PE file references the CLR header (aka is a .net exe) +// IsManaged returns true if the loaded PE file references the CLR header (aka is a .net exe) func (f *File) IsManaged() bool { switch v := f.OptionalHeader.(type) { case *OptionalHeader32: