fix: add return type annotations to avoid pydantic errors#65
Open
renato-osec wants to merge 7 commits intofosdickio:mainfrom
Open
fix: add return type annotations to avoid pydantic errors#65renato-osec wants to merge 7 commits intofosdickio:mainfrom
renato-osec wants to merge 7 commits intofosdickio:mainfrom
Conversation
- function_at: use non-blocking get_function_at first, fall back to iterating bv.functions during analysis, auto-create function if missing - get_binary_status: expose analysis_state, analysis_complete, function_count - Tool docstrings: add agent workflow tips (call make_function_at before decompile/get_il on unanalyzed addresses to avoid hangs) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…naries update_analysis_and_wait() blocks the HTTP handler thread until Binary Ninja finishes analyzing the entire binary, which can take 30+ minutes for large (88MB+) binaries. Switch to non-blocking update_analysis() and only trigger re-analysis if the function was actually skipped.
…tion On large binaries (25k+ functions), background analysis holds locks that cause func.hlil/mlil to block indefinitely. abort_analysis() breaks IL generation entirely (returns None). Instead, use WorkflowMachine(func.handle).run() which runs analysis for just the requested function (~0.03s) without contending with background analysis workers. Background analysis continues undisturbed. Tested: 88MB binary, 25k functions — decompile returns 180 HLIL instructions in <0.05s even with background analysis active.
- Try hlil_if_available first (instant, no side effects) - Only call WorkflowMachine.run(incremental=True) if IL not cached - incremental=True avoids resetting function analysis state which was stopping BN's background analysis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds proper return type annotations to all @mcp.tool() functions to satisfy pydantic validation in mcp >= 1.26