140 Commits

Author SHA1 Message Date
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
6c865c456e perf: Optimize variables endpoint with efficient pagination
- Implemented efficient pagination for variables endpoints to avoid timeout
- Added globalOnly parameter to allow fetching just global variables
- Limited decompilation to only process functions needed for current page
- Improved estimation of total count for better pagination links
- Reduced decompilation timeout to improve performance
2025-04-14 00:49:46 +02:00
Teal Bauer
3df129f3fd fix: Implement real instruction disassembly and fix xrefs and memory endpoints
- Fixed disassembly endpoint to show real instructions instead of placeholders
- Improved memory endpoint to handle address errors gracefully
- Fixed address arithmetic error in xrefs endpoint
- Added proper error handling and fallbacks in all endpoints
2025-04-14 00:16:49 +02:00
Teal Bauer
3311e88565 WIP fix endpoints 2025-04-14 00:08:10 +02:00
Teal Bauer
5d6b202599 Restore the correct API doc 2025-04-13 20:46:49 +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
454c73908c feat: Complete Ghidra HTTP API implementation
- Added memory operations (read/write)
- Implemented cross-reference analysis
- Added program analysis tools (callgraph, dataflow)
- Standardized all endpoints to use structured JSON
- Improved error handling and response metadata
- Added comprehensive API documentation
2025-04-10 00:01:04 +02:00
Teal Bauer
57584581bc WIP update APIs 2025-04-09 23:36:05 +02:00
Teal Bauer
6b2e572bd4 API evolution plan 2025-04-09 20:52:55 +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
9a1f97fa80 Make GHYDRAMCP host and port configurable for tests 2025-04-09 10:15:49 +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
bd56f5b6cc fix: failure response for decompile_function with address 2025-04-08 10:50:18 +02:00
Teal Bauer
52e0142f83 Update CHANGELOG.md for v1.4.0 release 2025-04-08 10:43:56 +02:00
Teal Bauer
c1d12a1ac8 fix: build complete package in package phase
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
v1.4.0-beta6
2025-04-08 10:40:14 +02:00
Teal Bauer
e94f91dc01 fix: We don't need destName, we can keep the version info
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
v1.4.0-beta5
2025-04-08 10:35:08 +02:00
Teal Bauer
c530976a6a fix: Force inner ZIP to be included 2025-04-08 10:34:06 +02:00
Teal Bauer
8f3fa16ad8 Explicitly require ProgramManager 2025-04-08 09:44:11 +02:00
Teal Bauer
a469b38ec4 fix: Fix versioning once and for all, maybe? 2025-04-08 09:43:53 +02:00
Teal Bauer
ea3776e485 fix: make fetching closest git tag work 2025-04-08 09:28:32 +02:00
Teal Bauer
d4122402b4 fix: Make sure jar is always named GhydraMCP.jar 2025-04-08 09:02:59 +02:00
Teal Bauer
3a1772a3c9 fix: ensure extension zip included in complete package
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
Moved plugin assembly execution to prepare-package phase to ensure
the extension zip artifact is created before the package phase.

Added maven-resources-plugin execution (copy-plugin-zip) to the
package phase to copy the generated extension zip into a reliable
'target/staging' directory.

Updated complete-package.xml assembly descriptor to use a fileSet
referencing 'target/staging' instead of relying on dependencySets
or potentially unstable property expansion for artifact inclusion.

This resolves the issue where the complete package artifact was
missing the Ghidra extension zip.
v1.4.0-beta4
2025-04-07 22:50:26 +02:00
Teal Bauer
908d0decfe fix: Correct GHA complete package assembly
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
Updated complete-package.xml to use correct properties
(${git.commit.id.abbrev}-${maven.build.timestamp}) for including the
Ghidra extension zip artifact, resolving the incomplete package issue
in GHA builds.
v1.4.0-beta3
2025-04-07 22:39:30 +02:00
Teal Bauer
3ef444348c fix: Add permissions key to GHA workflow
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
v1.4.0-beta2
2025-04-07 22:30:30 +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.
v1.4.0-beta
2025-04-07 22:25:02 +02:00
Teal Bauer
2dc1adb982 Fix github release action versioning 2025-04-07 14:52:31 +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
14eae14f63 Switch all results over to JSON 2025-04-04 18:10:45 +02:00
Teal Bauer
ba63ffeb54 Add mutating tests (WIP) 2025-04-04 17:00:41 +02:00
Teal Bauer
e462164321 Add Origin checking 2025-04-04 16:15:29 +02:00
Teal Bauer
1e737ed44b Add testing and update README for JSON & testing 2025-04-04 16:06:36 +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
89396469b2 Fix release version tag
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
v1.3.0
2025-04-02 20:41:31 +02:00
Teal Bauer
9aa93c4933 Release v1.3.0 2025-04-02 19:52:52 +02:00
Teal Bauer
1b07f9430b Update docstrings 2025-04-02 19:38:04 +02:00
Teal Bauer
d4611377c8 Merge branch 'variable-mangling' 2025-04-02 18:54:36 +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
1bfdf74554 Add version info to build output
- If tagged, use the tag version
- Otherwise use dev-SNAPSHOT plus commit id and timestamp
2025-04-02 18:52:55 +02:00
Teal Bauer
be08f0f2ea Allow renaming and retyping variables 2025-04-02 18:52:02 +02:00
Teal Starsong
883fde7344 Update version to 11.3.1 and fix complete package to include bridge script 2025-03-31 18:15:41 +02:00
Teal Bauer
dce6aa101c Fix info parsing that was missed in refactoring
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
v1.2
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
5cf8f5fb16 Update plugin description to better reflect its purpose 2025-03-30 01:27:56 +01:00
Teal Bauer
07c94b2324 Merge branch 'auto-register' 2025-03-30 01:21:19 +01:00
Teal Bauer
e620831957 Update README with auto-discovery documentation and examples 2025-03-30 01:20:53 +01:00
Teal Bauer
a3ab275fcd Improve instance discovery with custom host parameter and optimized timeouts 2025-03-30 01:19:28 +01:00