Skip to content

Commit

Permalink
Correctly handle the case when an ldb subsignature is not matched
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Zaddach committed Jul 20, 2017
1 parent f2c6419 commit f2417af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/casc_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2266,7 +2266,7 @@ def signature_selected(self, item):
item2.subsignature_name = "$subsig_%02x" % i
self.subsignatures_list.addItem(item2)
elif isinstance(item.parsed_signature, NdbSignature):
pass
self.match_label.setText("No match")

print_console("Signature selected: %s" % item.text())
self.yara_scanner.scan(item.yara_rule)
Expand All @@ -2284,6 +2284,11 @@ def subsignature_selected(self, item):
print_console("Coloring ea 0x%x" % ea)
self.previous_colors.append((ea, GetColor(ea, CIC_ITEM)))
SetColor(ea, CIC_ITEM, SIGALIYZER_COLOR_HIGHLIGHTED)
except KeyError:
self.match_label.setText("No match")
for ea, color in self.previous_colors:
SetColor(ea, CIC_ITEM, color)
self.previous_colors = []
except IndexError:
log.exception("While selecting subsignature")

Expand Down

0 comments on commit f2417af

Please sign in to comment.