Crusader_Decomp/pyghidra_plans/scan_4588_instruction_uses.py

17 lines
549 B
Python
Raw Normal View History

TARGET_HEX = ("4588", "458a")
listing = program.getListing()
function_manager = program.getFunctionManager()
instruction = listing.getInstructions(True)
while instruction.hasNext():
insn = instruction.next()
text = insn.toString().lower()
if not any(token in text for token in TARGET_HEX):
continue
address = insn.getAddress()
function = function_manager.getFunctionContaining(address)
function_name = function.getName() if function is not None else "<no function>"
print(f"{address} {function_name} {insn}")