summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2017-10-30 21:21:48 -0400
committerPeter LaFosse <peter@vector35.com>2017-11-06 16:32:06 -0500
commit149ee581fe11a806fcd38e8220141007556bc85c (patch)
tree23c3cf08605c8d09c4d0dbb4ee9e5072db0bedb9
parentecb96a16443a45b0ebd463e831be8ca3be9f7f61 (diff)
add current_llil and current_mlil scripting console aliases
-rw-r--r--docs/getting-started.md2
-rw-r--r--python/scriptingprovider.py2
2 files changed, 4 insertions, 0 deletions
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)