1
0
mirror of synced 2025-01-31 12:03:46 +01:00

fix: Duplicate highlightings for every yara rule

This commit is contained in:
WerWolv 2023-01-28 14:27:51 +01:00
parent b1aa58d446
commit 197e86f327
2 changed files with 3 additions and 3 deletions

View File

@ -88,8 +88,8 @@ namespace hex::plugin::builtin {
size_t size;
bool wholeDataMatch;
u32 highlightId;
u32 tooltipId;
mutable u32 highlightId;
mutable u32 tooltipId;
};
std::vector<std::pair<std::fs::path, std::fs::path>> rules;

View File

@ -423,7 +423,7 @@ namespace hex::plugin::builtin {
std::move(uniques.begin(), uniques.end(), std::back_inserter(matches));
constexpr static color_t YaraColor = 0x70B4771F;
for (auto &match : matches) {
for (auto &match : uniques) {
match.highlightId = ImHexApi::HexEditor::addBackgroundHighlight({ match.address, match.size }, YaraColor);
match.tooltipId = ImHexApi::HexEditor::addTooltip({ match. address, match.size }, hex::format("{0} [{1}]", match.identifier, match.variable), YaraColor);
}