diff --git a/src/pefile.cpp b/src/pefile.cpp index 7d3c10de..89fd6e81 100644 --- a/src/pefile.cpp +++ b/src/pefile.cpp @@ -164,7 +164,7 @@ int PeFile::readFileHeader() { unsigned const delta = (h.relocoffs >= 0x40) ? h.nexepos // new format exe - : (h.p512*512+h.m512 - h.m512 ? 512 : 0); + : (h.p512*512+h.m512 - h.m512 ? 512 : h.nexepos); if ((pe_offset + delta) < delta // wrap-around || (pe_offset + delta) > (unsigned)file_size) {