# theofficialflow/pppwn architecture

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

- Interactive diagram: https://gitdiagram.com/theofficialflow/pppwn
- Repository: https://github.com/theofficialflow/pppwn

## Overview

PPPwn is a PlayStation 4 PPPoE kernel-exploit proof of concept. The user starts the Python runner on an Ethernet-connected host while initiating a PS4 network test; the runner performs PPPoE setup and exploit stages, then kernel stage1 receives and launches stage2, which displays “PPPwned.” Firmware-specific offsets support the host exploit and both kernel stages. The README describes the overall stage sequence; sampled source confirms key stage1-to-stage2 and notification behavior, but not every internal transition.

Main entry points: [`pppwn.py`](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py) (Exploit Runner), [`stage2/stage2.c`](https://github.com/theofficialflow/pppwn/blob/master/stage2/stage2.c) (Kernel Stage 2), [`stage1/stage1.c`](https://github.com/theofficialflow/pppwn/blob/master/stage1/stage1.c) (Kernel Stage 1), [`offsets.py`](https://github.com/theofficialflow/pppwn/blob/master/offsets.py) (Host Offsets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Host Exploit"]
  node_runner["Exploit Runner<br/>[pppwn.py]"]
  node_host_offsets["Host Offsets<br/>[offsets.py]"]
  node_setup["PPPoE Setup<br/>[pppwn.py]"]
  node_corruption["Memory Corruption<br/>[pppwn.py]"]
  node_kaslr["KASLR Defeat<br/>[pppwn.py]"]
  node_stage0["Initialization<br/>[pppwn.py]"]
  node_stage1_exploit["Stage 1 Exploit<br/>[pppwn.py]"]
  node_stage2_exploit["Stage 2 KASLR<br/>[pppwn.py]"]
  node_stage3_exploit["Stage 3 Execution<br/>[pppwn.py]"]
  node_stage4_exploit["Stage 4 Payload<br/>[pppwn.py]"]
end

subgraph group_kernel["Kernel Payload"]
  node_stage1["Kernel Stage 1<br/>[stage1.c]"]
  node_stage1_offsets["Stage 1 Offsets<br/>[offsets.h]"]
  node_stage2["Kernel Stage 2<br/>[stage2.c]"]
  node_stage2_offsets["Stage 2 Offsets<br/>[offsets.h]"]
end

subgraph group_target["Target Console"]
  node_ps4["PlayStation 4"]
  node_notification["PPPwned Notification<br/>[stage2.c]"]
end

node_operator(("Operator"))

node_operator -->|"starts exploit"| node_runner
node_runner -->|"loads firmware offsets"| node_host_offsets
node_operator -->|"starts network test"| node_ps4
node_runner -->|"negotiates PPPoE"| node_setup
node_setup -->|"precedes"| node_corruption
node_corruption -->|"precedes"| node_kaslr
node_kaslr -->|"precedes"| node_stage0
node_runner -->|"exchanges PPPoE packets"| node_ps4
node_runner -->|"triggers execution"| node_stage1
node_stage1 -->|"uses firmware offsets"| node_stage1_offsets
node_stage1 -->|"receives and calls"| node_stage2
node_stage2 -->|"uses firmware offsets"| node_stage2_offsets
node_runner -->|"sends payload"| node_stage2
node_stage2 -->|"writes notification"| node_notification
node_notification -->|"displays proof"| node_ps4

click node_runner "https://github.com/theofficialflow/pppwn/blob/master/pppwn.py"
click node_host_offsets "https://github.com/theofficialflow/pppwn/blob/master/offsets.py"
click node_setup "https://github.com/theofficialflow/pppwn/blob/master/pppwn.py"
click node_corruption "https://github.com/theofficialflow/pppwn/blob/master/pppwn.py"
click node_kaslr "https://github.com/theofficialflow/pppwn/blob/master/pppwn.py"
click node_stage0 "https://github.com/theofficialflow/pppwn/blob/master/pppwn.py"
click node_stage1_exploit "https://github.com/theofficialflow/pppwn/blob/master/pppwn.py"
click node_stage2_exploit "https://github.com/theofficialflow/pppwn/blob/master/pppwn.py"
click node_stage3_exploit "https://github.com/theofficialflow/pppwn/blob/master/pppwn.py"
click node_stage4_exploit "https://github.com/theofficialflow/pppwn/blob/master/pppwn.py"
click node_stage1 "https://github.com/theofficialflow/pppwn/blob/master/stage1/stage1.c"
click node_stage1_offsets "https://github.com/theofficialflow/pppwn/blob/master/stage1/offsets.h"
click node_stage2 "https://github.com/theofficialflow/pppwn/blob/master/stage2/stage2.c"
click node_stage2_offsets "https://github.com/theofficialflow/pppwn/blob/master/stage2/offsets.h"
click node_notification "https://github.com/theofficialflow/pppwn/blob/master/stage2/stage2.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runner,node_host_offsets,node_setup,node_corruption,node_kaslr,node_stage0,node_stage1_exploit,node_stage2_exploit,node_stage3_exploit,node_stage4_exploit toneBlue
class node_stage1,node_stage1_offsets,node_stage2,node_stage2_offsets toneAmber
class node_ps4,node_notification toneMint
class node_operator toneIndigo
```

## Components

### Host Exploit

- [Exploit Runner](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py): `pppwn.py`
- [Host Offsets](https://github.com/theofficialflow/pppwn/blob/master/offsets.py): `offsets.py`
- [PPPoE Setup](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py): `pppwn.py`
- [Memory Corruption](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py): `pppwn.py`
- [KASLR Defeat](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py): `pppwn.py`
- [Initialization](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py): `pppwn.py`
- [Stage 1 Exploit](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py): `pppwn.py`
- [Stage 2 KASLR](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py): `pppwn.py`
- [Stage 3 Execution](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py): `pppwn.py`
- [Stage 4 Payload](https://github.com/theofficialflow/pppwn/blob/master/pppwn.py): `pppwn.py`

### Kernel Payload

- [Kernel Stage 1](https://github.com/theofficialflow/pppwn/blob/master/stage1/stage1.c): `stage1/stage1.c`
- [Stage 1 Offsets](https://github.com/theofficialflow/pppwn/blob/master/stage1/offsets.h): `stage1/offsets.h`
- [Kernel Stage 2](https://github.com/theofficialflow/pppwn/blob/master/stage2/stage2.c): `stage2/stage2.c`
- [Stage 2 Offsets](https://github.com/theofficialflow/pppwn/blob/master/stage2/offsets.h): `stage2/offsets.h`

### Target Console

- **PlayStation 4**
- [PPPwned Notification](https://github.com/theofficialflow/pppwn/blob/master/stage2/stage2.c): `stage2/stage2.c`

### Other components

- **Operator**

## Connections

- Operator → Exploit Runner: starts exploit (evidence: `README.md`)
- Exploit Runner → Host Offsets: loads firmware offsets (evidence: `pppwn.py`)
- Operator → PlayStation 4: starts network test (evidence: `README.md`)
- Exploit Runner → PPPoE Setup: negotiates PPPoE (evidence: `README.md`)
- PPPoE Setup → Memory Corruption: precedes (evidence: `README.md`)
- Memory Corruption → KASLR Defeat: precedes (evidence: `README.md`)
- KASLR Defeat → Initialization: precedes (evidence: `README.md`)
- Exploit Runner → PlayStation 4: exchanges PPPoE packets (evidence: `pppwn.py`)
- Exploit Runner → Kernel Stage 1: triggers execution (evidence: `README.md`)
- Kernel Stage 1 → Stage 1 Offsets: uses firmware offsets (evidence: `stage1/stage1.c`)
- Kernel Stage 1 → Kernel Stage 2: receives and calls (evidence: `stage1/stage1.c`)
- Kernel Stage 2 → Stage 2 Offsets: uses firmware offsets (evidence: `stage2/stage2.c`)
- Exploit Runner → Kernel Stage 2: sends payload (evidence: `README.md`)
- Kernel Stage 2 → PPPwned Notification: writes notification (evidence: `stage2/stage2.c`)
- PPPwned Notification → PlayStation 4: displays proof (evidence: `stage2/stage2.c`)
