Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] - Decompile Function Timeout #289

Open
re-fox opened this issue Jun 1, 2022 · 0 comments
Open

[Feature Request] - Decompile Function Timeout #289

re-fox opened this issue Jun 1, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@re-fox
Copy link

re-fox commented Jun 1, 2022

When using the Ghidra API, one of arguments exposed to decompileFunction is timeoutSecs.
Ref: https://ghidra.re/ghidra_docs/api/ghidra/app/decompiler/DecompInterface.html#decompileFunction(ghidra.program.model.listing.Function,int,ghidra.util.task.TaskMonitor)

A small implementation (with a timeout of 30 seconds per function) would resemble the following:

from ghidra.app.decompiler import DecompInterface
from ghidra.app.decompiler import DecompileOptions

decomp = DecompInterface()
decomp.openProgram(currentProgram)

for fn in functionManager.getFunctions(True):
    decomp_results = decomp.decompileFunction(fn, 30, monitor)
    if decomp_results.decompileCompleted():
        ..snipped...

A useful feature would be if there was an option in rizin (for example) e ghidra.timeout=30 that would allow for a maximum timeout and cancellation if the timeout was hit.

Thank you for the consideration.

@XVilka XVilka added the enhancement New feature or request label Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants