How thesourcerer8/hddsuperclone works
Project type and purpose
• hddsuperclone is a native C-based desktop toolset for low-level HDD/SSD cloning, repair and analysis. It comprises three primary user-space applications (HDDSuperClone, HDDSuperTool, HDDSCViewer), a custom kernel driver (AHCI/virtual disk), shell scripts (for ATA commands and packaging), UI definitions (Glade), multi-language support, and a Live-CD builder that bundles in third-party recovery tools.
High-level architectural layers
• Presentation layer: GTK-3 UI definitions (Glade .glade files), command-line interface.
• Application logic: core libraries and modules (common.c/h, commands.c/h, io.c/h, usbrelay.c/h, clone_gui_*.c/h).
• Hardware interface: libusb-based direct mode + custom kernel driver (driver/hddsuperclone_driver.c).
• Scripting & packaging: hddscripts/ and myscripts/ (ATA command wrappers), Makefiles and shell scripts to build, install, package, produce Live CD.
• External components: xxd (resource embedding), libusb-dev, libgtk-3-dev, libbsd, linux headers, libcurl (optional), help2man, texinfo, third-party binaries (ddrescue, ddrescueview, ddrutility, DMDE, hdparm, isolinux).
Main components and relationships
a. Code modules
• Core library modules (common, commands, IO, USB relay)
• UI layer (clone_gui_language, clone_gui_common, clone_gui2/3) compiled with libgtk-3
• Kernel driver compiled against linux-headers
• Language file resources embedded via xxd
b. Build system
• Top-level Makefile (and sub-Makefiles under driver/, public/, live_cd/)
• Invokes xxd to embed .glade and driver firmware into C arrays
• Links against libusb, libgtk-3, libbsd, libcurl, generates binaries (hddsuperclone, hddsupertool, hddscviewer) and kernel module
c. Runtime on host OS
• Kernel loads hddsuperclone_driver.ko
• User invokes CLI or clicks GTK UI
• UI → application logic → hardware interface (via libusb or ioctl to driver) → raw block device
d. Scripting and packaging
• hddscripts/ and myscripts/ orchestrate device discovery, ATA commands, cloning workflows by calling the binaries or issuing direct hdparm calls
• Packaging scripts (makeclone.sh, makepublicclone.sh, makelivecd.sh, etc.) assemble distribution archives, Debian/RedHat packages, Live CD ISO
• public/ directory contains prebuilt “public” release artifacts and EULA, news, changelogs, installers
e. Live CD distribution
• Live-CD build includes isolinux bootloader, generic launch scripts, our tools + upstream ddrescue, ddrescueview, ddrutility, DMDE, hdparm
Important architectural patterns and design principles
• Layered architecture with clear separation: UI, application core, hardware interface
• Resource embedding (xxd) to package glade/XML and firmware into single binary
• Modular shell scripting for ATA subcommands (reusable good_subroutines)
• Multi-language strategy: directory per language, loaded at runtime
• Packaging pipeline that reuses code modules, scripts, and third-party executables
Essential elements
• Source code directories (core/, driver/, ui/, languages/)
• Build system (Makefile, xxd)
• External dependencies (libusb, libgtk-3, linux-headers, xxd)
• Binaries (hddsuperclone, hddsupertool, hddscviewer) and driver module
• Shell scripts (hddscripts/, myscripts/, packaging scripts)
• Runtime flow: UI/CLI → core logic → hardware interface → disk
• Live-CD assembly: isolinux, our tools + ddrescue, ddrescueview, ddrutility, DMDE, hdparm