diff options
| author | Glenn Smith <glenn@vector35.com> | 2025-06-28 16:43:47 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2025-07-01 12:52:08 -0400 |
| commit | 975b4a852c57599276bc69ef9d93cd553c8eff09 (patch) | |
| tree | 3bc0adcdc12b1ad369ff7d837a51f55e5c0288dc | |
| parent | be5901611829ea635053db4a3482cb122735e013 (diff) | |
args_render_layer example: Fix python errors
| -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}") |
