# Building FriiDump

## Windows

The maintained direct build path is:

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

It calls `.vscode\msvc32.cmd`, which currently locates the Visual Studio 2019
Build Tools 32-bit environment, then invokes:

```text
cl @msvc32_friidump.rsp
```

The build script runs `friidump.exe --help` after compilation and packages a
local result ZIP. These generated files are ignored by Git.

## Linux / Unix

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

The Linux configure step prints an explicit warning: a normal build does not
install `CAP_SYS_RAWIO`. This is intentional. Build systems must not silently
invoke `sudo` or elevate their output.

After validating the exact executable, install only the capability required for
vendor-specific SCSI commands:

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

Do not run FriiDump itself with `sudo`. Rebuilding, relinking, copying, or
replacing the executable clears file capabilities; reapply and verify after
every build intended for GC/Wii memory-dump or Xbox vendor-unlock hardware use.
See [`LINUX.md`](LINUX.md) for the complete permission model.

The inherited `libfriidump/rs.c` shift-count warning remains open and should be
corrected only as a separately reviewed source change.

## External runtime requirements

Dumping requires operating-system access to the selected optical drive. Linux
vendor-command paths require both device-node access and effective
`CAP_SYS_RAWIO` on the exact validated executable. Grant only the minimum
required authority.
