summaryrefslogtreecommitdiff
path: root/python/highlevelil.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-11-23 09:00:30 -0500
committerPeter LaFosse <peter@vector35.com>2021-11-29 10:09:05 -0500
commit2959d69e86eacf0de78703d48217215deb507cd4 (patch)
tree9e2381a37c59b4a0ec0dfbdb5bc17750218e9bac /python/highlevelil.py
parentb82050fe24f7920c9ff29f4494236844375eeba9 (diff)
Fully deprecate (Low|Medium|High)LevelILExpr in favor of ExpressionIndex
Diffstat (limited to 'python/highlevelil.py')
-rw-r--r--python/highlevelil.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/python/highlevelil.py b/python/highlevelil.py
index 82e19557..8d35306e 100644
--- a/python/highlevelil.py
+++ b/python/highlevelil.py
@@ -2044,12 +2044,14 @@ class HighLevelILExpr:
"""
``class HighLevelILExpr`` hold the index of IL Expressions.
- .. note:: This class shouldn't be instantiated directly. Rather the helper members of HighLevelILFunction should be \
- used instead.
+ .. note:: Deprecated. Use ExpressionIndex instead
"""
def __init__(self, index:ExpressionIndex):
self._index = index
+ def __int__(self):
+ return self._index
+
@property
def index(self) -> ExpressionIndex:
return self._index
@@ -2330,25 +2332,25 @@ class HighLevelILFunction:
return result
def expr(self, operation:Union[str, HighLevelILOperation], a:int = 0, b:int = 0, c:int = 0,
- d:int = 0, e:int = 0, size:int = 0) -> HighLevelILExpr:
+ d:int = 0, e:int = 0, size:int = 0) -> ExpressionIndex:
if isinstance(operation, str):
operation_value = HighLevelILOperation[operation]
elif isinstance(operation, HighLevelILOperation):
operation_value = operation.value
- return HighLevelILExpr(core.BNHighLevelILAddExpr(self.handle, operation_value, size, a, b, c, d, e))
+ return ExpressionIndex(core.BNHighLevelILAddExpr(self.handle, operation_value, size, a, b, c, d, e))
- def add_operand_list(self, operands:List[int]) -> HighLevelILExpr:
+ def add_operand_list(self, operands:List[int]) -> ExpressionIndex:
"""
``add_operand_list`` returns an operand list expression for the given list of integer operands.
:param list(int) operands: list of operand numbers
:return: an operand list expression
- :rtype: HighLevelILExpr
+ :rtype: ExpressionIndex
"""
operand_list = (ctypes.c_ulonglong * len(operands))()
for i in range(len(operands)):
operand_list[i] = operands[i]
- return HighLevelILExpr(core.BNHighLevelILAddOperandList(self.handle, operand_list, len(operands)))
+ return ExpressionIndex(core.BNHighLevelILAddOperandList(self.handle, operand_list, len(operands)))
def finalize(self) -> None:
"""