# wustl-cspl/firmware-dataset architecture

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

- Interactive diagram: https://gitdiagram.com/wustl-cspl/firmware-dataset
- Repository: https://github.com/wustl-cspl/firmware-dataset

## Overview

Firmware-Dataset provides firmware download links and scripts for downloading and unpacking firmware. The principal workflow is `main.py`: it passes URLs and a save directory to the downloader, then passes that directory to the unpacker, which invokes external `binwalk`. The CSV catalogs are documented sources of download links, but the shown code does not read them. The unpacker’s output location is supplied at runtime. Relationships reflect the excerpts and README; no unsampled implementation is assumed.

Main entry points: [`src/main.py`](https://github.com/wustl-cspl/firmware-dataset/blob/main/src/main.py) (Workflow entry), [`src/fw_downloader.py`](https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_downloader.py) (Firmware downloader), [`src/fw_unpacker.py`](https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_unpacker.py) (Firmware unpacker), [`dat/firmware_download_list.csv`](https://github.com/wustl-cspl/firmware-dataset/blob/main/dat/firmware_download_list.csv) (Download links)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Firmware catalogs"]
  node_download_csv["Download links"]
  node_ftp_csv["FTP links"]
end

subgraph group_processing["Download and unpack"]
  node_main["Workflow entry<br/>[main.py]"]
  node_downloader["Firmware downloader<br/>[fw_downloader.py]"]
  node_saved_images["Downloaded images<br/>[fw_downloader.py]"]
  node_unpacker["Firmware unpacker<br/>[fw_unpacker.py]"]
  node_unpacked_images["Unpacked contents<br/>[fw_unpacker.py]"]
end

node_researcher(("Researcher"))
node_firmware_hosts(("Firmware hosts"))
node_binwalk(("binwalk"))

node_researcher -->|"finds links"| node_download_csv
node_researcher -->|"finds links"| node_ftp_csv
node_researcher -->|"runs workflow"| node_main
node_main -->|"calls download"| node_downloader
node_downloader -->|"requests images"| node_firmware_hosts
node_downloader -->|"writes files"| node_saved_images
node_main -->|"calls unpack"| node_unpacker
node_unpacker -->|"scans directory"| node_saved_images
node_unpacker -->|"runs extraction"| node_binwalk
node_binwalk -->|"writes contents"| node_unpacked_images

click node_download_csv "https://github.com/wustl-cspl/firmware-dataset/blob/main/dat/firmware_download_list.csv"
click node_ftp_csv "https://github.com/wustl-cspl/firmware-dataset/blob/main/dat/firmware_ftp_list.csv"
click node_main "https://github.com/wustl-cspl/firmware-dataset/blob/main/src/main.py"
click node_downloader "https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_downloader.py"
click node_saved_images "https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_downloader.py"
click node_unpacker "https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_unpacker.py"
click node_unpacked_images "https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_unpacker.py"

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_download_csv,node_ftp_csv toneBlue
class node_main,node_downloader,node_saved_images,node_unpacker,node_unpacked_images toneAmber
class node_researcher,node_firmware_hosts,node_binwalk toneIndigo
```

## Components

### Firmware catalogs

- [Download links](https://github.com/wustl-cspl/firmware-dataset/blob/main/dat/firmware_download_list.csv): `dat/firmware_download_list.csv`
- [FTP links](https://github.com/wustl-cspl/firmware-dataset/blob/main/dat/firmware_ftp_list.csv): `dat/firmware_ftp_list.csv`

### Download and unpack

- [Workflow entry](https://github.com/wustl-cspl/firmware-dataset/blob/main/src/main.py): `src/main.py`
- [Firmware downloader](https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_downloader.py): `src/fw_downloader.py`
- [Downloaded images](https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_downloader.py): `src/fw_downloader.py`
- [Firmware unpacker](https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_unpacker.py): `src/fw_unpacker.py`
- [Unpacked contents](https://github.com/wustl-cspl/firmware-dataset/blob/main/src/fw_unpacker.py): `src/fw_unpacker.py`

### Other components

- **Researcher**
- **Firmware hosts**
- **binwalk**

## Connections

- Researcher → Download links: finds links (evidence: `README.md`)
- Researcher → FTP links: finds links (evidence: `README.md`)
- Researcher → Workflow entry: runs workflow (evidence: `README.md`)
- Workflow entry → Firmware downloader: calls download (evidence: `src/main.py`)
- Firmware downloader → Firmware hosts: requests images (evidence: `src/fw_downloader.py`)
- Firmware downloader → Downloaded images: writes files (evidence: `src/fw_downloader.py`)
- Workflow entry → Firmware unpacker: calls unpack (evidence: `src/main.py`)
- Firmware unpacker → Downloaded images: scans directory (evidence: `src/fw_unpacker.py`)
- Firmware unpacker → binwalk: runs extraction (evidence: `src/fw_unpacker.py`)
- binwalk → Unpacked contents: writes contents (evidence: `README.md`)
