-
-
Save withzombies/39fa21fffe982053b4576f8d2514fbdd 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
count = 0 | |
start = None | |
# Iterate over the basic blocks in the entry function | |
for block in entry.low_level_il: | |
# Iterate over the basic blocks getting il instructions | |
for il in block: | |
# We only care about calls | |
if il.operation != binaryninja.core.LLIL_CALL: | |
continue | |
# The second call is the call to start | |
count += 1 | |
if count == 2: | |
start = bv.get_functions_at(il.operands[0].value)[0] | |
break | |
print "start: {0}".format(start) | |
# Do the same thing with main, it's the first call in start | |
main = None | |
for block in start.low_level_il: | |
for il in block: | |
if il.operation != binaryninja.core.LLIL_CALL: | |
continue | |
main = bv.get_functions_at(il.operands[0].value)[0] | |
print "main: {0}".format(main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment