Add mypy type checking to disassembler modules; fix mypy errors#702
Open
ANogin wants to merge 4 commits intoredballoonsecurity:masterfrom
Open
Add mypy type checking to disassembler modules; fix mypy errors#702ANogin wants to merge 4 commits intoredballoonsecurity:masterfrom
ANogin wants to merge 4 commits intoredballoonsecurity:masterfrom
Conversation
Enable mypy enforcement in ofrak_ghidra, ofrak_cached_disassembly, and ofrak_pyghidra. Fix type errors including: - Add TypedDicts for structured data (BasicBlockInfo, DataWordInfo, InstructionInfo) - Fix method signatures with proper defaults (config: None = None) - Add subprocess stream assertions for type safety - Fix variable shadowing in batch handlers (requests -> reqs) - Handle Java exception interop with hasattr + type ignore - Add type ignores for ResourceTag metaclass limitations with TODO comments - Fix Optional[str] handling in os.path.join calls - Use str() instead of hex() for GetDecompilation.java compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix PyGhidraAutoAnalyzer generic type to match config usage (Analyzer[Optional[PyGhidraAnalyzerConfig], ...]) - Add Optional to PyGhidraCodeRegionUnpacker.unpack config parameter - Document behavioral bug fixes in ofrak_ghidra and ofrak_pyghidra CHANGELOGs (stderr capture, decompilation error handling, ISA error) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The assert claimed program_file was "guaranteed by earlier logic" but nothing guaranteed it — passing None without memory_regions would just crash inside pyghidra. Add an explicit ValueError guard instead. Also fix review findings: - Fix InstructionInfo TypedDict: instr_mode is NotRequired (code uses .get() with default) - Move PyGhidraComponentException to top-level import (module already imported) - Fix pre-existing CHANGELOG version: 1.0.0 → 0.1.0 to match setup.py - Fix CHANGELOG categories: split Changed into Added/Fixed per Keep a Changelog Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ANogin
pushed a commit
that referenced
this pull request
Feb 14, 2026
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.
One sentence summary of this PR (This should go in the CHANGELOG!)
Add mypy type checking to disassembler modules; fix mypy errors
Link to Related Issue(s)
N/A
Please describe the changes in your request.
Enable mypy enforcement in
ofrak_ghidra,ofrak_cached_disassembly, andofrak_pyghidra. Fix type errors including:Anyone you think should look at this, specifically?
Not sure; @whyitfor should probably decide.