28 lines
728 B
Python
28 lines
728 B
Python
|
|
import json
|
||
|
|
|
||
|
|
addrs = ["000d:44df","000d:4c99","000d:7000","000d:46ec"]
|
||
|
|
results = {}
|
||
|
|
|
||
|
|
try:
|
||
|
|
import ghidra_mcp
|
||
|
|
except Exception as e:
|
||
|
|
print(json.dumps({"error": "missing ghidra_mcp module", "exc": str(e)}))
|
||
|
|
raise SystemExit(1)
|
||
|
|
|
||
|
|
for a in addrs:
|
||
|
|
entry = {}
|
||
|
|
try:
|
||
|
|
entry['decompile'] = ghidra_mcp.decompile_function(a)
|
||
|
|
except Exception as e:
|
||
|
|
entry['decompile_error'] = str(e)
|
||
|
|
try:
|
||
|
|
entry['disassemble'] = ghidra_mcp.disassemble_function(a)
|
||
|
|
except Exception as e:
|
||
|
|
entry['disassemble_error'] = str(e)
|
||
|
|
try:
|
||
|
|
entry['xrefs'] = ghidra_mcp.get_xrefs(a)
|
||
|
|
except Exception as e:
|
||
|
|
entry['xrefs_error'] = str(e)
|
||
|
|
results[a] = entry
|
||
|
|
|
||
|
|
print(json.dumps(results))
|