Skip to content

Instantly share code, notes, and snippets.

@cetfor
Created February 8, 2020 18:53
Show Gist options
  • Save cetfor/9ff0dac42b8345a856d998c312bb0726 to your computer and use it in GitHub Desktop.
Save cetfor/9ff0dac42b8345a856d998c312bb0726 to your computer and use it in GitHub Desktop.
Get MLIL SSA form and print operands
# Get MLIL SSA form and print operands
import binaryninja
target = "cwe369A_x64"
print("Analyzing file: {}".format(target))
bv = binaryninja.BinaryViewType.get_view_of_file(target)
bv.add_analysis_option('linearsweep')
for func in bv.functions:
if func.name != "main": continue
print("Function: {}".format(func.name))
for block in func.medium_level_il.ssa_form:
for instr in block:
print("\n{}".format(instr))
for operand in instr.postfix_operands:
print(" {}".format(operand))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment