Skip to content

Instantly share code, notes, and snippets.

@mopsled
Last active January 18, 2016 07:25
Show Gist options
  • Save mopsled/aeaca247cb74d58bd203 to your computer and use it in GitHub Desktop.
Save mopsled/aeaca247cb74d58bd203 to your computer and use it in GitHub Desktop.
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