execute_script
Execute custom Python scripts within IDA Pro to automate reverse engineering tasks, analyze binary data, and modify the database using IDAPython modules.
Instructions
Execute arbitrary IDAPython code in the IDA environment.
The code has access to all IDA modules (idaapi, ida_funcs, ida_bytes, etc.).
Use 'result' variable to return a value from the script.
WARNING: This is a powerful tool - use with caution as it can modify the database.
Example:
code = '''
# Count functions with more than 100 instructions
count = 0
for func_ea in idautils.Functions():
func = ida_funcs.get_func(func_ea)
if func and func.end_ea - func.start_ea > 100:
count += 1
result = f"Found {count} large functions"
'''Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python code to execute in the IDA environment | |
| timeout_seconds | No | Maximum execution time in seconds (default: 30) |