Last active
January 18, 2016 07:25
-
-
Save mopsled/aeaca247cb74d58bd203 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
ea = BeginEA() | |
functions_with_assert = set() | |
for function_start in Functions(SegStart(ea), SegEnd(ea)): | |
function_name = GetFunctionName(function_start) | |
if not function_name.startswith('sub_'): | |
continue | |
function_end = FindFuncEnd(function_start) | |
current_address = function_start | |
while current_address != BADADDR: | |
code_refs = list(CodeRefsFrom(current_address, 1)) | |
for ref in code_refs: | |
if GetFunctionName(ref) == "__assert": | |
functions_with_assert.add(function_name) | |
current_address = NextHead(current_address, function_end) | |
for f in functions_with_assert: | |
print "Found function %s using assert" % f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment