39 Commits

Author SHA1 Message Date
Teal Bauer
4379bea14f Release v2.0.0-beta.5: Critical fixes for stable release
- Fixed memory_write() endpoint to use correct ProgramEndpoints path
- Standardized all error responses to structured format with error codes
- Enhanced instances_discover() to return both new and existing instances
- Updated API version to 2005 for compatibility tracking
- Verified all bridge-to-plugin endpoint mappings are correct
- Confirmed route registration order follows proper specificity

Ready for v2.0.0 stable release after final testing.
2025-06-18 00:51:00 +02:00
Teal Bauer
2ec406b913 fix: remove duplicated decompilation text 2025-05-22 15:36:35 +02:00
Teal Bauer
52312f9ed3 chore: bump versions
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
2025-05-22 14:51:56 +02:00
Teal Bauer
f8cf202a50 fix: add data_list_strings tool for string data access 2025-05-22 14:42:06 +02:00
Teal Bauer
f04223d23a refactor: clean up python comments and consolidate data test files 2025-05-22 14:35:59 +02:00
Teal Bauer
384f8b272f fix: update callgraph endpoint to accept both name and address parameters
- Modified ProgramEndpoints.java to support the name and address parameters
- Updated bridge MCP tool analysis_get_callgraph to use both parameters
- Updated tests to verify functionality with both parameters
- Added the change to CHANGELOG.md
2025-05-22 14:35:59 +02:00
Teal Bauer
b37be370f8 fix: add URIs to resources and split resource access by name and address 2025-05-22 14:34:40 +02:00
Teal Bauer
8313b2bd7b feat: Add reverse_engineer_binary prompt for comprehensive binary analysis 2025-05-22 14:34:40 +02:00
Teal Bauer
0f9aa2bb47 feat: Refactor bridge for better MCP integration
Implemented the refactoring proposal to optimize the bridge for better MCP integration:
- Added resources for context loading (instances, functions, disassembly)
- Added prompts for common analysis patterns
- Reorganized tools into namespaced functions for better discoverability
- Implemented current working instance concept for simpler usage
- Added documentation for the namespaces-based approach
2025-05-22 14:34:40 +02:00
Teal Bauer
58f22316bd chore: Bump version identifiers 2025-05-22 09:12:10 +02:00
Teal Bauer
f71f4aa43b feat: Add strings endpoint to list string data in the binary
The new endpoint provides:
- GET /strings endpoint with pagination and filtering
- Python bridge support via list_strings() function
- Searching of string data types across memory blocks
- Filtering options for string content
2025-05-21 17:15:53 +02:00
Teal Bauer
fedd2d0a55 feat: Update version to 2.0.0-beta.1 and add API version check
- Update Java plugin version to v2.0.0-beta.1
- Add version identifier to bridge script
- Add API version check in bridge to verify plugin compatibility
- Bridge script will now check for API version 2 compatibility
2025-04-14 21:28:50 +02:00
Teal Bauer
6c28553c58 fix: Implement create_data and delete_data functionality
- Add handleCreateData method to Java plugin to support creating new data
- Add data type mapping to support common types like byte, word, dword, string
- Implement delete_data functionality with graceful handling of missing data
- Add proper error handling when conflicts are detected
- Add comprehensive tests for both create_data and delete_data functionality
2025-04-14 21:23:45 +02:00
Teal Bauer
28870e9b54 feat: Improve data manipulation API
- Add comprehensive data manipulation capabilities
- Implement separate pathways for rename-only, type-only, and combined operations
- Fix HTTP request body consumption issue in DataEndpoints
- Standardize on 'type' parameter name instead of 'dataType'
- Add thorough test coverage with dedicated test_data_update.py script
- Update API documentation to version 2 with full endpoint descriptions
- Update CHANGELOG with detailed information about data manipulation features
2025-04-14 19:24:14 +02:00
Teal Bauer
5797fb38e7 feat: Add data renaming and type setting capabilities
- Add support for setting data types and renaming data items
- Fix Java API implementation for data operation endpoints
- Create rename_data and set_data_type tools for clearer separation of concerns
- Add comprehensive test scripts for data operations
- Successfully test changing data types and naming
2025-04-14 12:07:44 +02:00
Teal Bauer
2a1607cacf fix: Update set_decompiler_comment to use function comments 2025-04-14 11:44:42 +02:00
Teal Bauer
9b19011b7d finalize HATEOAS updates 2025-04-14 11:25:22 +02:00
Teal Bauer
96788f35fc feat: Implement proper cross-references (xrefs) functionality
- Java plugin now uses Ghidra ReferenceManager to find real cross-references
- Added detailed information about xrefs, including related functions and instructions
- Bridge script now provides simplified and human-readable text for xrefs
- Support bi-directional search for references to/from addresses
- Added filtering by reference type
- Properly implement getCurrentAddress using Ghidra service APIs
2025-04-14 01:37:41 +02:00
Teal Bauer
4f3042f6ee feat: Update bridge_mcp_hydra.py to work with HATEOAS API
- Remove all legacy API compatibility code
- Implement simplified response structure for AI agents
- Add text representations of structured data like disassembly
- Support addressing functions by name or address
- Improve parameter validation and error handling
- Implement all endpoints from the API specification
2025-04-14 01:28:35 +02:00
Teal Bauer
4bc22674ec feat: Implement HATEOAS-compliant API endpoints
- Add ProgramEndpoints for proper HATEOAS URL structure
- Fix response structure to include required HATEOAS links
- Ensure proper result formats for segments, decompiled functions, and variables
- Reorganize endpoints to use nested resource pattern (/programs/current/functions/{address})
- Fix all tests to ensure HATEOAS compliance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-04-13 20:29:11 +02:00
Teal Bauer
41bfa40d3a Fix bridge error 2025-04-13 09:38:13 +02:00
Teal Bauer
9879e71e88 WIP big refactor 2025-04-10 14:42:53 +02:00
Teal Bauer
57584581bc WIP update APIs 2025-04-09 23:36:05 +02:00
Teal Bauer
ba7781643f chore: Completed conversion of bridge/plugin protocol to pure JSON 2025-04-09 14:35:58 +02:00
Teal Bauer
5d588ba853 Added API documentation and improved bridge functionality
- Added comprehensive GHIDRA_HTTP_API.md documenting the Java plugin's endpoints
- Improved bridge_mcp_hydra.py with better docstrings and type hints
- Updated port range calculations to use DEFAULT_GHIDRA_PORT
- Cleaned up comments and simplified code
- Improved error handling and response formatting
- Standardized API response structure across all endpoints
2025-04-09 10:13:15 +02:00
Teal Bauer
4fe3c16d25 feat: Add decompiler configuration options
Add toggleCCode, toggleSyntaxTree and setSimplificationStyle controls to
the Java plugin. These allow controlling decompiler output format between
C code (default) and raw decompiler output with syntax trees.

Example usage:
decompile_function_by_address(port=8192, address='0x1000', cCode=True)
decompile_function_by_address(port=8192, address='0x1000', syntaxTree=True)
2025-04-08 21:35:37 +02:00
Teal Bauer
9a9d0e933f Fix: Standardize API responses and fix test failures
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
Refactored Java plugin to use helper methods for consistent JSON success/error responses. Fixed NullPointerException in listVariables. Updated Python tests (HTTP and MCP) to use helper assertions validating the standard response structure.
2025-04-07 22:25:02 +02:00
Teal Bauer
a5c600b07f fix: Resolve MCP bridge test failures
Standardizes communication between the Python bridge and Java plugin,
resolves test logic errors, and improves error handling to ensure
MCP bridge tests pass reliably.

Key changes:
- Standardized HTTP methods: Use GET for read operations and POST for all modification operations across the bridge and plugin.
- Fixed JSON parsing in Java plugin using Gson and added missing imports.
- Corrected error handling in Java plugin's `get_function` to return `success: false` when a function is not found.
- Updated Python bridge's `safe_get` to correctly propagate nested failure responses from the plugin.
- Fixed test client logic (`test_mcp_client.py`) to correctly extract function name/address from `list_functions` results.
- Added logging to `test_mcp_client.py` for easier debugging of mutating operations.
2025-04-07 14:31:46 +02:00
Teal Bauer
e462164321 Add Origin checking 2025-04-04 16:15:29 +02:00
Teal Bauer
cbe5dcc1f3 Switch to JSON as bridge/plugin comm protocol 2025-04-04 16:05:42 +02:00
Teal Bauer
04d088591b WIP: Switch to JSON as data exchange format 2025-04-03 18:52:47 +02:00
Teal Bauer
1b07f9430b Update docstrings 2025-04-02 19:38:04 +02:00
Teal Bauer
399c76b29a Expand functionality
Find variables, rename and retype them
Additionally merge changes from https://github.com/LaurieWired/GhidraMCP/pull/16 and https://github.com/LaurieWired/GhidraMCP/pull/18
2025-04-02 18:53:48 +02:00
Teal Bauer
be08f0f2ea Allow renaming and retyping variables 2025-04-02 18:52:02 +02:00
Teal Bauer
dce6aa101c Fix info parsing that was missed in refactoring
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
2025-03-30 03:37:56 +02:00
Teal Bauer
a615813e2d Fix project info endpoints with simpler JSON generation
Simplify JSON response generation for better reliability. Both root and info
endpoints now use direct string building instead of the JSON library.
2025-03-30 03:10:48 +02:00
Teal Bauer
a3ab275fcd Improve instance discovery with custom host parameter and optimized timeouts 2025-03-30 01:19:28 +01:00
Teal Bauer
86d04860bf Add auto-discovery of Ghidra instances and JSON project info endpoint
- Modified bridge_mcp_hydra.py to auto-discover GhydraMCP plugin instances on ports 8192-8299
- Added periodic background thread to maintain discovered instances list
- Added project and binary file information to instance reporting
- Added JSON-based info endpoint in GhydraMCP plugin
- Added json-simple dependency to support JSON responses
2025-03-30 01:06:04 +01:00
Teal Bauer
33be44d7ef Make multi-headed and more RESTful 2025-03-29 22:53:59 +01:00