You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I was trying to reproduce some of your work. I want to understand your approach of getting the decompiled output for specific functions from Ghidra. For example, in your dataset `libaudioflux.so.json' , you have certain key vars ""001426b0" and then corresponding decompiled output, can you explain your approach how you got this. I would really appreciate your help. Thank you!
The text was updated successfully, but these errors were encountered:
Thanks for your comment. We achieved that by leveraging the headless mode of ghidra (as also ida). For example, the ghidra script we used is like this:
"""
Ghidra script - decompile and store the result in json format
{
'addr': 'pesude c',
...,
}
"""
import json
from ghidra.app.decompiler import DecompInterface
from ghidra.util.task import ConsoleTaskMonitor
program = getCurrentProgram()
ifc = DecompInterface()
ifc.openProgram(program)
output = dict()
fm = currentProgram.getFunctionManager()
funcs = fm.getFunctions(True) # True means 'forward'
for func in funcs:
# decompile the function and print the pseudo C
results = ifc.decompileFunction(func, 0, ConsoleTaskMonitor())
decompiled = results.getDecompiledFunction().getC()
addr = str(func.getEntryPoint())
output[addr] = decompiled
args = getScriptArgs()
with open(args[0], 'w') as w:
w.write(json.dumps(output, indent=4))
Hello,
I was trying to reproduce some of your work. I want to understand your approach of getting the decompiled output for specific functions from Ghidra. For example, in your dataset `libaudioflux.so.json' , you have certain key vars ""001426b0" and then corresponding decompiled output, can you explain your approach how you got this. I would really appreciate your help. Thank you!
The text was updated successfully, but these errors were encountered: