# dedamrazr/openiotflasher architecture

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

- Interactive diagram: https://gitdiagram.com/dedamrazr/openiotflasher
- Repository: https://github.com/dedamrazr/openiotflasher

## Overview

OpenIOTFlasher is a Windows utility for backing up, flashing, and inspecting firmware on a broad range of IoT chips. Its main workflow is selecting a platform and firmware, communicating with a device through a platform-specific flasher, and saving a backup or writing firmware. Separate capabilities cover ROM reads, configuration extraction and editing, LAN device management, OTA, and encryption helpers. The graph uses documented capabilities and source-index references; unsampled subsystem internals and their call relationships are not assumed.

Main entry points: [`BK7231Flasher/FormMain.cs`](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/FormMain.cs) (Main interface), [`BK7231Flasher/Flashers/FlasherFactory.cs`](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/FlasherFactory.cs) (Flasher factory), [`BK7231Flasher/Flashers/BK7231Flasher.cs`](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/BK7231Flasher.cs) (Beken flasher), [`BK7231Flasher/CommandLineRunner.cs`](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/CommandLineRunner.cs) (Command-line runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_gui["Main interface<br/>[FormMain.cs]"]
  node_cli["Command-line runner"]
  node_downloader["Firmware downloader<br/>[FormDownloader.cs]"]
end

subgraph group_device["Device flashing"]
  node_factory["Flasher factory<br/>[FlasherFactory.cs]"]
  node_bkflasher["Beken flasher<br/>[BK7231Flasher.cs]"]
  node_blflasher["Bouffalo flasher<br/>[BL602Flasher.cs]"]
  node_espflasher["Espressif flasher<br/>[ESPFlasher.cs]"]
  node_svflasher["SV6x66 flasher<br/>[SV6x66Flasher.cs]"]
  node_platformflashers["Other platform flashers"]
  node_base["Flasher base<br/>[BaseFlasher.cs]"]
  node_backup["Flash backup and write<br/>[BK7231Flasher.cs]"]
end

subgraph group_config["Configuration tools"]
  node_obkconfig["OBK configuration<br/>[OBKConfig.cs]"]
  node_tuya["Tuya extraction<br/>[TuyaConfig.cs]"]
end

subgraph group_network["Network tools"]
  node_deviceapi["OBK device API<br/>[OBKDeviceAPI.cs]"]
  node_massbackup["LAN mass backup<br/>[OBKMassBackup.cs]"]
  node_ota["OBK OTA image<br/>[OBKOtaImage.cs]"]
end

subgraph group_support["Inspection and utilities"]
  node_rom["ROM read catalog<br/>[RomReadCatalog.cs]"]
  node_crypto["Beken crypto tools<br/>[Beken_Crypto.cs]"]
  node_analyzer["BL602 IO analyzer<br/>[BL602IoAnalyzer.cs]"]
end

node_user(("Operator"))
node_firmware(("Firmware releases"))
node_iotdevice(("IoT device"))

node_user -->|"operates"| node_gui
node_user -->|"invokes"| node_cli
node_gui -->|"selects flasher"| node_factory
node_gui -->|"opens"| node_downloader
node_cli -->|"runs operations"| node_bkflasher
node_factory -.->|"creates"| node_bkflasher
node_factory -.->|"creates"| node_blflasher
node_factory -.->|"creates"| node_espflasher
node_factory -.->|"creates"| node_svflasher
node_factory -.->|"creates"| node_platformflashers
node_bkflasher -->|"inherits"| node_base
node_bkflasher -->|"reads and writes"| node_backup
node_gui -.->|"starts flashing"| node_backup
node_downloader -.->|"downloads"| node_firmware
node_backup -->|"communicates"| node_iotdevice
node_gui -->|"edits configuration"| node_obkconfig
node_backup -.->|"extracts config"| node_tuya
node_gui -.->|"manages device"| node_deviceapi
node_gui -.->|"starts backups"| node_massbackup
node_deviceapi -->|"uses image"| node_ota
node_gui -->|"requests reads"| node_rom
node_bkflasher -->|"uses catalog"| node_rom
node_user -->|"uses helpers"| node_crypto
node_user -.->|"uses analyzer"| node_analyzer

click node_gui "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/FormMain.cs"
click node_cli "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/CommandLineRunner.cs"
click node_downloader "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/FormDownloader.cs"
click node_factory "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/FlasherFactory.cs"
click node_bkflasher "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/BK7231Flasher.cs"
click node_blflasher "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/BL602Flasher.cs"
click node_espflasher "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/ESPFlasher.cs"
click node_svflasher "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/SV6x66Flasher.cs"
click node_platformflashers "https://github.com/dedamrazr/openiotflasher/tree/main/BK7231Flasher/Flashers"
click node_base "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/BaseFlasher.cs"
click node_backup "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/BK7231Flasher.cs"
click node_obkconfig "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/OBKConfig.cs"
click node_tuya "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Utils/TuyaConfig.cs"
click node_deviceapi "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/OBKDeviceAPI.cs"
click node_massbackup "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/OBKMassBackup.cs"
click node_ota "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/OBKOtaImage.cs"
click node_rom "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/RomReadCatalog.cs"
click node_crypto "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Utils/Beken_Crypto.cs"
click node_analyzer "https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Utils/BL602IoAnalyzer.cs"

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_gui,node_cli,node_downloader toneBlue
class node_factory,node_bkflasher,node_blflasher,node_espflasher,node_svflasher,node_platformflashers,node_base,node_backup toneAmber
class node_obkconfig,node_tuya toneMint
class node_deviceapi,node_massbackup,node_ota toneRose
class node_rom,node_crypto,node_analyzer,node_user,node_firmware,node_iotdevice toneIndigo
```

## Components

### Application

- [Main interface](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/FormMain.cs): `BK7231Flasher/FormMain.cs`
- [Command-line runner](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/CommandLineRunner.cs): `BK7231Flasher/CommandLineRunner.cs`
- [Firmware downloader](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/FormDownloader.cs): `BK7231Flasher/FormDownloader.cs`

### Device flashing

- [Flasher factory](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/FlasherFactory.cs): `BK7231Flasher/Flashers/FlasherFactory.cs`
- [Beken flasher](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/BK7231Flasher.cs): `BK7231Flasher/Flashers/BK7231Flasher.cs`
- [Bouffalo flasher](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/BL602Flasher.cs): `BK7231Flasher/Flashers/BL602Flasher.cs`
- [Espressif flasher](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/ESPFlasher.cs): `BK7231Flasher/Flashers/ESPFlasher.cs`
- [SV6x66 flasher](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/SV6x66Flasher.cs): `BK7231Flasher/Flashers/SV6x66Flasher.cs`
- [Other platform flashers](https://github.com/dedamrazr/openiotflasher/tree/main/BK7231Flasher/Flashers): `BK7231Flasher/Flashers`
- [Flasher base](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/BaseFlasher.cs): `BK7231Flasher/Flashers/BaseFlasher.cs`
- [Flash backup and write](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Flashers/BK7231Flasher.cs): `BK7231Flasher/Flashers/BK7231Flasher.cs`

### Configuration tools

- [OBK configuration](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/OBKConfig.cs): `BK7231Flasher/Misc/OBKConfig.cs`
- [Tuya extraction](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Utils/TuyaConfig.cs): `BK7231Flasher/Utils/TuyaConfig.cs`

### Network tools

- [OBK device API](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/OBKDeviceAPI.cs): `BK7231Flasher/Misc/OBKDeviceAPI.cs`
- [LAN mass backup](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/OBKMassBackup.cs): `BK7231Flasher/Misc/OBKMassBackup.cs`
- [OBK OTA image](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/OBKOtaImage.cs): `BK7231Flasher/Misc/OBKOtaImage.cs`

### Inspection and utilities

- [ROM read catalog](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Misc/RomReadCatalog.cs): `BK7231Flasher/Misc/RomReadCatalog.cs`
- [Beken crypto tools](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Utils/Beken_Crypto.cs): `BK7231Flasher/Utils/Beken_Crypto.cs`
- [BL602 IO analyzer](https://github.com/dedamrazr/openiotflasher/blob/main/BK7231Flasher/Utils/BL602IoAnalyzer.cs): `BK7231Flasher/Utils/BL602IoAnalyzer.cs`

### Other components

- **Operator**
- **Firmware releases**
- **IoT device**

## Connections

- Operator → Main interface: operates (evidence: `README.md`)
- Operator → Command-line runner: invokes (evidence: `README.md`)
- Main interface → Flasher factory: selects flasher (evidence: `BK7231Flasher/FormMain.cs`)
- Main interface → Firmware downloader: opens (evidence: `BK7231Flasher/FormMain.cs`)
- Command-line runner → Beken flasher: runs operations (evidence: `BK7231Flasher/CommandLineRunner.cs`)
- Flasher factory → Beken flasher: creates
- Flasher factory → Bouffalo flasher: creates
- Flasher factory → Espressif flasher: creates
- Flasher factory → SV6x66 flasher: creates
- Flasher factory → Other platform flashers: creates
- Beken flasher → Flasher base: inherits (evidence: `BK7231Flasher/Flashers/BK7231Flasher.cs`)
- Beken flasher → Flash backup and write: reads and writes (evidence: `BK7231Flasher/Flashers/BK7231Flasher.cs`)
- Main interface → Flash backup and write: starts flashing (evidence: `BK7231Flasher/FormMain.cs`)
- Firmware downloader → Firmware releases: downloads (evidence: `README.md`)
- Flash backup and write → IoT device: communicates (evidence: `README.md`)
- Main interface → OBK configuration: edits configuration (evidence: `BK7231Flasher/FormMain.cs`)
- Flash backup and write → Tuya extraction: extracts config (evidence: `README.md`)
- Main interface → OBK device API: manages device (evidence: `README.md`)
- Main interface → LAN mass backup: starts backups (evidence: `README.md`)
- OBK device API → OBK OTA image: uses image (evidence: `BK7231Flasher/Misc/OBKDeviceAPI.cs`)
- Main interface → ROM read catalog: requests reads (evidence: `BK7231Flasher/FormMain.cs`)
- Beken flasher → ROM read catalog: uses catalog (evidence: `BK7231Flasher/Flashers/BK7231Flasher.cs`)
- Operator → Beken crypto tools: uses helpers (evidence: `README.md`)
- Operator → BL602 IO analyzer: uses analyzer (evidence: `README.md`)
