Skip to content

Latest commit

Β 

History

History
279 lines (217 loc) Β· 10.4 KB

File metadata and controls

279 lines (217 loc) Β· 10.4 KB

MCP Debugger πŸ”

Build Status Code Quality Security Thread Safety

Enterprise-grade AI-powered reverse engineering tool that seamlessly integrates with x64dbg debugger to provide intelligent analysis of binary executables, memory dumps, and debugging sessions.

πŸš€ Quick Start

Prerequisites

  • Windows 10/11 (x64)
  • Visual Studio 2022 with C++17 support
  • x64dbg debugger
  • API Keys for supported AI providers (Claude, OpenAI, Gemini)

Installation

  1. Download Latest Release

    # Download from releases page or build from source
    git clone https://github.com/m4rba4s/mcp_debugger.git
    cd mcp_debugger
  2. Quick Build

    .\build.ps1 -Config Release -RunTests
  3. Configure AI Providers

    # Edit config/config.json
    {
      "llm_providers": {
        "claude": {
          "api_key": "your-claude-api-key",
          "model": "claude-3-sonnet-20240229"
        }
      }
    }
  4. Install x64dbg Plugin

    # Copy plugin to x64dbg directory
    copy build\Release\mcp_debugger.dp64 "C:\x64dbg\release\x64\plugins\"

✨ Features

πŸ€– AI-Powered Analysis

  • Multi-Provider Support: Claude 3.5, GPT-4, Gemini Pro
  • Intelligent Code Analysis: Pattern recognition, vulnerability detection
  • Natural Language Queries: Ask questions about your binary in plain English
  • Context-Aware Responses: AI understands debugging context

πŸ”§ x64dbg Integration

  • Seamless Plugin: Native x64dbg plugin with mcp_analyze command
  • Real-time Analysis: Analyze memory, registers, and call stacks instantly
  • Automated Annotations: AI-generated comments and insights
  • Custom Commands: Extend functionality through S-expressions

πŸ›‘οΈ Enterprise Security

  • AES-256-GCM Encryption: All credentials encrypted at rest
  • Zero Credential Leaks: Comprehensive input sanitization
  • Memory Safety: Modern C++ with RAII throughout
  • DoS Protection: Input validation and resource limits

πŸ“Š Advanced Analysis

  • Memory Dump Analysis: Pattern detection, string extraction
  • Binary Pattern Recognition: Packed executables, obfuscation detection
  • Assembly Intelligence: x86/x64 instruction analysis with AI insights
  • Vulnerability Assessment: Security-focused analysis patterns

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     MCP Debugger Core                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   LLM Engine    β”‚  Security Mgr   β”‚     Config Manager      β”‚
β”‚                 β”‚                 β”‚                         β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚   Claude    β”‚ β”‚ β”‚ Credential  β”‚ β”‚ β”‚    JSON Config      β”‚ β”‚
β”‚ β”‚   OpenAI    β”‚ β”‚ β”‚ Encryption  β”‚ β”‚ β”‚    Validation       β”‚ β”‚
β”‚ β”‚   Gemini    β”‚ β”‚ β”‚ Key Mgmt    β”‚ β”‚ β”‚    Hot Reload       β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  X64DBG Bridge  β”‚   Parser/Eval   β”‚       Analyzer          β”‚
β”‚                 β”‚                 β”‚                         β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚   Memory    β”‚ β”‚ β”‚ S-Expr      β”‚ β”‚ β”‚  Pattern Detection  β”‚ β”‚
β”‚ β”‚   Events    β”‚ β”‚ β”‚ Commands    β”‚ β”‚ β”‚  Memory Analysis    β”‚ β”‚
β”‚ β”‚   Debug     β”‚ β”‚ β”‚ Variables   β”‚ β”‚ β”‚  Binary Insights    β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Usage Examples

Basic Memory Analysis

; Analyze memory region for patterns
(analyze-memory 0x401000 1024 "Look for string patterns and API calls")

; Get AI insights on assembly code
(disasm-ai 0x401000 32 "Explain what this function does")

; Search for vulnerabilities
(find-vulns 0x400000 0x500000 "Check for buffer overflows")

AI-Powered Debugging

; Ask natural language questions
(ask "What does this function at 0x401234 do?")
(ask "Are there any security issues in this code?")
(ask "Explain the calling convention used here")

; Pattern-based analysis
(find-patterns "encryption" 0x400000 0x500000)
(identify-packer "UPX|Themida|VMProtect")

Advanced Analysis

; Memory dump analysis
(dump-analyze "memory.dmp" "Look for credentials and keys")

; Control flow analysis  
(trace-calls 0x401000 "Map the execution flow")

; String analysis
(extract-strings 0x402000 1024 "Find interesting strings")

πŸ“ˆ Quality Metrics

πŸ† Code Quality: A- (Excellent)

Category Grade Status
Security A+ βœ… No vulnerabilities found
Performance A βœ… Optimized algorithms
Maintainability A βœ… Clean, documented code
Architecture A+ βœ… Excellent design patterns
Thread Safety A+ βœ… Comprehensive synchronization
Resource Management A+ βœ… Perfect RAII compliance

πŸ“Š Analysis Results

  • βœ… 36/36 Quality Checks Passed
  • βœ… 0 Critical Issues Found
  • βœ… 0 Security Vulnerabilities
  • βœ… 0 Memory Leaks
  • βœ… 0 Race Conditions

Full analysis report: Code Quality Report

πŸ”’ Security Features

Credential Management

  • AES-256-GCM encryption for all stored credentials
  • Secure memory wiping on application exit
  • Key rotation with configurable intervals
  • Zero hardcoded secrets in codebase

Input Validation

  • Comprehensive size limits (DoS protection)
  • Format validation with regex patterns
  • Memory bounds checking for all operations
  • Command injection prevention

Network Security

  • TLS 1.3 for all API communications
  • Certificate validation enforced
  • Request/response sanitization
  • Timeout and retry limits

πŸ§ͺ Testing

Automated Testing

# Run complete test suite
.\build.ps1 -RunTests

# Integration tests
python scripts\run_integration_tests.py

# Security scanning
python scripts\security_scan.py

Manual Testing

# Static analysis
.\static-analysis.ps1 -All

# Performance benchmarks
.\scripts\benchmark.ps1

πŸ“š Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# 1. Clone repository
git clone https://github.com/m4rba4s/mcp_debugger.git

# 2. Setup dependencies
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg.exe install

# 3. Build and test
.\build.ps1 -Config Debug -RunTests

Code Quality Standards

  • C++17 standard compliance
  • RAII for all resource management
  • Interface-based architecture
  • Comprehensive unit testing
  • Security-first development

πŸ“‹ Changelog

v1.1.0 (2025-01-02) - Quality & Security Release

  • ✨ Enterprise-grade code quality achieved (A- rating)
  • πŸ”’ Comprehensive security analysis - zero vulnerabilities
  • 🧡 Thread safety verification - no race conditions
  • πŸ“Š Complete static analysis integration
  • πŸ”§ Enhanced build system with automated testing
  • πŸ“š Improved documentation and guides

v1.0.0 (2024-12-15) - Initial Release

  • πŸŽ‰ Core functionality implemented
  • πŸ€– Multi-AI provider support
  • πŸ”§ x64dbg plugin integration
  • πŸ›‘οΈ Security framework established

πŸ”— Links

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • x64dbg Team - For the excellent debugging platform
  • Anthropic, OpenAI, Google - For AI model access
  • vcpkg Team - For dependency management
  • C++ Community - For modern C++ standards and practices

Built with ❀️ for the reverse engineering community

Stars Forks