Skip to content

Repository files navigation

SDF Flash GUI icon

SDF Flash GUI

CI codecov

Cross-platform GUI for optical drive firmware dump/flash. Inspired by the Windows-only SDFtool Flasher.exe

SDF Flash GUI screenshot

Features

  • Drive enumeration — optical drives on macOS, Linux, and Windows (IOKit / sysfs / drive letters), with MakeMKV-style backend -l list when a tool is configured
  • Drive properties — vendor, model, revision, firmware date, MT1959 / MT1939 detection, encrypted firmware, LibreDrive status, SDF.bin version
  • Firmware dump — read drive firmware via the selected backend
  • Firmware flash — multi-gate safety before write/recover:
    • MT1959 platform check (probe)
    • Typed confirmation (FLASH <device>)
    • Mutually exclusive encrypted vs boot-loader rawflash modes
    • Cross form-factor warning + explicit confirm when slim/desktop mismatch
  • Firmware identification — SHA-256 lookup in a known-firmware table plus binary content scan (PCB type / embedded model); no reliance on filenames
  • Recovery flash — 16-byte boot token entry or extraction from a wrong firmware dump
  • SDF0 parsingsdf.bin / firmware containers (vendor, model, version, flags)
  • Dual backendssdftool and makemkvcon (both from MakeMKV); auto-detected on PATH and common install paths
  • CLIlist, info, dump, flash, sdf-info share the same planning path as the GUI

Install

macOS (Homebrew)

brew install --cask thedavidweng/tap/sdf-flash-gui

Linux / Windows

Download the latest installer from Releases.deb / .AppImage for Linux, .msi for Windows.

Requirements

  • MakeMKV installed (provides sdftool and makemkvcon)
  • sdf.bin from the SDFtool/MKV firmware pack (optional; improves probe/flash when present)

Platform permissions

Platform Notes
Linux Optical drive access often needs the cdrom group (or equivalent rights) to open /dev/sr* / /dev/sg*.
macOS Drive access is usually available to the logged-in user.
Windows Some raw device paths may require running as Administrator.

Build

cargo build --release

Output: target/release/sdf-flash-gui.

Local quality gate (matches Ubuntu CI):

cargo fmt -- --check
cargo clippy -- -D warnings
cargo test
./scripts/coverage.sh gate   # project ≥99%, patch 100% on changed domain lines

Architecture

src/
  main.rs              CLI entry (no args → GUI)
  lib.rs               library crate for tests
  branding.rs          Product name (from Cargo.toml) and project URLs
  command.rs           Backend argv planner (no shell strings) + command display
  orchestration.rs     Shared probe / list / flash session, BackendOpError (CLI + GUI)
  process.rs           Run / stream / cancel / reap + ProcessRunner trait
  process_runner.rs    NativeRunner (OS process adapter; coverage-ignored)
  firmware_db.rs       Known-hash table, binary firmware ID, encryption policy, version compare
  platform.rs          Slim/desktop model tables, form-factor helpers
  warnings.rs          Flash-safety warnings (cross-flash, two-step, downgrade, mismatch)
  test_support.rs      Shared ProcessRunner fake (cfg(test) only)
  drive/
    parse.rs           Pure list/identity/selection parsers (covered)
    probe.rs           --info interpretation: DriveSafety + identity (covered)
    os.rs              OS enumerate + find_backend / find_sdf_bin (ignored)
  sdf.rs               SDF0 container parser + presentation helpers
  i18n/                Language keys, English + locale tables
  gui/
    state.rs           AppState (drive list apply, probe cache)
    start_gate.rs      Structured Start enablement reasons
    ops/               Lifecycle, start, firmware load, drives, nudge, labels
    workers.rs         Background probe / list / streaming
    views/             egui paint only
    validation.rs      Tool / sdf.bin path checks
    file_dialog.rs     rfd adapter (coverage-ignored)

CLI and GUI share probe/list/flash planning through orchestration and command. GUI Start rules live in start_gate; i18n maps them at the edge.

Coverage ignore set is shared: scripts/coverage-ignore.regexcodecov.yml (checked in CI).

Security

See SECURITY.md for vulnerability reporting.

Acknowledgements

  • MakeMKV
  • MartyMcNuts for the original Windows SDFtool Flasher: forum thread

License

GPL-2.0-or-later

About

Cross-platform GUI for optical drive firmware dump/flash on MT1959 drives

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages