Skip to content

Commit

Permalink
Debug info is only accepted if it has the type of IMAGE_DEBUG_TYPE_CO…
Browse files Browse the repository at this point in the history
…DEVIEW
  • Loading branch information
Ladislav Zezula authored and PeterMatula committed Aug 23, 2021
1 parent 18b434f commit d2a4190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/retdec/pelib/PeLibAux.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/pelib/DebugDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d2a4190

Please sign in to comment.