# quarkslab/starlink-tools architecture

> Architecture diagram of the GitHub repository quarkslab/starlink-tools, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quarkslab/starlink-tools
- Repository: https://github.com/quarkslab/starlink-tools

## Overview

##### Main Components Organization

a. Parts Extractor (Rectangle)
- Single-purpose tool for firmware partition extraction
- Input (raw firmware) and output (partitions) flow

b. UNECC Tool (Rectangle)
- ECC removal functionality

c. gRPC Interface (Hexagon)
- Connection to Starlink dish
- Main gRPC operations (device info, hardware version, software updates)
- Network boundary

- Subcomponents:
- Kernel configuration
- FDT (Flattened Device Tree)
- Networking components (TAP interface)
- Root filesystem

- As a layered architecture:
- Frontend layer (HTML/JS interface)
- Server layer
- Library components (separate core functionalities)
- IPC monitoring system

##### Technical Details Layer
A secondary layer showing:
- Programming languages used (Python, Shell scripts)
- Key libraries and frameworks
- Protocol specifications (gRPC)

##### Important Notes
- A note about firmware requirements
- Security boundaries
- Reverse engineering touch points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Tool Component]
        L2([Network Interface])
        L3[(Database/Storage)]
        L4{{Emulation System}}
        L5[/API Gateway/]
        style L1 fill:#blue
        style L2 fill:#green
        style L3 fill:#yellow
        style L4 fill:#orange
        style L5 fill:#purple
    end

    subgraph "Core Tools"
        PE[Parts Extractor]:::core
        UN[UNECC Tool]:::core
        PE --> UN
    end

    subgraph "Network Layer"
        GI[/"gRPC Interface"/]:::network
        DI["Device Info"]:::network
        HV["Hardware Version"]:::network
        SU["Software Updates"]:::network
        GI --> DI
        GI --> HV
        GI --> SU
    end

    subgraph "Emulation System"
        QE{{QEMU Emulator}}:::emulation
        KC["Kernel Config"]:::emulation
        FDT["FDT Component"]:::emulation
        NET["Networking (TAP)"]:::emulation
        RFS["Root Filesystem"]:::emulation
        QE --> KC
        QE --> FDT
        QE --> NET
        QE --> RFS
    end

    subgraph "Slate Sniffer"
        direction TB
        FL["Frontend Layer"]:::sniffer
        SL["Server Layer"]:::sniffer
        LC["Library Components"]:::sniffer
        IPC["IPC Monitoring"]:::sniffer
        CF["Core Functionality"]:::sniffer
        NT["Network Tunnel"]:::sniffer
        FL --> SL
        SL --> LC
        LC --> IPC
        LC --> CF
        LC --> NT
    end

    ST([Starlink Terminal]):::external
    ST -.-> GI
    GI -.-> QE
    QE -.-> LC

    classDef core fill:#blue
    classDef network fill:#green
    classDef emulation fill:#orange
    classDef sniffer fill:#purple
    classDef external fill:#gray

    click PE "https://github.com/quarkslab/starlink-tools/blob/main/parts-extractor/parts-extractor.py"
    click UN "https://github.com/quarkslab/starlink-tools/blob/main/unecc/unecc.py"
    click GI "https://github.com/quarkslab/starlink-tools/tree/main/grpc/"
    click DI "https://github.com/quarkslab/starlink-tools/blob/main/grpc/get_device_info.py"
    click HV "https://github.com/quarkslab/starlink-tools/blob/main/grpc/get_hardware_version.py"
    click SU "https://github.com/quarkslab/starlink-tools/blob/main/grpc/sw_update.py"
    click QE "https://github.com/quarkslab/starlink-tools/tree/main/emulator/"
    click KC "https://github.com/quarkslab/starlink-tools/tree/main/emulator/kernel-configs/kernel-config"
    click FDT "https://github.com/quarkslab/starlink-tools/blob/main/emulator/FDTs/custom.dts"
    click NET "https://github.com/quarkslab/starlink-tools/tree/main/emulator/networking/"
    click FL "https://github.com/quarkslab/starlink-tools/tree/main/slate-sniffer/frontend/"
    click SL "https://github.com/quarkslab/starlink-tools/blob/main/slate-sniffer/server.py"
    click LC "https://github.com/quarkslab/starlink-tools/tree/main/slate-sniffer/lib/"
    click IPC "https://github.com/quarkslab/starlink-tools/blob/main/slate-sniffer/lib/process_monitor_server.py"
    click CF "https://github.com/quarkslab/starlink-tools/blob/main/slate-sniffer/lib/slate.py"
    click NT "https://github.com/quarkslab/starlink-tools/blob/main/slate-sniffer/lib/tunnel.py"
```
