Add check that the typelib customattribute parent points to Assembly table to ignore random GUIDs

This commit is contained in:
houndthe 2021-07-08 19:43:59 +02:00 committed by Peter Matula
parent 5e73460d6b
commit 6711d05756

View File

@ -2433,6 +2433,14 @@ void PeFormat::detectTypeLibId()
for (std::size_t i = 1; i <= customAttributeTable->getNumberOfRows(); ++i)
{
auto customAttributeRow = customAttributeTable->getRow(i);
// Check that the parent is index into Assembly table
MetadataTableType parent_table;
if (customAttributeRow->parent.getTable(parent_table) && parent_table != MetadataTableType::Assembly)
{
continue;
}
if (customAttributeRow->type.getIndex() == guidMemberRef)
{
// Its value is the TypeLib we are looking for