Skip to content

Instantly share code, notes, and snippets.

@psifertex
Created July 17, 2024 20:22
Show Gist options
  • Save psifertex/284a115762c5b461a4ed87a237152b8f to your computer and use it in GitHub Desktop.
Save psifertex/284a115762c5b461a4ed87a237152b8f to your computer and use it in GitHub Desktop.
items = {}
def constructs(i):
match i:
case Comparison():
return "comparisons"
case HighLevelILFor():
return "for"
case HighLevelILWhile():
return "while"
case HighLevelILDoWhile():
return "do_while"
case HighLevelILIf():
return "ifs"
for f in bv.hlil_functions():
for i in f.traverse(constructs):
items[i] = items.get(i, 0) + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment