Created
July 17, 2024 20:22
-
-
Save psifertex/284a115762c5b461a4ed87a237152b8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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