# FriiDump — Project Frankenstein Branch

## Candidate21 Linux Xbox DMI boundary correction

Candidate20 proved the complete Linux GDR-8050L Xbox command and data path:
direct SG_IO challenge delivery, both game-view transitions, XDVDFS metadata,
drive-captured game lead-in, partial GAME-XDVDFS output, controlled
cancellation, hashes, native reporting, and STOP UNIT.

Candidate21 preserves that exact Windows-sequence control flow and SG_IO
handshake. It corrects one remaining MMC boundary: standard READ DVD STRUCTURE
uses CDB byte 7 for the Format field. Candidate20 incorrectly wrote the format
to byte 11 (Control), so DMI format `0x04` was not captured and the media ID
remained empty.

Candidate21 also adds persistent PFI/DMI capture diagnostics and a source
contract that compares the portable request against the proven copied Windows
`GetMediaID()` request.

The generic Xbox path still contains no RecoveryKick, generic media-auth kick,
or synthetic LBA-zero recovery sequence.

Linux vendor-command work continues to require a normal-user process with
`cap_sys_rawio=ep` on the exact validated executable. Rebuilding or replacing
the executable clears that capability.

See [`docs/LINUX.md`](docs/LINUX.md) before Linux hardware use.

## Candidate11 Linux Xbox parity baseline

Candidate11 begins the Linux parity campaign without replacing the validated
Windows/MSVC GDR-8050L path. The Windows copied-reference implementation remains
unchanged for challenge drives. Linux now uses the existing portable MMC/Xbox
dump path with a shared XDFS/XBE metadata reader, XBE-derived default filenames,
exact native-report result handoff, partial/full hashes, and consistent Xbox
title, media ID, and region reporting.

Candidate11 subsequently completed real Linux GameCube validation on a
GCC-4244 B101, including an exact full-dump hash match. Candidate12 retains that
transport and dump behavior while correcting resource discovery and evidence
wording. The development-only XGD1 layout and raw-ID probes remain separate from
ordinary Linux ISO/XISO user paths.

FriiDump is a command-line optical-disc dumping tool for Nintendo GameCube,
Nintendo Wii, standard DVD-ROM, and selected Original Xbox/XGD workflows. This
repository preserves the Project Frankenstein development branch based on
FriiDump **0.5.3.5**.

The branch extends the original FriiDump code with:

- analyzer-derived HLDS `0xE7` drive profiles for GameCube/Wii dumping;
- native GDR-8050L and GDR-3120L Xbox/XGD paths;
- redump-style Original Xbox/XGD1 reconstruction and metadata;
- optional game-partition XISO output;
- media preflight, profile reporting, and STOP UNIT cleanup;
- optional atomic `friidump-test-result.v1` compatibility evidence reports;
- validated Windows/MSVC and Linux/CMake build paths.

The original detailed user documentation remains in [`README`](README).
Xbox-specific behavior is documented in [`docs/XBOX.md`](docs/XBOX.md).

## Repository status

This is the active canonical Project Frankenstein FriiDump repository. Authority
was accepted at annotated tag `v0.5.3.5-pf1`. The imported baseline is
intentionally conservative: source and
maintained documentation were preserved, while disc images, live logs, compiled
binaries, build directories, result archives, and unrelated reverse-engineering
work were excluded.

The baseline source came from:

```text
D:\vscode-workspace\friidump
```

No firmware binaries or disc images belong in this Git repository.

Authority surfaces:

```text
repository: /srv/project-frankenstein/repos/friidump.git
authority marker: /srv/project-frankenstein/catalog/authority/friidump.json
canonical tag: v0.5.3.5-pf1
```

## Build

### Windows — validated MSVC 32-bit path

The maintained Windows helper invokes the Visual Studio 2019 Build Tools
32-bit environment and compiles from `msvc32_friidump.rsp`:

```powershell
.\build_msvc32.cmd
```

Clean generated output with:

```powershell
.\build_msvc32.cmd clean
```

The VS Code build tasks are in `.vscode/tasks.json`. The helper currently
expects:

```text
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\
```

### Linux / Unix — CMake

```bash
cmake -S . -B build -DBUILD_STATIC_BINARY=ON
cmake --build build
./build/src/friidump --help
```

The build prints a warning that Linux vendor-command hardware paths require a
separate, explicit `CAP_SYS_RAWIO` installation step. After validating the
binary:

```bash
bash ./validation/friidump-linux-rawio-capability.sh install   ./build/src/friidump
```

Run FriiDump as the normal user, not with `sudo`. One inherited warning remains
in `libfriidump/rs.c` concerning a right-shift count; it is recorded as technical
debt and was not silently changed during repository import.

## Common commands

List command-line options:

```text
friidump --help
```

GameCube/Wii dump using automatic drive/profile detection:

```text
friidump -d <drive> -8 -s -i game.iso
```

Standard readable DVD:

```text
friidump -d <drive> -D -i dvd.iso
```

Original Xbox/XGD redump-style image:

```text
friidump -d <drive> -T 4 -i xbox.iso
```

Original Xbox/XGD game-partition XISO:

```text
friidump -d <drive> -T 4 -X xbox.xiso
```

Native compatibility reports are created automatically in the working
directory using the log filename. To override the destination directory:

```text
friidump -d <drive> -8 -s -i game.iso --report-dir reports
```

Consult [`README`](README), [`docs/options`](docs/options),
[`docs/XBOX.md`](docs/XBOX.md), and
[`docs/NATIVE_REPORTS.md`](docs/NATIVE_REPORTS.md) before hardware use.

## Safety and evidence rules

FriiDump issues low-level SCSI/MMC and model-specific vendor commands.

- Use only drives and media you own or are authorized to examine.
- Do not assume two firmware revisions share the same private-command layout.
- Prefer exact analyzer-derived profiles over guessed addresses or legacy
  fallbacks.
- Treat live hardware behavior as the final validation boundary.
- Keep firmware, media images, memory dumps, and generated logs outside Git.
- Preserve provenance for every firmware/profile conclusion.

## Source layout

```text
src/                 command-line program
libfriidump/         disc, drive, dumping, Xbox, and vendor-command logic
libmultihash/        checksum implementations
docs/                user, Xbox, validation, and historical documentation
.vscode/             maintained Windows build helper and tasks
build_msvc32.cmd     Windows build entry point
CMakeLists.txt       portable build entry point
```

## Project boundaries

- **PFES** — engineering specification, decisions, evidence status, and history.
- **xbox-dvd-tools** — firmware acquisition, extraction, analysis, disc tools,
  and shared validation utilities.
- **mn103s-emulator** — MN103S CPU/emulator and GDR-8050L emulation work.
- **friidump** — this dumping application and its maintained drive profiles.
- **Firmware archive** — managed server artifacts outside Git.

## License

FriiDump is distributed under the GNU General Public License, version 2 or
later. See [`COPYING`](COPYING). Existing source-file copyright notices and
authors are preserved.

## Candidate21 Xbox Linux scope

Candidate21 preserves Candidate20's successful SG_IO Xbox handshake and
Windows state-machine order. The only functional correction is the standard
READ DVD STRUCTURE Format byte used for PFI/DMI capture. The mode-select-6
sticky-descrambling command remains evidence-bearing and non-authoritative:
final READ CAPACITY plus XDVDFS readability determine whether game view was
established.
