Skip to content

Commit

Permalink
[LNK] # add default value on unknown extra data signature type #335
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghitamutu committed Aug 17, 2024
1 parent f80958d commit f1331c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Types/LNK/include/Internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1818,4 +1818,13 @@ static std::string_view GetNameFromGUID(const MyGUID& guid)

return "Unknown";
}

static std::string_view GetExtraDataSignaturesName(ExtraDataSignatures type) {
if (LNK::ExtraDataSignaturesNames.contains(type)) {
return LNK::ExtraDataSignaturesNames.at(type);
}

return "?Signature";
}

} // namespace GView::Type::LNK
2 changes: 1 addition & 1 deletion Types/LNK/src/LNK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ extern "C"

for (const auto& extraData : lnk->extraDataBases)
{
const auto& name = LNK::ExtraDataSignaturesNames.at(extraData->signature);
const auto& name = LNK::GetExtraDataSignaturesName(extraData->signature);
const auto& c = *(colors.begin() + (count % 2));
settings.AddZone(offset, extraData->size, c, name.data());
count++;
Expand Down
2 changes: 1 addition & 1 deletion Types/LNK/src/Panels/ExtraData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void ExtraData::UpdateGeneralInformation()

void ExtraData::UpdateExtraDataBase(ExtraDataBase* base)
{
const auto& signatureName = LNK::ExtraDataSignaturesNames.at(base->signature).data();
const auto& signatureName = LNK::GetExtraDataSignaturesName(base->signature).data();

general->AddItem(signatureName).SetType(ListViewItem::Type::Category);

Expand Down

0 comments on commit f1331c4

Please sign in to comment.