diff options
| author | Mark Rowe <mark@vector35.com> | 2026-01-22 09:04:52 -0800 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2026-01-22 11:01:47 -0800 |
| commit | 3afe0f178f75f2f918cd9d418162dfce3a692337 (patch) | |
| tree | e26628a83dec62d9c95329c87fe146ea07b1b9a1 /python/mediumlevelil.py | |
| parent | 2e3292248bfbea40edc6c617ede3ada1450565c2 (diff) | |
[Python] Support MLIL_SEPARATE_PARAM_LIST and MLIL_SHARED_PARAM_SLOT in copy_expr_to
Diffstat (limited to 'python/mediumlevelil.py')
| -rw-r--r-- | python/mediumlevelil.py | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index db043c7c..6377996b 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -3772,14 +3772,14 @@ class MediumLevelILFunction: sub_expr_handler(expr.stack), loc ) - # if expr.operation == MediumLevelILOperation.MLIL_SEPARATE_PARAM_LIST: - # expr: MediumLevelILSeparateParamList - # params = [sub_expr_handler(param) for param in expr.params] - # return dest.separate_param_list(params, loc) - # if expr.operation == MediumLevelILOperation.MLIL_SHARED_PARAM_SLOT: - # expr: MediumLevelILSharedParamSlot - # params = [sub_expr_handler(param) for param in expr.params] - # return dest.shared_param_slot(params, loc) + if expr.operation == MediumLevelILOperation.MLIL_SEPARATE_PARAM_LIST: + expr: MediumLevelILSeparateParamList + params = [sub_expr_handler(param) for param in expr.params] + return dest.separate_param_list(params, loc) + if expr.operation == MediumLevelILOperation.MLIL_SHARED_PARAM_SLOT: + expr: MediumLevelILSharedParamSlot + params = [sub_expr_handler(param) for param in expr.params] + return dest.shared_param_slot(params, loc) if expr.operation == MediumLevelILOperation.MLIL_RET: expr: MediumLevelILRet params = [sub_expr_handler(src) for src in expr.src] @@ -5133,6 +5133,45 @@ class MediumLevelILFunction: source_location=loc ) + def separate_param_list( + self, params: List[ExpressionIndex], loc: Optional['ILSourceLocation'] = None + ) -> ExpressionIndex: + """ + ``separate_param_list`` returns an expression which holds a list of parameters in ``params`` + + :param List[ExpressionIndex] params: parameter expressions + :param ILSourceLocation loc: location of returned expression + :return: The expression ``separate_param_list(params...)`` + :rtype: ExpressionIndex + """ + return self.expr( + MediumLevelILOperation.MLIL_SEPARATE_PARAM_LIST, + len(params), + self.add_operand_list(params), + size=0, + source_location=loc + ) + + def shared_param_slot( + self, params: List[ExpressionIndex], loc: Optional['ILSourceLocation'] = None + ) -> ExpressionIndex: + """ + ``shared_param_slot`` returns an expression which holds a list of parameters in ``params`` + that are stored in a shared parameter slot + + :param List[ExpressionIndex] params: parameter expressions + :param ILSourceLocation loc: location of returned expression + :return: The expression ``shared_param_slot(params...)`` + :rtype: ExpressionIndex + """ + return self.expr( + MediumLevelILOperation.MLIL_SHARED_PARAM_SLOT, + len(params), + self.add_operand_list(params), + size=0, + source_location=loc + ) + def ret(self, sources: List[ExpressionIndex], loc: Optional['ILSourceLocation'] = None) -> ExpressionIndex: """ ``ret`` returns an expression which jumps (branches) to the calling function, |
