disclady
disclady is a disc image inspection library and command-line tool. It reads optical disc images, physical optical drives, raw hard drive dumps, and CHD containers, identifies their media type, extracts track layouts, detects the target gaming platform, extracts game title and serial IDs, and matches metadata against an online database to suggest standardized filenames.
What It Inspects
The tool analyzes disc headers, sector structures, native platform signatures, and filesystem volume descriptors to classify files into five media categories:
- CD: Cue sheets (
.cuewith.binor.wavfiles), CloneCD descriptors (.ccdwith.imgand.sub), Alcohol 120% descriptors (.mdswith.mdf, supporting v1.x and v2.0), DAEMON Tools containers (.mdx), Nero Burning ROM containers (.nrg), standalone raw disc images (.bin,.img, 2352 or 2448 bytes per sector), and ISO images. - DVD: Single and dual-layer DVD images (
.iso), DVD-Video structures withVIDEO_TS, and DVD-Audio withAUDIO_TS. - GDI: Dreamcast Gigabyte Disc sets with low-density and high-density partition layouts (LBA 45000).
- Hard Disk: Raw sector dumps (
.img,.raw, 512 bytes per sector), MBR/GPT partition tables, and arcade drive images (Midway, Konami, Capcom, Namco, Sega). - LaserDisc: Uncompressed video captures (
.avi) with PCM audio and YUY2/UYVY video frames. - CHD Containers: Reverse inspection of CHD files (v3, v4, v5) without decompressing audio or data hunks, including raw subcode detection and extraction format viability analysis.
- Physical Optical Discs: Direct drive hardware inspection on Linux (
/dev/sr0,/dev/cdrom) and Windows (D:,\\.\D:) via SCSI/MMC commands (READ TOC,READ DVD STRUCTURE,GET CONFIGURATION).
Console and Computer Platforms
It recognizes gaming and computer platforms from native boot sectors, volume descriptors, and internal executables via a Tiered Fallback Pipeline:
- Sony PlayStation (
SYSTEM.CNF,PS-X EXE, licensing strings) - Sony PlayStation 2 (
SYSTEM.CNF) - Sony PlayStation Portable (
UMD_DATA.BIN,PSP_GAME/PARAM.SFO) - Sega Mega-CD / Sega CD (
SEGADISCSYSTEM,SEGADISCvolume headers) - Sega Saturn (
SEGA SEGASATURNsystem identifier) - Sega Dreamcast (
SEGA SEGAKATANAIP.BIN headers) - Nintendo GameCube & Wii (
boot.binheader structures) - Microsoft Xbox & Xbox 360 (
XDVDFSvolume descriptors) - 3DO Interactive Multiplayer (
3DOfilesystem volume headers) - SNK Neo Geo CD (
NEO-GEO CDsystem signatures) - NEC PC Engine CD / TurboGrafx-CD (
PC-Engine CD-ROM SYSTEMheaders) - NEC PC-FX (PC-FX native boot headers)
- Commodore Amiga CD32 (Rigid Disk Block, filesystem headers)
Platforms
disclady runs identically on Linux and Windows. Format decoders and inspection routines use standard binary readers with no external system dependencies or platform-specific calls. Physical drive inspection uses native kernel pass-through mechanisms (SG_IO on Linux, SPTI on Windows).
Installation
Pre-compiled Releases
Download release bundles from the project Releases page on Codeberg. Each archive packages both chdress (GUI) and disclady (CLI):
- Linux (x86_64, aarch64):
chdress-<version>-<target>.tar.xz - Windows (x86_64):
chdress-<version>-x86_64-pc-windows-gnu.zip
Extract the archive and move disclady (or disclady.exe on Windows) to a directory listed in your PATH.
Building from Source
Build the CLI using make:
# Build the disclady binary
# Build release package with stripped and compressed binaries
Or install with Cargo:
Cargo Features
physical(enabled by default): Enables physical optical drive hardware probing and enumeration.online(enabled by default): Enables remote database downloading and metadata matching viaureqandzstd.
CLI Usage
Run inspection on a disc image, directory, or physical drive:
Example output:
================================================================================
File: game.cue
File Size: 131 bytes
================================================================================
Classification:
Media Type: CD
Confidence: Definitive
Primary Sector Size: 2352 bytes
Total Sectors: 22
Total Calculated: 51,744 bytes (50.53 KiB)
Filesystem & Volume Info:
Title: RIDGE RACER TYPE 4
Platform: Sony PlayStation
Serial / Game ID: SLUS-00797
Primary Volume: ISO 9660 PVD
System Identifier: PLAYSTATION
Track Layout (2 tracks):
Trk Type Sector Size Start LBA Sectors Pregap File
--- ---- ----------- --------- ------- ------ ----
01 MODE1/2352 2352 B 0 11 - game.bin
02 AUDIO 2352 B 1 11 150 game.bin
Diagnostic Verdict:
CUE sheet contains Red Book audio tracks or WAV files (CD-DA)
================================================================================
Online Database Matching
Pass -o or --online to query the remote title database (https://chdress.8101987.xyz/lib.db.zst) and suggest a canonical filename:
Filesystem & Volume Info:
Suggested Filename: R4 - Ridge Racer Type 4 (USA).cue
Matched Game: R4 - Ridge Racer Type 4 (USA) [SLUS-00797]
Title: RIDGE RACER TYPE 4
Platform: Sony PlayStation
Serial / Game ID: SLUS-00797
If no match is found, an explicit [No match in database] marker is displayed.
Listing Optical Drives
List optical drive devices available on the host machine:
Detected Optical Drives:
- /dev/sr0 (ASUS DRW-24D5MT)
You can directly inspect a physical disc inside an optical drive:
JSON Output
Add --json for machine-readable output:
Batch Directory Scanning
Pass a directory path to scan all images recursively:
Library Usage
Add disclady to your dependencies:
[]
= { = "path/to/disclady" }
Inspect an image and read its metadata:
use ;
use Path;
If you only need the media classification without parsing full track tables:
use ;
use Path;
let disc_type = detect_disc_type?;
assert_eq!;
How Detection Works
Detection runs in layers to avoid unnecessary reading:
- Format-specific parsers: Files with
.cue,.gdi,.ccd,.mds,.mdx, or.nrgextensions go directly to dedicated descriptor and container parsers that validate syntax, resolve child track files, and extract sector layouts. - CHD metadata traversal: Files starting with
MComprHDare parsed through CHD v3, v4, or v5 header decoders to read hunk maps and FourCC tags (CHT2,CHGT,DVD,GDDD,AVAV), detect raw subcode presence (has_raw_subcode), and determine extraction format viability (viable_extraction_formats) without decompressing data. - Sector synchronization: Raw 2352-byte and 2448-byte CD tracks are identified by scanning for standard Red Book synchronization patterns (
00 FF FF FF FF FF FF FF FF FF FF 00) at sector intervals. - Volume recognition: Standard ISO images are scanned for ISO 9660 Primary Volume Descriptors at sector 16 (LBA 16), UDF Volume Recognition Sequences (
BEA01,NSR02,NSR03), and Anchor Volume Descriptor Pointers at LBA 256. - Physical boundary checks: Images over 900 MiB cannot physically be single-density Compact Discs and fall through to DVD or storage heuristics.
- Hard disk partition inspection: Raw drive images are validated by checking 512-byte sector alignment, partition tables (MBR/GPT), filesystem superblocks, and arcade copyright headers.
Testing
Run unit tests and doctests:
Or run all workspace quality checks:
Testing Against Real Collections
You can run detection against an external directory of disc images without modifying test files:
DISCLADY_REAL_TEST_DIR=/path/to/collection
The runner supports two modes:
- Manifest mode: Put a
manifest.tsvin the test folder with<file_or_folder>\t<expected_type>lines (such ascd,dvd,gdi,harddisk,laserdisc). - Convention mode: Name subdirectories with media tags (such as
01_cd/,ps2_dvd/,dreamcast_gdi/,arcade_hdd/). The test runner discovers image entry points automatically.
Documentation
API documentation is published on docs.rs. Generate and view local docs:
License
Licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).