summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/function.py15
-rw-r--r--python/lineardisassembly.py42
2 files changed, 57 insertions, 0 deletions
diff --git a/python/function.py b/python/function.py
index bdd04590..7cee467c 100644
--- a/python/function.py
+++ b/python/function.py
@@ -1215,11 +1215,21 @@ class Function(object):
return binaryninja.lowlevelil.LowLevelILFunction(self.arch, core.BNGetFunctionLowLevelIL(self.handle), self)
@property
+ def llil_if_available(self):
+ """returns LowLevelILFunction used to represent Function low level IL, or None if not loaded (read-only)"""
+ return binaryninja.lowlevelil.LowLevelILFunction(self.arch, core.BNGetFunctionLowLevelILIfAvailable(self.handle), self)
+
+ @property
def lifted_il(self):
"""returns LowLevelILFunction used to represent lifted IL (read-only)"""
return binaryninja.lowlevelil.LowLevelILFunction(self.arch, core.BNGetFunctionLiftedIL(self.handle), self)
@property
+ def lifted_il_if_available(self):
+ """returns LowLevelILFunction used to represent lifted IL, or None if not loaded (read-only)"""
+ return binaryninja.lowlevelil.LowLevelILFunction(self.arch, core.BNGetFunctionLiftedILIfAvailable(self.handle), self)
+
+ @property
def medium_level_il(self):
"""Deprecated property provided for compatibility. Use mlil instead."""
return binaryninja.mediumlevelil.MediumLevelILFunction(self.arch, core.BNGetFunctionMediumLevelIL(self.handle), self)
@@ -1230,6 +1240,11 @@ class Function(object):
return binaryninja.mediumlevelil.MediumLevelILFunction(self.arch, core.BNGetFunctionMediumLevelIL(self.handle), self)
@property
+ def mlil_if_available(self):
+ """Function medium level IL, or None if not loaded (read-only)"""
+ return binaryninja.mediumlevelil.MediumLevelILFunction(self.arch, core.BNGetFunctionMediumLevelILIfAvailable(self.handle), self)
+
+ @property
def function_type(self):
"""Function type object, can be set with either a string representing the function prototype (`str(function)` shows examples) or a :py:class:`Type` object"""
return types.Type(core.BNGetFunctionType(self.handle), platform = self.platform)
diff --git a/python/lineardisassembly.py b/python/lineardisassembly.py
index a23c829f..ec213a19 100644
--- a/python/lineardisassembly.py
+++ b/python/lineardisassembly.py
@@ -258,6 +258,48 @@ class LinearViewObject(object):
settings = settings.handle
return LinearViewObject(core.BNCreateLinearViewDisassembly(view.handle, settings))
+ @classmethod
+ def lifted_il(cls, view, settings = None):
+ if settings is not None:
+ settings = settings.handle
+ return LinearViewObject(core.BNCreateLinearViewLiftedIL(view.handle, settings))
+
+ @classmethod
+ def llil(cls, view, settings = None):
+ if settings is not None:
+ settings = settings.handle
+ return LinearViewObject(core.BNCreateLinearViewLowLevelIL(view.handle, settings))
+
+ @classmethod
+ def llil_ssa_form(cls, view, settings = None):
+ if settings is not None:
+ settings = settings.handle
+ return LinearViewObject(core.BNCreateLinearViewLowLevelILSSAForm(view.handle, settings))
+
+ @classmethod
+ def mlil(cls, view, settings = None):
+ if settings is not None:
+ settings = settings.handle
+ return LinearViewObject(core.BNCreateLinearViewMediumLevelIL(view.handle, settings))
+
+ @classmethod
+ def mlil_ssa_form(cls, view, settings = None):
+ if settings is not None:
+ settings = settings.handle
+ return LinearViewObject(core.BNCreateLinearViewMediumLevelILSSAForm(view.handle, settings))
+
+ @classmethod
+ def mmlil(cls, view, settings = None):
+ if settings is not None:
+ settings = settings.handle
+ return LinearViewObject(core.BNCreateLinearViewMappedMediumLevelIL(view.handle, settings))
+
+ @classmethod
+ def mmlil_ssa_form(cls, view, settings = None):
+ if settings is not None:
+ settings = settings.handle
+ return LinearViewObject(core.BNCreateLinearViewMappedMediumLevelILSSAForm(view.handle, settings))
+
class LinearViewCursor(object):
def __init__(self, root_object, handle = None):