Skip to content

Repository files navigation

ritridata

Read-only disk partition inspection, public file signature definitions, and synthetic disk image utilities. Written in Rust. Licensed under AGPL-3.0-only.

Ritridata V1 answers three questions: what partition structure an image records, what standard header bytes a public file format defines, and how to inspect or generate a simple test image. It does not locate deleted files or recover data.

Quick start

Requires Rust 1.88 or newer. All runtime operations are offline.

cargo build --release --locked
cargo install --path . --locked

ritridata-image create example.img --size 32MB --partition-table gpt
ritridata-image info example.img
ritridata-image partitions example.img
ritridata-image validate example.img
ritridata-image sector example.img 0
ritridata-image hexdump example.img --offset 0 --length 512
ritridata-image checksum example.img --algorithm sha256
ritridata-image signatures png

Structured commands print JSON. sector and hexdump print hex with offsets. Exit codes: 0 success, 1 operation error, 2 invalid/absent partition metadata (for partitions and validate) or command-line usage error. A blank image can be readable while having no partition table; validate then exits 2.

Included capabilities

Module V1 scope
MBR Four recorded primary entries, type, start/end LBA, size, bounds and overlap checks
GPT Primary and backup header/entry CRCs, GUIDs, UTF-16 names, attributes, bounds and copy consistency
Signatures Ten public definitions across image, document, archive, audio and video; ID lookup only
Image tools File information, explicit sector/range reads, hex dump, SHA256/SHA1/MD5, structure validation
Generator New blank/MBR/GPT images, empty or multiple partitions, different sector sizes, synthetic CRC/truncation fixtures

Only regular .img, .raw, and .dd files are accepted. Physical devices, symlinks, device namespaces and network paths are unsupported. Image inputs are opened read-only; generation uses an exclusive new-file operation and cannot overwrite an existing file. Do not modify an input concurrently with inspection.

Choose the sector size explicitly (default 512; also 1024, 2048, 4096); there is no sector-size guessing. Each explicit range read is limited to 16 MiB. GPT entry arrays must be 16 KiB–16 MiB. Checksums stream the whole image in bounded memory. MD5 and SHA1 are included for compatibility, not security.

Synthetic examples

ritridata-image create blank.img --partition-table none
ritridata-image create empty-mbr.img --partition-table mbr --partitions 0
ritridata-image create empty-gpt.img --partitions 0
ritridata-image create multi.img --partitions 4
ritridata-image create sector4k.img --sector-size 4096
ritridata-image create bad-crc.img --fixture invalid-gpt-crc
ritridata-image create truncated.img --fixture truncated

Images contain zero-filled, unformatted payloads and synthetic metadata. Size is limited to 1 MiB–1 GiB, aligned to the selected sector size. MB means 1,000,000 bytes; MiB means 1,048,576 bytes. GPT supports up to 128 generated partitions; MBR supports four. GPT GUIDs are randomly generated to avoid identity collisions. An I/O failure during creation may leave a partial new file; no retry overwrites it.

Scope boundaries

There is no scanner, carving engine, filesystem parser, file boundary inference, deleted-file discovery, reconstruction, repair, export pipeline, payment code, account integration, telemetry, or proprietary signature dataset. An invalid primary GPT is reported; backup entries are never substituted for primary entries. An MBR extended partition is described as a primary record; EBR chains are not traversed. CRC validity does not establish that payload data is intact.

See scope, architecture, registry format, and contribution rules.

Development

cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings
cargo test --locked
python3 tests/verify_cli.py
python3 tests/verify_boundary.py
git add .
python3 scripts/check_public_boundary.py

The Python checks use only the standard library. The boundary check reviews the Git index, including newly staged files; run it after staging changes. Configure the optional local hook with git config core.hooksPath .githooks. CI repeats checks on Linux, macOS and Windows; the configured matrix is not a claim that all platforms have already been tested for every release.

License

Copyright (C) 2026 eureka101v. Source code, documentation and registry compilation are licensed under GNU AGPL version 3 only. Commercial use is allowed; redistribution and applicable modified network services carry source-sharing obligations under the license. See the GNU explanation. Referenced standards and dependencies retain their own licenses. The license covers only this repository's contents, not any separately maintained software. See NOTICE.

About

Read-only MBR/GPT inspection, public file signature definitions, and synthetic disk image tools. AGPL-3.0-only.

Topics

Resources

Contributing

Security policy

Stars

121 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages