# Ghidra MCP Project Structure > **Organization Guide** - Complete directory structure and file categorization for the Ghidra MCP project. --- ## ๐Ÿ“ Directory Overview ``` ghidra-mcp/ โ”œโ”€โ”€ ๐Ÿ“„ Core Files (Root) โ”‚ โ”œโ”€โ”€ bridge_mcp_ghidra.py # Main MCP server entry point โ”‚ โ”œโ”€โ”€ mcp-config.json # MCP server configuration โ”‚ โ”œโ”€โ”€ pom.xml # Maven build configuration โ”‚ โ”œโ”€โ”€ requirements.txt # Python dependencies โ”‚ โ”œโ”€โ”€ requirements-test.txt # Test dependencies โ”‚ โ”œโ”€โ”€ pytest.ini # Pytest configuration โ”‚ โ””โ”€โ”€ README.md # Project overview โ”‚ โ”œโ”€โ”€ ๐Ÿ”จ Build & Deployment (Root) โ”‚ โ”œโ”€โ”€ deploy-to-ghidra.ps1 # Deploy plugin to Ghidra โ”‚ โ”œโ”€โ”€ copy-ghidra-libs.bat # Copy Ghidra libraries โ”‚ โ”œโ”€โ”€ clean-install.ps1 # Clean installation script โ”‚ โ””โ”€โ”€ cleanup.ps1 # Cleanup build artifacts โ”‚ โ”œโ”€โ”€ ๐Ÿ“Š Analysis & Data Files (Root) โ”‚ โ”œโ”€โ”€ game.json # Game executable analysis data โ”‚ โ”œโ”€โ”€ game_minify.json # Minified game data โ”‚ โ”œโ”€โ”€ dll_exports.json # DLL export mappings โ”‚ โ”œโ”€โ”€ dll_exports.txt # Text format DLL exports โ”‚ โ”œโ”€โ”€ process_whitelist.json # Processing whitelist โ”‚ โ””โ”€โ”€ ghidra-custom-d2call-convention.xml # Custom calling convention โ”‚ โ”œโ”€โ”€ ๐Ÿ“š Documentation (Root - Organization) โ”‚ โ”œโ”€โ”€ START_HERE.md # Quick start guide โ”‚ โ”œโ”€โ”€ README.md # Project overview โ”‚ โ”œโ”€โ”€ DOCUMENTATION_INDEX.md # Master documentation index โ”‚ โ”œโ”€โ”€ CHANGELOG.md # Version history โ”‚ โ”œโ”€โ”€ CONTRIBUTING.md # Contribution guidelines โ”‚ โ”œโ”€โ”€ LICENSE # Project license โ”‚ โ”œโ”€โ”€ CLAUDE.md # Claude AI integration guide โ”‚ โ”œโ”€โ”€ NAMING_CONVENTIONS.md # Naming standards โ”‚ โ”œโ”€โ”€ IMPROVEMENTS.md # Project improvements log โ”‚ โ”œโ”€โ”€ IMPROVEMENTS_QUICK_REFERENCE.md # Quick reference โ”‚ โ”œโ”€โ”€ MCP_TOOLS_IMPROVEMENTS.md # MCP tools changelog โ”‚ โ”œโ”€โ”€ GAME_EXE_IMPROVEMENTS.md # Game.exe analysis improvements โ”‚ โ””โ”€โ”€ MAVEN_VERSION_MANAGEMENT.md # Maven versioning guide โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ docs/ - Comprehensive Documentation โ”‚ โ”œโ”€โ”€ ๐Ÿ“– API & Reference โ”‚ โ”‚ โ”œโ”€โ”€ API_REFERENCE.md # Complete API documentation โ”‚ โ”‚ โ”œโ”€โ”€ TOOL_REFERENCE.md # Tool usage reference โ”‚ โ”‚ โ”œโ”€โ”€ GHIDRA_MCP_TOOLS_REFERENCE.md # MCP tools catalog โ”‚ โ”‚ โ”œโ”€โ”€ ERROR_CODES.md # Error code reference โ”‚ โ”‚ โ””โ”€โ”€ DATA_TYPE_TOOLS.md # Data type tool guide โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“˜ Guides โ”‚ โ”‚ โ”œโ”€โ”€ DEVELOPMENT_GUIDE.md # Development workflow โ”‚ โ”‚ โ”œโ”€โ”€ HYBRID_PROCESSOR_GUIDE.md # Hybrid processing guide โ”‚ โ”‚ โ”œโ”€โ”€ D2_BINARY_ANALYSIS_INTEGRATION_GUIDE.md โ”‚ โ”‚ โ””โ”€โ”€ D2_CONVENTION_SCRIPTS_README.md โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ”ฌ Analysis โ”‚ โ”‚ โ””โ”€โ”€ GAME_EXE_BINARY_ANALYSIS.md # Complete binary analysis โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŽฏ Strategy & Planning โ”‚ โ”‚ โ”œโ”€โ”€ AGENT_ITERATION_STRATEGIES.md โ”‚ โ”‚ โ””โ”€โ”€ PERFORMANCE_BASELINES.md โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ Conventions โ”‚ โ”‚ โ””โ”€โ”€ (Naming and coding standards) โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿงช Testing โ”‚ โ”‚ โ””โ”€โ”€ (Test documentation and guides) โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ› ๏ธ Troubleshooting โ”‚ โ”‚ โ””โ”€โ”€ (Common issues and solutions) โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“‹ Reports โ”‚ โ”‚ โ”œโ”€โ”€ PROJECT_CLEANUP_SUMMARY.md โ”‚ โ”‚ โ”œโ”€โ”€ QUICKWIN_COMPLETION_REPORT.md โ”‚ โ”‚ โ”œโ”€โ”€ SESSION_SUMMARY_BINARY_ANALYSIS.md โ”‚ โ”‚ โ”œโ”€โ”€ VERSION_FIX_COMPLETE.md โ”‚ โ”‚ โ”œโ”€โ”€ VERSION_MANAGEMENT_COMPLETE.md โ”‚ โ”‚ โ””โ”€โ”€ CLEANUP_FINAL_REPORT.md โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ—„๏ธ archive/ โ”‚ โ””โ”€โ”€ (Historical documentation) โ”‚ โ”œโ”€โ”€ ๐Ÿ› ๏ธ scripts/ - Automation & Utilities โ”‚ โ”œโ”€โ”€ ๐Ÿ”„ Data Processing โ”‚ โ”‚ โ”œโ”€โ”€ data-extract.ps1 # Extract data from Ghidra โ”‚ โ”‚ โ”œโ”€โ”€ data-process.ps1 # Process extracted data โ”‚ โ”‚ โ”œโ”€โ”€ process_char_arrays.py # Character array processing โ”‚ โ”‚ โ””โ”€โ”€ make_data_meaningful.py # Data naming automation โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ โšก Function Processing โ”‚ โ”‚ โ”œโ”€โ”€ functions-extract.ps1 # Extract function data โ”‚ โ”‚ โ”œโ”€โ”€ functions-process.ps1 # Process functions โ”‚ โ”‚ โ”œโ”€โ”€ hybrid-function-processor.ps1 # Hybrid processing โ”‚ โ”‚ โ””โ”€โ”€ FunctionsTodo.txt # Function processing tasks โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿงช Testing & Validation โ”‚ โ”‚ โ”œโ”€โ”€ test_convention_detection.py โ”‚ โ”‚ โ”œโ”€โ”€ test_d2_detection.py โ”‚ โ”‚ โ”œโ”€โ”€ test_d2_simple.py โ”‚ โ”‚ โ”œโ”€โ”€ test_data_xrefs_tool.py โ”‚ โ”‚ โ”œโ”€โ”€ validate_function_accuracy.py โ”‚ โ”‚ โ”œโ”€โ”€ verify_all_structures.py โ”‚ โ”‚ โ”œโ”€โ”€ quick_detection_test.py โ”‚ โ”‚ โ”œโ”€โ”€ ghidra_rest_api_functional_tests.py โ”‚ โ”‚ โ”œโ”€โ”€ ghidra_server_health_check.py โ”‚ โ”‚ โ””โ”€โ”€ ghidra_plugin_deployment_verifier.py โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ”ง Fix & Repair โ”‚ โ”‚ โ”œโ”€โ”€ fix_undefined_types.py โ”‚ โ”‚ โ”œโ”€โ”€ apply_edge_case_fixes.py โ”‚ โ”‚ โ”œโ”€โ”€ apply_test_fixes.py โ”‚ โ”‚ โ”œโ”€โ”€ automated_edge_case_fix.py โ”‚ โ”‚ โ”œโ”€โ”€ run_edge_case_validation.py โ”‚ โ”‚ โ””โ”€โ”€ ClearCallReturnOverrides.java โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“Š Reporting & Analysis โ”‚ โ”‚ โ”œโ”€โ”€ final_comprehensive_report.py โ”‚ โ”‚ โ”œโ”€โ”€ ghidra_mcp_usage_examples.py โ”‚ โ”‚ โ””โ”€โ”€ search_punit_references.py โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ” Verification โ”‚ โ”‚ โ””โ”€โ”€ verify_version.py โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ Configuration โ”‚ โ”‚ โ”œโ”€โ”€ scripts_config.py โ”‚ โ”‚ โ”œโ”€โ”€ process_whitelist.json โ”‚ โ”‚ โ””โ”€โ”€ TEST_SUITE_README.md โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“– Documentation โ”‚ โ”œโ”€โ”€ README.md โ”‚ โ””โ”€โ”€ CONFIGURATION_MIGRATION_GUIDE.md โ”‚ โ”œโ”€โ”€ ๐Ÿ”ง tools/ - Specialized Utilities (Root Level) โ”‚ โ”œโ”€โ”€ ๐ŸŽฏ Ordinal Link Management โ”‚ โ”‚ โ”œโ”€โ”€ ordinal_linkage_manager.py # Main ordinal manager โ”‚ โ”‚ โ”œโ”€โ”€ ordinal_function_mapping.py # Function mapping โ”‚ โ”‚ โ”œโ”€โ”€ ordinal_auto_fixer.py # Automatic fixing โ”‚ โ”‚ โ”œโ”€โ”€ export_dll_functions.py # Export DLL functions โ”‚ โ”‚ โ”œโ”€โ”€ extract_external_function_pointers.py โ”‚ โ”‚ โ”œโ”€โ”€ generate_ordinal_mapping.py # Generate mappings โ”‚ โ”‚ โ”œโ”€โ”€ list_import_pointers.py # List imports โ”‚ โ”‚ โ””โ”€โ”€ process_all_dlls.py # Batch DLL processing โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ” Analysis & Processing โ”‚ โ”‚ โ”œโ”€โ”€ mcp_function_processor.py # Function processing โ”‚ โ”‚ โ”œโ”€โ”€ memory_dumper.py # Memory dumping โ”‚ โ”‚ โ””โ”€โ”€ Dump-ProcessMemory.ps1 # PowerShell memory dump โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿงช Testing & Validation โ”‚ โ”‚ โ”œโ”€โ”€ test_single_dll.py # Single DLL testing โ”‚ โ”‚ โ”œโ”€โ”€ test_improvements.py # Test improvements โ”‚ โ”‚ โ”œโ”€โ”€ validate_d2net.py # D2Net validation โ”‚ โ”‚ โ”œโ”€โ”€ test_d2net_fix.ps1 # D2Net fix testing โ”‚ โ”‚ โ”œโ”€โ”€ run_fix_and_validate.ps1 # Fix & validate โ”‚ โ”‚ โ”œโ”€โ”€ execute_and_validate.ps1 # Execute & validate โ”‚ โ”‚ โ”œโ”€โ”€ run_headless_fix.py # Headless fix runner โ”‚ โ”‚ โ””โ”€โ”€ fix_test_functions.py # Test function fixes โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“„ tools/ subdirectory โ”‚ โ”œโ”€โ”€ document_function.py # Function documentation โ”‚ โ”œโ”€โ”€ scan_undocumented_functions.py โ”‚ โ””โ”€โ”€ scan_functions_mcp.py โ”‚ โ”œโ”€โ”€ ๐Ÿงฉ src/ - Java Source Code โ”‚ โ””โ”€โ”€ main/java/com/github/ghidramcp/ โ”‚ โ””โ”€โ”€ (Ghidra plugin source code) โ”‚ โ”œโ”€โ”€ ๐Ÿงช tests/ - Python Test Suite โ”‚ โ”œโ”€โ”€ test_enhanced_mcp.py โ”‚ โ”œโ”€โ”€ test_complete_system.py โ”‚ โ”œโ”€โ”€ test_claude_simple.py โ”‚ โ”œโ”€โ”€ test_http_struct_tools.py โ”‚ โ”œโ”€โ”€ test_enhanced_prompt_tools.py โ”‚ โ””โ”€โ”€ test_mcp_category_tools.py โ”‚ โ”œโ”€โ”€ ๐ŸŽฎ ghidra_scripts/ - Ghidra Scripts โ”‚ โ””โ”€โ”€ (Java scripts for Ghidra automation) โ”‚ โ”œโ”€โ”€ ๐Ÿ’ก examples/ - Usage Examples โ”‚ โ””โ”€โ”€ (Example code and demonstrations) โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฆ lib/ - External Libraries โ”‚ โ””โ”€โ”€ (Third-party dependencies) โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ dll_exports/ - DLL Export Data โ”‚ โ””โ”€โ”€ (Exported function lists per DLL) โ”‚ โ”œโ”€โ”€ ๐Ÿ“Š logs/ - Runtime Logs โ”‚ โ””โ”€โ”€ (Application and test logs) โ”‚ โ”œโ”€โ”€ ๐Ÿ—๏ธ target/ - Build Artifacts โ”‚ โ””โ”€โ”€ (Maven build output) โ”‚ โ””โ”€โ”€ ๐Ÿ–ผ๏ธ images/ - Documentation Assets โ””โ”€โ”€ (Screenshots and diagrams) ``` --- ## ๐Ÿ“‹ File Categories ### Core Application Files (Keep in Root) Essential files that define the project and should remain at root level: - `bridge_mcp_ghidra.py` - Main MCP server - `pom.xml` - Maven configuration - `requirements*.txt` - Dependencies - `mcp-config.json` - Server config - `README.md`, `LICENSE`, `START_HERE.md` ### Build & Deployment (Keep in Root) Scripts frequently used during development: - `deploy-to-ghidra.ps1` - `copy-ghidra-libs.bat` - `clean-install.ps1` - `cleanup.ps1` ### Data Files (Keep in Root) Frequently accessed analysis data: - `game.json`, `game_minify.json` - `dll_exports.json`, `dll_exports.txt` - `process_whitelist.json` - `ghidra-custom-d2call-convention.xml` ### Documentation (Organized in Root + docs/) - **Root level**: Organization and quick-start docs - **docs/**: Comprehensive guides, references, and reports ### Scripts (scripts/ directory) Organized by function: - Data extraction/processing - Function analysis - Testing and validation - Fix/repair utilities - Configuration and reporting ### Tools (Root level + tools/ subdirectory) Specialized utilities for: - Ordinal linkage management - DLL analysis - Memory operations - Validation workflows --- ## ๐Ÿ”„ Proposed Reorganization ### Phase 1: Move Root-Level Scripts **To scripts/ordinal-tools/**: ``` ordinal_linkage_manager.py ordinal_function_mapping.py ordinal_auto_fixer.py export_dll_functions.py extract_external_function_pointers.py generate_ordinal_mapping.py list_import_pointers.py process_all_dlls.py ``` **To scripts/testing/**: ``` test_single_dll.py test_improvements.py validate_d2net.py fix_test_functions.py ``` **To scripts/validation/**: ``` test_d2net_fix.ps1 run_fix_and_validate.ps1 execute_and_validate.ps1 run_headless_fix.py ``` **To scripts/utilities/**: ``` mcp_function_processor.py memory_dumper.py Dump-ProcessMemory.ps1 ``` ### Phase 2: Consolidate Documentation **Move to docs/reports/**: ``` PROJECT_CLEANUP_SUMMARY.md QUICKWIN_COMPLETION_REPORT.md SESSION_SUMMARY_BINARY_ANALYSIS.md VERSION_FIX_COMPLETE.md VERSION_MANAGEMENT_COMPLETE.md VERSION_MANAGEMENT_STRATEGY.md CLEANUP_FINAL_REPORT.md STRUCTURE_SUMMARY.txt ``` **Keep in Root** (frequently referenced): ``` START_HERE.md README.md CHANGELOG.md CONTRIBUTING.md DOCUMENTATION_INDEX.md CLAUDE.md NAMING_CONVENTIONS.md ``` ### Phase 3: Update References After moving files: 1. Update import statements in Python scripts 2. Update path references in PowerShell scripts 3. Update documentation links 4. Update VSCode tasks.json paths 5. Update .gitignore patterns --- ### ๐Ÿ“ Usage Guidelines ### When Adding New Files: 1. **Scripts for automation** โ†’ `scripts/` (categorized by purpose) 2. **Specialized tools** โ†’ Keep in root or `tools/` subdirectory 3. **Documentation** โ†’ `docs/` (by category) or root (if frequently accessed) 4. **Test files** โ†’ `tests/` (Python) or `scripts/testing/` (validation scripts) 5. **Configuration** โ†’ Root level for project-wide, `scripts/` for script-specific 6. **Data files** โ†’ Root level for frequently accessed, `dll_exports/` for DLL data **Naming Standards**: - Follow [MARKDOWN_NAMING.md](MARKDOWN_NAMING.md) for documentation files - Use kebab-case for markdown: `getting-started.md`, `api-reference.md` - Reserve UPPERCASE only for: `README.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, `LICENSE` - See [.github/MARKDOWN_NAMING_GUIDE.md](.github/MARKDOWN_NAMING_GUIDE.md) for complete guide ### Directory Access Patterns: - **Daily development**: Root, scripts/, docs/guides/ - **Building/deploying**: Root (build scripts) - **Testing**: tests/, scripts/testing/ - **Documentation**: docs/ (all subdirectories) - **Analysis**: game.json, dll_exports/, docs/analysis/ --- ## ๐Ÿš€ Quick Navigation | Task | Location | |------|----------| | Start MCP server | `bridge_mcp_ghidra.py` | | Deploy plugin | `deploy-to-ghidra.ps1` | | Run tests | `pytest tests/` | | Extract functions | `scripts/functions-extract.ps1` | | Process data | `scripts/data-process.ps1` | | Fix ordinals | `ordinal_linkage_manager.py` (root) | | View API docs | `docs/API_REFERENCE.md` | | Read guides | `docs/guides/` | | Check analysis | `docs/analysis/GAME_EXE_BINARY_ANALYSIS.md` | | Find examples | `examples/` | --- ## ๐Ÿ“Š Statistics - **Root-level files**: ~40 files (to be reduced to ~25) - **Documentation files**: ~15 in root, ~30 in docs/ - **Python scripts**: ~172 total - **PowerShell scripts**: ~24 total - **Directories**: 15+ main directories --- **Last Updated**: November 6, 2025 **Version**: 1.0.0 **Status**: Organization in progress