Skip to content

Make Ghidra decompileFunction timeout configurable#74

Open
bik0t wants to merge 1 commit intoLaurieWired:mainfrom
bik0t:config-decompile-timeout
Open

Make Ghidra decompileFunction timeout configurable#74
bik0t wants to merge 1 commit intoLaurieWired:mainfrom
bik0t:config-decompile-timeout

Conversation

@bik0t
Copy link

@bik0t bik0t commented Jul 28, 2025

This commit adds "Decompile Timeout" option to the MCP plugin that allows for setting a custom timeout to the decompileFunction. In particular it is useful to set to 0 or a large value when dealing with large functions that take a while to decompile.

The default value is set to 30.

In addition as part of this commit, the request timeout from the MCP bridge to the plugin is made configurable with the --ghidra-timeout argument. The default value is 5 seconds.

This commit adds "Decompile Timeout" option to the MCP plugin that
allows for setting a custom timeout to the `decompileFunction`. In
particular it is useful to set to 0 or a large value when dealing with
large functions that take a while to decompile.

The default value is set to 30.

In addition as part of this commit, the request timeout from the MCP
bridge to the plugin is made configurable with the `--ghidra-timeout`
argument. The default value is 5 seconds.
@DaCodeChick
Copy link
Contributor

Hi, I'm the new maintainer running a separate repo. I just added your changes

teal-bauer added a commit to starsong-consulting/GhydraMCP that referenced this pull request Dec 10, 2025
Add two new optional parameters to function decompilation:

1. show_constants (boolean, default: true)
   - When true: shows actual string/number constants in decompiled code
   - When false: shows placeholder addresses (DAT_*, PTR_*)
   - Improves code readability for AI analysis

2. timeout (integer, default: 30)
   - Configurable timeout in seconds for decompilation
   - Prevents hangs on complex functions
   - Allows adjustment for large binaries

Changes:
- GhidraUtil: Add overloaded decompileFunction() with parameters
- FunctionEndpoints: Parse and pass parameters to decompiler
- bridge_mcp_hydra: Update functions_decompile tool signature

Backwards compatible - defaults preserve existing behavior.

Adapted from upstream PR LaurieWired#56 (constants) and PR LaurieWired#74 (timeout).
teal-bauer added a commit to starsong-consulting/GhydraMCP that referenced this pull request Dec 10, 2025
Merge feature/decompiler-improvements adding:

1. Configurable constant display (show_constants parameter)
   - Shows actual strings/numbers vs placeholder addresses
   - Improves AI code analysis readability

2. Configurable decompilation timeout (timeout parameter)
   - Prevents hangs on complex functions
   - Adjustable per-function

3. Bug fix: Enum type ambiguity in DataTypeEndpoints

All changes backwards compatible with sensible defaults.

Adapted from upstream PR LaurieWired#56 and PR LaurieWired#74.
@bethington
Copy link

Closing as superseded by #123 which implements configurable timeouts. Thank you for the contribution! 🙏

@bethington
Copy link

This appears to be superseded by #123 which implements configurable timeouts more comprehensively. Recommend closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants