diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/lowlevelil.py | 44 | ||||
| -rw-r--r-- | python/mediumlevelil.py | 50 |
2 files changed, 85 insertions, 9 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 3354dae4..df8f352b 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -447,7 +447,9 @@ class LowLevelILInstruction(BaseILInstruction): ("dest_memory", "int"), ("dest", "reg_ssa_list") ], LowLevelILOperation.LLIL_CALL_STACK_SSA: [("src", "reg_ssa"), ("src_memory", "int")], - LowLevelILOperation.LLIL_CALL_PARAM: [("src", "expr_list")], LowLevelILOperation.LLIL_LOAD_SSA: [ + LowLevelILOperation.LLIL_CALL_PARAM: [("src", "expr_list")], + LowLevelILOperation.LLIL_SEPARATE_PARAM_LIST_SSA: [("src", "expr_list")], + LowLevelILOperation.LLIL_SHARED_PARAM_SLOT_SSA: [("src", "expr_list")], LowLevelILOperation.LLIL_LOAD_SSA: [ ("src", "expr"), ("src_memory", "int") ], LowLevelILOperation.LLIL_STORE_SSA: [("dest", "expr"), ("dest_memory", "int"), ("src_memory", "int"), ("src", "expr")], LowLevelILOperation.LLIL_REG_PHI: [ @@ -1706,6 +1708,44 @@ class LowLevelILCallParam(LowLevelILInstruction, SSA): @dataclass(frozen=True, repr=False, eq=False) +class LowLevelILSeparateParamListSsa(LowLevelILInstruction, SSA): + def __repr__(self): + return f"<LowLevelILSeparateParamListSsa: {self.src}>" + + def __str__(self): + return str(self.src) + + @property + def src(self) -> List['LowLevelILInstruction']: + return self._get_expr_list(0) + + @property + def detailed_operands(self) -> List[Tuple[str, LowLevelILOperandType, str]]: + return [ + ("src", self.src, "List[LowLevelILInstruction]"), + ] + + +@dataclass(frozen=True, repr=False, eq=False) +class LowLevelILSharedParamSlotSsa(LowLevelILInstruction, SSA): + def __repr__(self): + return f"<LowLevelILSharedParamSlotSsa: {self.src}>" + + def __str__(self): + return str(self.src) + + @property + def src(self) -> List['LowLevelILInstruction']: + return self._get_expr_list(0) + + @property + def detailed_operands(self) -> List[Tuple[str, LowLevelILOperandType, str]]: + return [ + ("src", self.src, "List[LowLevelILInstruction]"), + ] + + +@dataclass(frozen=True, repr=False, eq=False) class LowLevelILMemPhi(LowLevelILInstruction, Memory, Phi): @property def dest_memory(self) -> int: @@ -2977,6 +3017,8 @@ ILInstruction:Dict[LowLevelILOperation, LowLevelILInstruction] = { # type: igno LowLevelILOperation.LLIL_CALL_OUTPUT_SSA: LowLevelILCallOutputSsa, # [("dest_memory", "int"), ("dest", "reg_ssa_list")], LowLevelILOperation.LLIL_CALL_STACK_SSA: LowLevelILCallStackSsa, # [("src", "reg_ssa"), ("src_memory", "int")], LowLevelILOperation.LLIL_CALL_PARAM: LowLevelILCallParam, # [("src", "expr_list")], + LowLevelILOperation.LLIL_SEPARATE_PARAM_LIST_SSA: LowLevelILSeparateParamListSsa, # [("src", "expr_list")], + LowLevelILOperation.LLIL_SHARED_PARAM_SLOT_SSA: LowLevelILSharedParamSlotSsa, # [("src", "expr_list")], LowLevelILOperation.LLIL_LOAD_SSA: LowLevelILLoadSsa, # [("src", "expr"), ("src_memory", "int")], LowLevelILOperation.LLIL_STORE_SSA: LowLevelILStoreSsa, # [("dest", "expr"), ("dest_memory", "int"), ("src_memory", "int"), ("src", "expr")], LowLevelILOperation.LLIL_REG_PHI: LowLevelILRegPhi, # [("dest", "reg_ssa"), ("src", "reg_ssa_list")], diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index 1ae61d38..90f15e7d 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -218,7 +218,11 @@ class MediumLevelILInstruction(BaseILInstruction): ], MediumLevelILOperation.MLIL_CALL_UNTYPED: [ ("output", "expr"), ("dest", "expr"), ("params", "expr"), ("stack", "expr") ], MediumLevelILOperation.MLIL_CALL_OUTPUT: [("dest", "var_list")], MediumLevelILOperation.MLIL_CALL_PARAM: [ - ("src", "var_list") + ("src", "expr_list") + ], MediumLevelILOperation.MLIL_SEPARATE_PARAM_LIST: [ + ("params", "expr_list") + ], MediumLevelILOperation.MLIL_SHARED_PARAM_SLOT: [ + ("params", "expr_list") ], MediumLevelILOperation.MLIL_RET: [ ("src", "expr_list") ], MediumLevelILOperation.MLIL_NORET: [], MediumLevelILOperation.MLIL_IF: [ @@ -328,7 +332,7 @@ class MediumLevelILInstruction(BaseILInstruction): ], MediumLevelILOperation.MLIL_CALL_OUTPUT_SSA: [ ("dest_memory", "int"), ("dest", "var_ssa_list") ], MediumLevelILOperation.MLIL_CALL_PARAM_SSA: [ - ("src_memory", "int"), ("src", "var_ssa_list") + ("src_memory", "int"), ("src", "expr_list") ], MediumLevelILOperation.MLIL_LOAD_SSA: [ ("src", "expr"), ("src_memory", "int") ], MediumLevelILOperation.MLIL_LOAD_STRUCT_SSA: [ @@ -1285,11 +1289,39 @@ class MediumLevelILCallParam(MediumLevelILInstruction): @property def src(self) -> List[variable.Variable]: - return self._get_var_list(0, 1) + return self._get_expr_list(0, 1) + + @property + def detailed_operands(self) -> List[Tuple[str, MediumLevelILOperandType, str]]: + return [("src", self.src, "List[MediumLevelILInstruction]")] + + +@dataclass(frozen=True, repr=False, eq=False) +class MediumLevelILSeparateParamList(MediumLevelILInstruction): + def __repr__(self): + return f"<MediumLevelILSeparateParamList: {self.src}>" + + @property + def src(self) -> List[variable.Variable]: + return self._get_expr_list(0, 1) @property def detailed_operands(self) -> List[Tuple[str, MediumLevelILOperandType, str]]: - return [("src", self.src, "List[Variable]")] + return [("src", self.src, "List[MediumLevelILInstruction]")] + + +@dataclass(frozen=True, repr=False, eq=False) +class MediumLevelILSharedParamSlot(MediumLevelILInstruction): + def __repr__(self): + return f"<MediumLevelILSharedParamSlot: {self.src}>" + + @property + def src(self) -> List[variable.Variable]: + return self._get_expr_list(0, 1) + + @property + def detailed_operands(self) -> List[Tuple[str, MediumLevelILOperandType, str]]: + return [("src", self.src, "List[MediumLevelILInstruction]")] @dataclass(frozen=True, repr=False, eq=False) @@ -1856,13 +1888,13 @@ class MediumLevelILCallParamSsa(MediumLevelILInstruction, SSA): @property def src(self) -> List[SSAVariable]: - return self._get_var_ssa_list(1, 2) + return self._get_expr_list(1, 2) @property def detailed_operands(self) -> List[Tuple[str, MediumLevelILOperandType, str]]: return [ ('src_memory', self.src_memory, 'int'), - ('src', self.src, 'List[SSAVariable]'), + ('src', self.src, 'List[MediumLevelILInstruction]'), ] @@ -2865,7 +2897,9 @@ ILInstruction = { MediumLevelILOperation.MLIL_JUMP: MediumLevelILJump, # [("dest", "expr")], MediumLevelILOperation.MLIL_RET_HINT: MediumLevelILRetHint, # [("dest", "expr")], MediumLevelILOperation.MLIL_CALL_OUTPUT: MediumLevelILCallOutput, # [("dest", "var_list")], - MediumLevelILOperation.MLIL_CALL_PARAM: MediumLevelILCallParam, # [("src", "var_list")], + MediumLevelILOperation.MLIL_CALL_PARAM: MediumLevelILCallParam, # [("src", "expr_list")], + MediumLevelILOperation.MLIL_SEPARATE_PARAM_LIST: MediumLevelILSeparateParamList, # [("src", "expr_list")], + MediumLevelILOperation.MLIL_SHARED_PARAM_SLOT: MediumLevelILSharedParamSlot, # [("src", "expr_list")], MediumLevelILOperation.MLIL_RET: MediumLevelILRet, # [("src", "expr_list")], MediumLevelILOperation.MLIL_GOTO: MediumLevelILGoto, # [("dest", "int")], MediumLevelILOperation.MLIL_BOOL_TO_INT: MediumLevelILBoolToInt, # [("src", "expr")], @@ -2905,7 +2939,7 @@ ILInstruction = { MediumLevelILOperation.MLIL_CALL_OUTPUT_SSA: MediumLevelILCallOutputSsa, # [("dest_memory", "int"), ("dest", "var_ssa_list")], MediumLevelILOperation.MLIL_CALL_PARAM_SSA: - MediumLevelILCallParamSsa, # [("src_memory", "int"), ("src", "var_ssa_list")], + MediumLevelILCallParamSsa, # [("src_memory", "int"), ("src", "expr_list")], MediumLevelILOperation.MLIL_LOAD_SSA: MediumLevelILLoadSsa, # [("src", "expr"), ("src_memory", "int")], MediumLevelILOperation.MLIL_VAR_PHI: MediumLevelILVarPhi, # [("dest", "var_ssa"), ("src", "var_ssa_list")], MediumLevelILOperation.MLIL_MEM_PHI: MediumLevelILMemPhi, # [("dest_memory", "int"), ("src_memory", "int_list")], |
