Skip to content

Commit 5651090

Browse files
committed
Clean up args render layer example
It was throwing lots of messages if MLIL was not found
1 parent d525f51 commit 5651090

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/examples/args_render_layer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def collect_call_params(call_site, dest, params):
9797
if llil not in all_def_sites:
9898
all_def_sites[llil] = []
9999
else:
100-
print(f"got two at {llil.instr_index} @ {llil.address:#x} -> {call_site.address:#x}")
100+
# print(f"got two at {llil.instr_index} @ {llil.address:#x} -> {call_site.address:#x}")
101+
pass
101102
all_def_sites[llil].append((call_site, param_idx))
102103

103104
return all_def_sites
@@ -196,6 +197,8 @@ def apply_to_disassembly_block(
196197
block: BasicBlock,
197198
lines: List['DisassemblyTextLine']
198199
):
200+
if block.function.mlil_if_available is None:
201+
return lines
199202
# Break this out into a helper so we don't have to write it twice
200203
renderer = DisassemblyTextRenderer(block.function)
201204
return apply_to_lines(lines, lambda line: block.function.get_llil_at(line.address), renderer)
@@ -205,6 +208,8 @@ def apply_to_low_level_il_block(
205208
block: BasicBlock,
206209
lines: List['DisassemblyTextLine']
207210
):
211+
if block.function.mlil_if_available is None:
212+
return lines
208213
# Break this out into a helper so we don't have to write it twice
209214
renderer = DisassemblyTextRenderer(block.function)
210215
return apply_to_lines(lines, lambda line: line.il_instruction, renderer)

0 commit comments

Comments
 (0)