diff --git a/include/retdec/pelib/PeLibAux.h b/include/retdec/pelib/PeLibAux.h index 6b94e17ab..395d8dbe7 100644 --- a/include/retdec/pelib/PeLibAux.h +++ b/include/retdec/pelib/PeLibAux.h @@ -156,6 +156,8 @@ namespace PeLib const std::uint32_t PE_MAX_SECTION_COUNT_XP = 96; const std::uint32_t PE_MAX_SECTION_COUNT_7 = 192; + const std::uint32_t PELIB_IMAGE_DEBUG_INFO_CODEVIEW = 2; + const std::uint32_t PELIB_SECTOR_SIZE = 0x200; const std::uint32_t PELIB_IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16; diff --git a/src/pelib/DebugDirectory.cpp b/src/pelib/DebugDirectory.cpp index 1239409ac..6208af07a 100644 --- a/src/pelib/DebugDirectory.cpp +++ b/src/pelib/DebugDirectory.cpp @@ -81,7 +81,7 @@ namespace PeLib for (std::size_t i = 0; i < entryCount; i++) { bytesRead = imageLoader.readImage(&iddCurr.idd, rva, sizeof(PELIB_IMAGE_DEBUG_DIRECTORY)); - if(bytesRead != sizeof(PELIB_IMAGE_DEBUG_DIRECTORY)) + if(bytesRead != sizeof(PELIB_IMAGE_DEBUG_DIRECTORY) || iddCurr.idd.Type != PELIB_IMAGE_DEBUG_INFO_CODEVIEW) break; debugInfo.push_back(iddCurr);