From 3432a4eb42134d459e53b6e5f75ef620baeea858 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Tue, 11 Feb 2025 12:49:16 +0800 Subject: Add LowLevelILOperation.LLIL_BOOL_TO_INT. Fix https://github.com/Vector35/binaryninja-api/issues/6408 --- python/lowlevelil.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'python/lowlevelil.py') diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 4282a96f..2d40c22c 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -4826,8 +4826,29 @@ class LowLevelILFunction: return self.expr(LowLevelILOperation.LLIL_CMP_UGT, a, b, size=size) def test_bit(self, size: int, a: ExpressionIndex, b: ExpressionIndex) -> ExpressionIndex: + """ + ``test_bit`` returns an expression of size ``size`` that tells whether expression ``a`` has its bit with an + index of the expression ``b`` is set + + :param int size: size in bytes + :param ExpressionIndex a: an expression to be tested + :param ExpressionIndex b: an expression for the index of the big + :return: the result expression. + :rtype: ExpressionIndex + """ return self.expr(LowLevelILOperation.LLIL_TEST_BIT, a, b, size=size) + def bool_to_int(self, size: int, a: ExpressionIndex) -> ExpressionIndex: + """ + ``bool_to_int`` returns an expression of size ``size`` converting the boolean expression ``a`` to an integer + + :param int size: size in bytes + :param ExpressionIndex a: boolean expression to be converted + :return: the converted integer expression. + :rtype: ExpressionIndex + """ + return self.expr(LowLevelILOperation.LLIL_BOOL_TO_INT, a, size=size) + def system_call(self) -> ExpressionIndex: """ ``system_call`` return a system call expression. -- cgit v1.3.1