diff options
Diffstat (limited to 'python/examples')
| -rw-r--r-- | python/examples/args_render_layer.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/python/examples/args_render_layer.py b/python/examples/args_render_layer.py index 4941bbd1..3f2f6e6d 100644 --- a/python/examples/args_render_layer.py +++ b/python/examples/args_render_layer.py @@ -45,7 +45,7 @@ def get_param_sites(mlil: MediumLevelILFunction) -> Mapping[LowLevelILInstructio :param mlil: MLIL function to search :return: Map of param sites as described above """ - call_sites = {} + call_sites: dict[MediumLevelILInstruction, List[Tuple[int, LowLevelILInstruction]]] = {} mlil = mlil.ssa_form # As a function to handle call and tailcall identically @@ -54,7 +54,7 @@ def get_param_sites(mlil: MediumLevelILFunction) -> Mapping[LowLevelILInstructio for i, param in enumerate(params): llil = param.llil if llil is not None: - def_sites.append((param, llil)) + def_sites.append((i, llil)) continue match param: @@ -73,10 +73,11 @@ def get_param_sites(mlil: MediumLevelILFunction) -> Mapping[LowLevelILInstructio case MediumLevelILConstBase(): # This is wrong, but it works (sometimes) # Oh god, have I just quoted php.net - def_site_idx = mlil.llil.get_instruction_start(param.address) - if def_site_idx is not None: - def_sites.append((i, mlil.llil[def_site_idx].ssa_form)) - continue + if mlil.llil is not None: + def_site_idx = mlil.llil.get_instruction_start(param.address) + if def_site_idx is not None: + def_sites.append((i, mlil.llil[def_site_idx].ssa_form)) + continue if len(def_sites) == 0: log_debug(f"Could not find def site for param {i} in call at {call_site.address:#x}") |
