# ansfidine/flipper-zero-toolkit architecture

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

- Interactive diagram: https://gitdiagram.com/ansfidine/flipper-zero-toolkit
- Repository: https://github.com/ansfidine/flipper-zero-toolkit

## Overview

This repository is a collection of Flipper Zero apps, not one end-to-end product. The README foregrounds BadUSB payload execution and category-based Sub-GHz scanning; the tree also contains a GPIO sensor bridge and a separate Sub-GHz pentest app. The graph preserves those distinct app workflows and their meaningful runtime stages. Some paths and behaviors are documented but not fully sampled, so uncertain interactions are omitted or shown as unverified.

Main entry points: [`apps/subghz-easy/subghz_ui.c`](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_ui.c) (Category and signal UI), [`apps/gpio-sensor-bridge/gpio_sensor_bridge.c`](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/gpio-sensor-bridge/gpio_sensor_bridge.c) (App and scene router), [`apps/subghz-pentest/subghz_pentest.c`](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/subghz_pentest.c) (App and scene router), [`apps/subghz-pentest/scenes/scene_category_scan.c`](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/scenes/scene_category_scan.c) (Category scan scene)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_badusb["BadUSB Manager"]
  node_badusb_ui["Menu and scenes<br/>[badusb_manager.c]"]
  node_badusb_engine["Script executor<br/>[badusb_manager.c]"]
  node_sd_payloads[("SD payload files")]
  node_hid["USB HID keyboard"]
end

subgraph group_easy["Sub-GHz Easy"]
  node_easy_entry["App entry and state<br/>[subghz_main.c]"]
  node_easy_ui["Category and signal UI<br/>[subghz_ui.c]"]
  node_easy_worker["RSSI worker<br/>[subghz_worker.c]"]
  node_easy_radio["Radio operations<br/>[subghz_radio.c]"]
  node_easy_capture["Signal capture<br/>[subghz_capture.c]"]
  node_easy_replay["Signal replay<br/>[subghz_replay.c]"]
  node_easy_files[("Signal files<br/>[subghz_file.c]")]
end

subgraph group_pentest["Sub-GHz Pentest"]
  node_pentest_entry["App and scene router<br/>[subghz_pentest.c]"]
  node_pentest_category["Category scan scene"]
  node_pentest_custom["Custom scan scene"]
  node_pentest_capture_mode["Capture mode scene"]
  node_pentest_transmit["Transmit scene<br/>[scene_transmit.c]"]
  node_pentest_worker["Sweep worker"]
  node_pentest_capture["Capture and signal data"]
end

subgraph group_gpio["GPIO Sensor Bridge"]
  node_gpio_entry["App and scene router"]
  node_gpio_scan["I2C scan scene<br/>[scene_i2c_scan.c]"]
  node_gpio_sensor["BME280 detection<br/>[scene_sensor.c]"]
  node_gpio_about["About scene<br/>[scene_about.c]"]
end

node_user(("Flipper user"))
node_payloads["Payload scripts"]
node_target_pc(("USB host PC"))

node_user -->|"selects payload"| node_badusb_ui
node_payloads -->|"stored as files"| node_sd_payloads
node_badusb_engine -->|"reads payload"| node_sd_payloads
node_badusb_engine -->|"injects keystrokes"| node_hid
node_hid -->|"types into"| node_target_pc
node_user -->|"starts app"| node_easy_entry
node_easy_entry -.->|"displays choices"| node_easy_ui
node_easy_ui -.->|"starts scanning"| node_easy_worker
node_easy_worker -->|"samples RSSI"| node_easy_radio
node_easy_ui -.->|"starts capture"| node_easy_capture
node_easy_ui -.->|"requests replay"| node_easy_replay
node_easy_capture -.->|"saves signal"| node_easy_files
node_user -.->|"starts app"| node_pentest_entry
node_pentest_entry -.->|"routes to scan"| node_pentest_category
node_pentest_entry -.->|"routes to custom scan"| node_pentest_custom
node_pentest_category -->|"starts sweep"| node_pentest_worker
node_pentest_category -->|"enters capture"| node_pentest_capture_mode
node_pentest_capture_mode -.->|"captures signal"| node_pentest_capture
node_pentest_transmit -.->|"uses signal data"| node_pentest_capture
node_user -.->|"starts app"| node_gpio_entry
node_gpio_entry -->|"routes to scan"| node_gpio_scan
node_gpio_entry -->|"routes to sensor"| node_gpio_sensor
node_gpio_entry -->|"routes to about"| node_gpio_about

click node_badusb_ui "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/badusb/badusb_manager.c"
click node_badusb_engine "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/badusb/badusb_manager.c"
click node_easy_entry "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_main.c"
click node_easy_ui "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_ui.c"
click node_easy_worker "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_worker.c"
click node_easy_radio "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_radio.c"
click node_easy_capture "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_capture.c"
click node_easy_replay "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_replay.c"
click node_easy_files "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_file.c"
click node_pentest_entry "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/subghz_pentest.c"
click node_pentest_category "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/scenes/scene_category_scan.c"
click node_pentest_custom "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/scenes/scene_custom_scan.c"
click node_pentest_capture_mode "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/scenes/scene_capture_mode.c"
click node_pentest_transmit "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/scenes/scene_transmit.c"
click node_pentest_worker "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/subghz_pentest_worker.c"
click node_pentest_capture "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/subghz_pentest_capture.c"
click node_gpio_entry "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/gpio-sensor-bridge/gpio_sensor_bridge.c"
click node_gpio_scan "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/gpio-sensor-bridge/scenes/scene_i2c_scan.c"
click node_gpio_sensor "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/gpio-sensor-bridge/scenes/scene_sensor.c"
click node_gpio_about "https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/gpio-sensor-bridge/scenes/scene_about.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_badusb_ui,node_badusb_engine,node_sd_payloads,node_hid,node_user toneBlue
class node_easy_entry,node_easy_ui,node_easy_worker,node_easy_radio,node_easy_capture,node_easy_replay,node_easy_files toneAmber
class node_pentest_entry,node_pentest_category,node_pentest_custom,node_pentest_capture_mode,node_pentest_transmit,node_pentest_worker,node_pentest_capture toneMint
class node_gpio_entry,node_gpio_scan,node_gpio_sensor,node_gpio_about toneRose
class node_payloads,node_target_pc toneIndigo
```

## Components

### BadUSB Manager

- [Menu and scenes](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/badusb/badusb_manager.c): `apps/badusb/badusb_manager.c`
- [Script executor](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/badusb/badusb_manager.c): `apps/badusb/badusb_manager.c`
- **SD payload files**
- **USB HID keyboard**

### Sub-GHz Easy

- [App entry and state](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_main.c): `apps/subghz-easy/subghz_main.c`
- [Category and signal UI](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_ui.c): `apps/subghz-easy/subghz_ui.c`
- [RSSI worker](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_worker.c): `apps/subghz-easy/subghz_worker.c`
- [Radio operations](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_radio.c): `apps/subghz-easy/subghz_radio.c`
- [Signal capture](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_capture.c): `apps/subghz-easy/subghz_capture.c`
- [Signal replay](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_replay.c): `apps/subghz-easy/subghz_replay.c`
- [Signal files](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-easy/subghz_file.c): `apps/subghz-easy/subghz_file.c`

### Sub-GHz Pentest

- [App and scene router](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/subghz_pentest.c): `apps/subghz-pentest/subghz_pentest.c`
- [Category scan scene](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/scenes/scene_category_scan.c): `apps/subghz-pentest/scenes/scene_category_scan.c`
- [Custom scan scene](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/scenes/scene_custom_scan.c): `apps/subghz-pentest/scenes/scene_custom_scan.c`
- [Capture mode scene](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/scenes/scene_capture_mode.c): `apps/subghz-pentest/scenes/scene_capture_mode.c`
- [Transmit scene](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/scenes/scene_transmit.c): `apps/subghz-pentest/scenes/scene_transmit.c`
- [Sweep worker](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/subghz_pentest_worker.c): `apps/subghz-pentest/subghz_pentest_worker.c`
- [Capture and signal data](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/subghz-pentest/subghz_pentest_capture.c): `apps/subghz-pentest/subghz_pentest_capture.c`

### GPIO Sensor Bridge

- [App and scene router](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/gpio-sensor-bridge/gpio_sensor_bridge.c): `apps/gpio-sensor-bridge/gpio_sensor_bridge.c`
- [I2C scan scene](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/gpio-sensor-bridge/scenes/scene_i2c_scan.c): `apps/gpio-sensor-bridge/scenes/scene_i2c_scan.c`
- [BME280 detection](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/gpio-sensor-bridge/scenes/scene_sensor.c): `apps/gpio-sensor-bridge/scenes/scene_sensor.c`
- [About scene](https://github.com/ansfidine/flipper-zero-toolkit/blob/main/apps/gpio-sensor-bridge/scenes/scene_about.c): `apps/gpio-sensor-bridge/scenes/scene_about.c`

### Other components

- **Flipper user**
- **Payload scripts**
- **USB host PC**

## Connections

- Flipper user → Menu and scenes: selects payload (evidence: `apps/badusb/badusb_manager.c`)
- Payload scripts → SD payload files: stored as files (evidence: `README.md`)
- Script executor → SD payload files: reads payload (evidence: `apps/badusb/badusb_manager.c`)
- Script executor → USB HID keyboard: injects keystrokes (evidence: `apps/badusb/badusb_manager.c`)
- USB HID keyboard → USB host PC: types into (evidence: `README.md`)
- Flipper user → App entry and state: starts app (evidence: `README.md`)
- App entry and state → Category and signal UI: displays choices
- Category and signal UI → RSSI worker: starts scanning
- RSSI worker → Radio operations: samples RSSI (evidence: `apps/subghz-easy/subghz_worker.c`)
- Category and signal UI → Signal capture: starts capture
- Category and signal UI → Signal replay: requests replay
- Signal capture → Signal files: saves signal
- Flipper user → App and scene router: starts app
- App and scene router → Category scan scene: routes to scan
- App and scene router → Custom scan scene: routes to custom scan
- Category scan scene → Sweep worker: starts sweep (evidence: `apps/subghz-pentest/scenes/scene_category_scan.c`)
- Category scan scene → Capture mode scene: enters capture (evidence: `apps/subghz-pentest/scenes/scene_category_scan.c`)
- Capture mode scene → Capture and signal data: captures signal
- Transmit scene → Capture and signal data: uses signal data
- Flipper user → App and scene router: starts app
- App and scene router → I2C scan scene: routes to scan (evidence: `apps/gpio-sensor-bridge/gpio_sensor_bridge.c`)
- App and scene router → BME280 detection: routes to sensor (evidence: `apps/gpio-sensor-bridge/gpio_sensor_bridge.c`)
- App and scene router → About scene: routes to about (evidence: `apps/gpio-sensor-bridge/gpio_sensor_bridge.c`)
