diff options
| author | Rusty Wagner <rusty@vector35.com> | 2020-04-14 21:25:41 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2020-04-17 14:20:35 -0400 |
| commit | 072c5cd6eee7af9671e6c4fe583e77bc3bcbdd1d (patch) | |
| tree | 52e8b1018c7588dc540a687c8219ad2803de13af /python | |
| parent | 1385e2dbd9be1db21114d95b7c4767773e2b0692 (diff) | |
Add IL support to linear view
Diffstat (limited to 'python')
| -rw-r--r-- | python/function.py | 15 | ||||
| -rw-r--r-- | python/lineardisassembly.py | 42 |
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): |
