From 149ee581fe11a806fcd38e8220141007556bc85c Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Mon, 30 Oct 2017 21:21:48 -0400 Subject: add current_llil and current_mlil scripting console aliases --- docs/getting-started.md | 2 ++ python/scriptingprovider.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/getting-started.md b/docs/getting-started.md index 692c1e67..39809747 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -210,6 +210,8 @@ By default the interactive python prompt has a number of convenient helper funct - `bv` / `current_view` / : the current [BinaryView](https://api.binary.ninja/binaryninja.BinaryView.html) - `current_function`: the current [Function](https://api.binary.ninja/binaryninja.Function.html) - `current_basic_block`: the current [BasicBlock](https://api.binary.ninja/binaryninja.BasicBlock.html) +- `current_llil`: the current [LowLevelILBasicBlock](https://api.binary.ninja/binaryninja.lowlevelil.LowLevelILBasicBlock.html) +- `current_mlil`: the current [MediumLevelILBasicBlock](https://api.binary.ninja/binaryninja.mediumlevelil.MediumLevelILBasicBlock.html) - `current_selection`: a tuple of the start and end addresses of the current selection - `write_at_cursor(data)`: function that writes data to the start of the current selection - `get_selected_data()`: function that returns the data in the current selection diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index ed9688b9..211d2fb7 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -540,6 +540,8 @@ class PythonScriptingInstance(ScriptingInstance): self.locals["current_address"] = self.active_addr self.locals["here"] = self.active_addr self.locals["current_selection"] = (self.active_selection_begin, self.active_selection_end) + self.locals["current_llil"] = self.active_func.low_level_il + self.locals["current_mlil"] = self.active_func.medium_level_il self.interpreter.runsource(code) -- cgit v1.3.1