# dryenyen/pppwn-tinker-gui architecture

> Architecture diagram of the GitHub repository dryenyen/pppwn-tinker-gui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dryenyen/pppwn-tinker-gui
- Repository: https://github.com/dryenyen/pppwn-tinker-gui

## Overview

##### Project type and purpose
- This is a desktop GUI application (written in Python/Tkinter) that wraps and orchestrates three different “PPPwn” exploit back-ends (Python, C++ and Rust) to jailbreak a PS4 over Ethernet. It provides a unified interface to select network interfaces, firmware versions, tweak exploit parameters and launch the right binary.

##### File structure
- Top-level:
- PPPwnTinker.py – the main Python/Tkinter GUI script
- pppwn.py – the original Python exploit engine
- backups/ – pre-built Linux/Windows release zips
- licences/ – license files for each back-end
- LICENSE, README.md
- No multiple services or servers—just a single desktop app that invokes local binaries.
- Packaging/build scripts live in the README instructions (PyInstaller/Nuitka commands).

##### Insights from the README
- The GUI calls out to one of three engines:
a. Python (requires Scapy & npcap)
b. C++ binary (compiled via PyInstaller or bundled)
c. Rust binary (YAPPPWN rewrite)
- Under the hood each engine performs low-level packet manipulation via npcap/libpcap to send PPPoE frames and stage1/stage2 payloads.
- The app also reads stage binaries from a folder structure: pppwn/bins/{firmware}/stage1/*.bin and stage2/*.bin.

##### Main components
A. UI Layer
- PPPwnTinker.py (Tkinter UI)
B. Controller/Orchestration
- Parameter gathering (interface, firmware, version, Num values, IPv6)
- Subprocess launcher for chosen back-end
C. Exploit Engines (Back-ends)
1. Python engine (pppwn.py + offsets.py + Scapy)
2. C++ engine (nn9dev’s PPPwn_cpp binary)
3. Rust engine (YAPPPWN binary)
D. Data Store
- Local file system: pppwn/bins/{ver}/… payload files
E. OS & Network Stack
- npcap/libpcap driver
- Host Network Interface
F. External System
- PS4 console (connected via Ethernet)

##### Relationships & data flows
- UI → Controller: user selects options → validated
- Controller → File-system: reads appropriate stage binaries & engine binaries
- Controller → OS/Network driver: configures interface (via Scapy or binary APIs)
- Controller → Engine (subprocess): launches with command-line args
- Engine → Network driver: crafts & sends PPPoE/IPv6 packets toward PS4
- PS4 ←→ Host: responds, stage1 replies, stage2 payload is delivered
- Engine → Controller: logs progress & status → UI console

##### Architectural patterns & design principles
- MVC-like separation:
- View = Tkinter UI
- Controller = argument parsing & process orchestration
- Model = local file-system payloads + engine binaries
- Wrapper/Adapter pattern: the GUI adapts three different CLI engines to a common interface.
- Convention over configuration for folder structure (bins under pppwn/bins).
- Single-process desktop app; no networked microservices.

##### Technologies & frameworks
- Python 3 + Tkinter for GUI
- Scapy library for packet crafting in Python back-end
- npcap/libpcap for Windows/Linux packet I/O
- PyInstaller or Nuitka for packaging
- Native binaries (C++, Rust) for high-speed exploit stages.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Application Layer
    subgraph "Application Layer"
        UI["UI Layer\n(PPPwnTinker.py)"]:::ui
        Assets["Resource Assets\n(img/)"]:::asset
    end

    %% Controller/Orchestrator
    subgraph "Controller/Orchestrator"
        Orchestrator["Controller\n(argument parsing & subprocess)"]:::controller
    end

    %% Exploit Layer
    subgraph "Exploit Layer"
        PythonEngine["Python Engine\n(pppwn.py)"]:::engine
        CppEngine["C++ Engine\n(NN9Dev PPPwn_cpp)"]:::engine
        RustEngine["Rust Engine\n(YAPPPWN)"]:::engine
    end

    %% Data Store
    subgraph "Data Store"
        FileSystem["Payloads & Binaries\n(pppwn/bins/{ver}/stage*.bin)"]:::datastore
        Licenses["Licenses\n(licences/)"]:::datastore
        Metadata["Metadata & Instructions\n(README.md, LICENSE)"]:::datastore
    end

    %% System Layer
    subgraph "System Layer"
        Driver["npcap/libpcap Driver"]:::system
        NIC["Host Network Interface"]:::system
    end

    %% External System
    PS4["PS4 Console"]:::external

    %% Connections
    UI -->|"renders UI, gathers input"| Orchestrator
    UI -->|"loads icons/images"| Assets
    Orchestrator -->|"reads payloads & binaries"| FileSystem
    Orchestrator -->|"loads licenses"| Licenses
    Orchestrator -->|"reads instructions"| Metadata
    Orchestrator -->|"spawns subprocess"| PythonEngine
    Orchestrator -->|"spawns subprocess"| CppEngine
    Orchestrator -->|"spawns subprocess"| RustEngine
    Orchestrator -->|"configures interface"| Driver
    PythonEngine -->|"crafts & sends PPPoE packets"| Driver
    CppEngine -->|"crafts & sends PPPoE packets"| Driver
    RustEngine -->|"crafts & sends PPPoE packets"| Driver
    Driver -->|"Ethernet packets"| NIC
    NIC -->|"network link"| PS4
    PS4 -->|"responses & stage1 reply"| Driver
    Driver -->|"delivers to engine"| PythonEngine
    Driver -->|"delivers to engine"| CppEngine
    Driver -->|"delivers to engine"| RustEngine
    PythonEngine -->|"logs status"| Orchestrator
    CppEngine -->|"logs status"| Orchestrator
    RustEngine -->|"logs status"| Orchestrator

    %% Click Events
    click UI "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/PPPwnTinker.py"
    click Assets "https://github.com/dryenyen/pppwn-tinker-gui/tree/main/img/"
    click PythonEngine "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/pppwn.py"
    click CppEngine "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/backups/PPPwn.Tinker.Linux.zip"
    click CppEngine "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/backups/PPPwn.Tinker.Windows.zip"
    click RustEngine "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/backups/PPPwn.Tinker.Linux.zip"
    click RustEngine "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/backups/PPPwn.Tinker.Windows.zip"
    click Licenses "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/licences/pppwn.license.txt"
    click Licenses "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/licences/pppwn_cpp.license.txt"
    click Licenses "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/licences/YAPPPWN.license.txt"
    click Metadata "https://github.com/dryenyen/pppwn-tinker-gui/blob/main/README.md"
    click Metadata "https://github.com/dryenyen/pppwn-tinker-gui/tree/main/LICENSE"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#005B96,stroke-width:2px
    classDef asset fill:#E0F7FA,stroke:#00796B,stroke-width:2px
    classDef controller fill:#DFF0D8,stroke:#3C763D,stroke-width:2px
    classDef engine fill:#E8DAEF,stroke:#6A1B9A,stroke-width:2px
    classDef datastore fill:#FFF3CD,stroke:#FFEE58,stroke-width:2px
    classDef system fill:#FFE0B2,stroke:#FB8C00,stroke-width:2px
    classDef external fill:#F8D7DA,stroke:#C62828,stroke-width:2px
```
