Skip to content

Instantly share code, notes, and snippets.

@cetfor
Created February 8, 2020 16:59
Show Gist options
  • Save cetfor/93418bc75d6c8d1001d2d469e8e1827f to your computer and use it in GitHub Desktop.
Save cetfor/93418bc75d6c8d1001d2d469e8e1827f to your computer and use it in GitHub Desktop.
How to get Binary Ninja's MLIL SSA
# Get MLIL SSA form
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(instr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment