# imxeno/ghidracord architecture

> Architecture diagram of the GitHub repository imxeno/ghidracord, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imxeno/ghidracord
- Repository: https://github.com/imxeno/ghidracord

## Overview

##### Main Components Identification

a) Plugin Core (GhidracordPlugin.java)
- Represents the bridge between Ghidra and Discord

b) Integration Points
- Ghidra API Integration
- Discord Rich Presence API

c) Configuration System
- Plugin configuration handling
- Tool-specific settings

**Top Layer: Ghidra (Host Application)**

**Middle Layer: Ghidracord Plugin**

**Bottom Layer: Discord Client**

##### Component Relationships

Use the following connection types:

##### Specific Elements

a) Main Components:
- GhidracordPlugin Component
- Discord Rich Presence API
- Discord Client

b) Data Flow:
- Ghidra Events → Plugin
- Plugin → Discord Rich Presence Updates
- Configuration Flow

##### Technical Details to Highlight

- Java-based plugin architecture (evident from src/main/java structure)
- Platform-specific considerations (shown by os/ directory structure)
- Configuration management (based on extension.properties)

**┌─────────────────────────────────────┐**
- Ghidra IDE              │
- ┤

- ┌─────────────────────┐        │
- GhidracordPlugin  │        │
- ┘        │
- ↓                      │
- ┼──────────────────────┘
- ↓
**┌──────────────┼──────────────────────┐**
- Discord Rich Presence API          │
- ┼──────────────────────┘
- ↓
**┌──────────────┼──────────────────────┐**
- Discord Client               │
- ┘

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ghidra fill:#4A90E2,color:white
    classDef plugin fill:#9B59B6,color:white
    classDef discord fill:#FFFFFF,color:black
    classDef config fill:#95A5A6,color:white
    classDef platform fill:#E67E22,color:white

    %% Legend
    subgraph Legend
        L1[Ghidra Components]:::ghidra
        L2[Plugin Components]:::plugin
        L3[Discord Components]:::discord
        L4[Configuration]:::config
        L5[Platform-Specific]:::platform
    end

    %% Main Components
    GhidraIDE[Ghidra IDE]:::ghidra
    
    subgraph Plugin
        MainPlugin[GhidracordPlugin]:::plugin
        Config[Configuration System]:::config
        Platform[Platform Support]:::platform
        Resources[Resource Assets]:::plugin
        Help[Documentation/Help]:::plugin
    end

    subgraph Discord
        DiscordAPI[Discord Rich Presence API]:::discord
        DiscordClient[Discord Client]:::discord
    end

    %% Platform-specific components
    subgraph PlatformSupport
        Linux[Linux x86_64]:::platform
        Mac[Mac x86_64]:::platform
        Windows[Windows x86_64]:::platform
    end

    %% Relationships
    GhidraIDE --> MainPlugin
    MainPlugin --> DiscordAPI
    DiscordAPI --> DiscordClient
    Config --> MainPlugin
    Platform --> MainPlugin
    Resources --> MainPlugin
    Help --> MainPlugin

    Platform --- Linux
    Platform --- Mac
    Platform --- Windows

    %% Click events
    click MainPlugin "https://github.com/imxeno/ghidracord/blob/main/src/main/java/pl/piotradamczyk/ghidracord/GhidracordPlugin.java"
    click Config "https://github.com/imxeno/ghidracord/blob/main/extension.properties"
    click Linux "https://github.com/imxeno/ghidracord/tree/main/os/linux_x86_64/"
    click Mac "https://github.com/imxeno/ghidracord/tree/main/os/mac_x86_64/"
    click Windows "https://github.com/imxeno/ghidracord/tree/main/os/win_x86_64/"
    click Help "https://github.com/imxeno/ghidracord/tree/main/src/main/help/help/"
    click Resources "https://github.com/imxeno/ghidracord/tree/main/src/main/resources/"
```
