Skip to content

Instantly share code, notes, and snippets.

@joshwatson
joshwatson / mlil_slice.py
Last active July 6, 2023 08:15
MLIL Slicing in Binary Ninja
from binaryninja import HighlightStandardColor, PluginCommand
def do_backward_slice(instruction, function):
# switch to SSA form (this does nothing if it's already SSA).
instruction_queue = set([instruction.ssa_form.instr_index])
visited_instructions = set()
variables = set()