Matthew Jackson d6d79fc74c Implement LibreDrive::read_vid OEM Volume ID retrieval
Recover the per-drive READ_BUFFER OEM VID path that lived in libfreemkv
before the unlocker refactor (read_vid_oem in disc/encrypt.rs), now living
inside the unlocker where the per-drive read_vid_cdb template belongs.

read_vid finds the drive's profile; if it carries a read_vid_cdb, issues
it and parses the 36-byte response (signature 00 22 00, VID at [4..20]),
returning Some(vid). No matching profile or no OEM VID CDB returns Ok(None)
so libfreemkv falls back to the cert handshake. VID is thus obtained
without the host certificate + HRL.

Adds response-parse unit tests (well-formed, short response, bad header,
no-profile fallback).
2026-06-22 10:50:54 -07:00

freemkv-unlock-ld

The LibreDrive unlocker plugin for libfreemkv.

libfreemkv ships only the Unlocker trait + registry and stays firmware-clean. This crate owns how MediaTek MT1959 drives are firmware-unlocked: the bundled drive-profile database (profiles.json), the firmware blobs, the WRITE_BUFFER / MODE SELECT upload, the unlock CDBs, and the variant-A / variant-B handshake logic.

Usage

Register the unlocker once at process start, before any rip:

libfreemkv::register_unlocker(Box::new(freemkv_unlock_ld::LibreDrive::new()));

That single line is the whole plug. Any drive whose identity matches a bundled profile is firmware-unlocked at drive-prep; everything else falls through to libfreemkv's host-certificate AACS handshake.

S
Description
firmware unlock crate — build dep for kdb (libfreemkv git-deps it)
Readme MIT
463 KiB
Languages
Rust 100%