Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug info is only accepted if it has the type of IMAGE_DEBUG_TYPE_CO… #1004

Merged
merged 1 commit into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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