summaryrefslogtreecommitdiff
path: root/python/mediumlevelil.py
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2018-03-04 18:08:04 -0500
committerRyan Snyder <ryan@vector35.com>2018-07-10 18:11:08 -0400
commit8849fb2b2b8dc824bd3f17ce1026a04856477a94 (patch)
treee85f3db97d6d6b5fa2a21162c684fd08d47e4ab0 /python/mediumlevelil.py
parent8028bd325bc94a385f99122d87ac906ba717ecbf (diff)
working division, prints, and metaclasses, but imports broken, still needs work
Diffstat (limited to 'python/mediumlevelil.py')
-rw-r--r--python/mediumlevelil.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 100795fe..9a21bb23 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -19,16 +19,13 @@
# IN THE SOFTWARE.
import ctypes
-
-# Binary Ninja components
-import _binaryninjacore as core
-from .enums import MediumLevelILOperation, InstructionTextTokenType, ILBranchDependence
-import function
-import basicblock
-import lowlevelil
-import types
import struct
+# Binary Ninja components -- additional imports belong in the appropriate class
+from binaryninja import _binaryninjacore as core
+from binaryninja.enums import MediumLevelILOperation, InstructionTextTokenType, ILBranchDependence
+from binaryninja import basicblock #required for MediumLevelILBasicBlock argument
+
class SSAVariable(object):
def __init__(self, var, version):
@@ -208,6 +205,9 @@ class MediumLevelILInstruction(object):
}
def __init__(self, func, expr_index, instr_index=None):
+ from binaryninja import function
+ from binaryninja import types
+ from binaryninja import lowlevelil
instr = core.BNGetMediumLevelILByIndex(func.handle, expr_index)
self.function = func
self.expr_index = expr_index
@@ -272,7 +272,7 @@ class MediumLevelILInstruction(object):
operand_list = core.BNMediumLevelILGetOperandList(func.handle, self.expr_index, i, count)
i += 1
value = []
- for j in xrange(count.value / 2):
+ for j in xrange(count.value // 2):
var_id = operand_list[j * 2]
var_version = operand_list[(j * 2) + 1]
value.append(SSAVariable(function.Variable.from_identifier(self.function.source_function,