Skip to content

Commit 3432a4e

Browse files
committed
Add LowLevelILOperation.LLIL_BOOL_TO_INT. Fix #6408
1 parent 840072d commit 3432a4e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

python/lowlevelil.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4826,8 +4826,29 @@ def compare_unsigned_greater_than(self, size: int, a: ExpressionIndex, b: Expres
48264826
return self.expr(LowLevelILOperation.LLIL_CMP_UGT, a, b, size=size)
48274827

48284828
def test_bit(self, size: int, a: ExpressionIndex, b: ExpressionIndex) -> ExpressionIndex:
4829+
"""
4830+
``test_bit`` returns an expression of size ``size`` that tells whether expression ``a`` has its bit with an
4831+
index of the expression ``b`` is set
4832+
4833+
:param int size: size in bytes
4834+
:param ExpressionIndex a: an expression to be tested
4835+
:param ExpressionIndex b: an expression for the index of the big
4836+
:return: the result expression.
4837+
:rtype: ExpressionIndex
4838+
"""
48294839
return self.expr(LowLevelILOperation.LLIL_TEST_BIT, a, b, size=size)
48304840

4841+
def bool_to_int(self, size: int, a: ExpressionIndex) -> ExpressionIndex:
4842+
"""
4843+
``bool_to_int`` returns an expression of size ``size`` converting the boolean expression ``a`` to an integer
4844+
4845+
:param int size: size in bytes
4846+
:param ExpressionIndex a: boolean expression to be converted
4847+
:return: the converted integer expression.
4848+
:rtype: ExpressionIndex
4849+
"""
4850+
return self.expr(LowLevelILOperation.LLIL_BOOL_TO_INT, a, size=size)
4851+
48314852
def system_call(self) -> ExpressionIndex:
48324853
"""
48334854
``system_call`` return a system call expression.

0 commit comments

Comments
 (0)