(llil: LowLevelILInstruction)
| 104 | |
| 105 | |
| 106 | def get_llil_arg(llil: LowLevelILInstruction) -> Iterator[Tuple[str, MediumLevelILInstruction]]: |
| 107 | args = get_param_sites(llil.function.mlil) |
| 108 | |
| 109 | if llil.ssa_form in args: |
| 110 | for call_site, param_idx in args[llil.ssa_form]: |
| 111 | target_type = call_site.function.get_expr_type(call_site.dest.expr_index) |
| 112 | |
| 113 | # Try getting the param name from the call's type |
| 114 | if target_type is not None: |
| 115 | if target_type.type_class == TypeClass.PointerTypeClass: |
| 116 | target_type = target_type.target |
| 117 | if target_type.type_class == TypeClass.FunctionTypeClass: |
| 118 | target_params = target_type.parameters |
| 119 | if param_idx < len(target_params): |
| 120 | param_name = target_params[param_idx].name |
| 121 | if param_name == '': |
| 122 | param_name = f"arg{param_idx+1}" |
| 123 | yield param_name, call_site |
| 124 | continue |
| 125 | |
| 126 | # Some calls have extra params that aren't reflected in their type |
| 127 | yield f"arg{param_idx+1}", call_site |
| 128 | return |
| 129 | |
| 130 | |
| 131 | def apply_to_lines(lines, get_instr, renderer): |
no test coverage detected