diff options
| author | Rusty Wagner <rusty@vector35.com> | 2017-03-01 03:45:51 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2017-03-01 03:45:51 -0500 |
| commit | 94b38cee51eff16f1e79945806088c7ae60016d7 (patch) | |
| tree | 4857d8240334f2ec40aa7a46f7fcea6a2e9ed899 /python/function.py | |
| parent | dc0f16fa9bbac0388bb844af8d9f6c3b72ec31e8 (diff) | |
Adding framework for medium level IL
Diffstat (limited to 'python/function.py')
| -rw-r--r-- | python/function.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/python/function.py b/python/function.py index 07187080..ed2a537c 100644 --- a/python/function.py +++ b/python/function.py @@ -33,6 +33,7 @@ import associateddatastore import types import basicblock import lowlevelil +import mediumlevelil import binaryview import log @@ -139,6 +140,14 @@ class StackVariableReference(object): return "<operand %d ref to %s>" % (self.source_operand, self.name) +class ILVariable(object): + def __init__(self, func, var_type, index, identifier): + self.function = func + self.type = var_type + self.index = index + self.identifier = identifier + + class ConstantReference(object): def __init__(self, val, size): self.value = val @@ -300,6 +309,11 @@ class Function(object): return lowlevelil.LowLevelILFunction(self.arch, core.BNGetFunctionLiftedIL(self.handle), self) @property + def medium_level_il(self): + """Function medium level IL (read-only)""" + return mediumlevelil.MediumLevelILFunction(self.arch, core.BNGetFunctionMediumLevelIL(self.handle), self) + + @property def function_type(self): """Function type object""" return types.Type(core.BNGetFunctionType(self.handle)) @@ -398,7 +412,7 @@ class Function(object): result = [] for i in xrange(0, count.value): result.append(exits[i]) - core.BNFreeLowLevelILInstructionList(exits) + core.BNFreeILInstructionList(exits) return result def get_reg_value_at(self, addr, reg, arch=None): @@ -597,7 +611,7 @@ class Function(object): result = [] for i in xrange(0, count.value): result.append(instrs[i]) - core.BNFreeLowLevelILInstructionList(instrs) + core.BNFreeILInstructionList(instrs) return result def get_lifted_il_flag_definitions_for_use(self, i, flag): @@ -608,7 +622,7 @@ class Function(object): result = [] for i in xrange(0, count.value): result.append(instrs[i]) - core.BNFreeLowLevelILInstructionList(instrs) + core.BNFreeILInstructionList(instrs) return result def get_flags_read_by_lifted_il_instruction(self, i): |
