- 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
2.2 KiB
Ghidra HTTP API Documentation
Base URL
http://{host}:{port}/ (default port: 8192)
Endpoints
Instance Management
GET /instances- List active instancesGET /info- Get project informationGET /- Root endpoint with basic info
Program Analysis
-
GET /functions- List functions- Parameters:
offset- Pagination offsetlimit- Max items to returnquery- Search string for function names
- Parameters:
-
GET /functions/{name}- Get function details- Parameters:
cCode- Return C-style code (true/false)syntaxTree- Include syntax tree (true/false)simplificationStyle- Decompiler style
- Parameters:
-
GET /get_function_by_address- Get function by address- Parameters:
address- Memory address in hex
- Parameters:
-
GET /classes- List classes -
GET /segments- List memory segments -
GET /symbols/imports- List imported symbols -
GET /symbols/exports- List exported symbols -
GET /namespaces- List namespaces -
GET /data- List data items -
GET /variables- List global variables -
GET /functions/{name}/variables- List function variables
Modifications
-
POST /functions/{name}- Rename function- Body:
{"newName": string}
- Body:
-
POST /data- Rename data at address- Body:
{"address": string, "newName": string}
- Body:
-
POST /set_decompiler_comment- Add decompiler comment- Body:
{"address": string, "comment": string}
- Body:
-
POST /set_disassembly_comment- Add disassembly comment- Body:
{"address": string, "comment": string}
- Body:
-
POST /rename_local_variable- Rename local variable- Body:
{"functionAddress": string, "oldName": string, "newName": string}
- Body:
-
POST /rename_function_by_address- Rename function by address- Body:
{"functionAddress": string, "newName": string}
- Body:
-
POST /set_function_prototype- Update function prototype- Body:
{"functionAddress": string, "prototype": string}
- Body:
-
POST /set_local_variable_type- Change variable type- Body:
{"functionAddress": string, "variableName": string, "newType": string}
- Body:
Response Format
All endpoints return JSON with standard structure:
{
"success": boolean,
"result": object|array,
"error": string, // if success=false
"timestamp": number,
"port": number
}