MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / get_llil_arg

Function get_llil_arg

python/examples/args_render_layer.py:106–128  ·  view source on GitHub ↗
(llil: LowLevelILInstruction)

Source from the content-addressed store, hash-verified

104
105
106def 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
131def apply_to_lines(lines, get_instr, renderer):

Callers 1

apply_to_linesFunction · 0.85

Calls 2

get_param_sitesFunction · 0.85
get_expr_typeMethod · 0.45

Tested by

no test coverage detected