Skip to content

Offline Captures

You can collect a donor once and generate firmware from that capture later, without the donor connected. This page covers the commands, the safeguards on offline builds, and their limits.

Offline builds are unverified

The donor is not read during an offline build, so nothing confirms the capture still describes hardware you have. Every offline build shows a warning and asks you to accept the risk. Use the firmware only with hardware you own, against systems you own or are explicitly authorized to test.

Workflow

Collect on the Linux host with the donor installed. Collection needs root; the later steps don't.

# 1. Collect into a new directory
pcileech-sudo capture collect --bdf 0000:03:00.0 --output ./captures/donor

# 2. Later, on the same machine, check the capture is complete and consistent
pcileech capture validate --input ./captures/donor

# 3. Optional: copy it into a fresh directory as a read-only snapshot
pcileech capture import --bdf 0000:03:00.0 --input ./captures/donor --output ./captures/imported

# 4. Generate firmware from it
pcileech build --from-capture ./captures/imported --board pcileech_75t484_x1 --templates-only
  • The capture records the donor's PCI address. If you pass --bdf to a build it must match, and capture import always requires it.
  • Offline builds generate locally by default. Add --container-mode container to use the container instead.
  • Drop --templates-only to also run Vivado on the host.
  • A normal build --host-collect-only also produces a capture you can use offline.

Rebuilding from a datastore

Running build again against an existing --datastore checks the donor at the captured address:

  • Donor present and matching: a normal, verified build.
  • No device at that address: an unverified offline build, with the same warning and prompt as --from-capture.
  • A different device at that address: the build stops with an error.

Accepting the risk

Every offline build:

  1. Prints WARNING: UNVERIFIED OFFLINE FIRMWARE BUILD.
  2. At a terminal, asks Continue with this unverified build? [y/N]. Only y or yes continues.
  3. In scripts, CI or other non-interactive runs, refuses to start unless you pass --accept-offline-risk. The flag records your acceptance; it doesn't hide the warning.
  4. Writes OFFLINE_BUILD_WARNING.txt into the output directory, with the capture ID, collection time, PCI address and config-space hash. It contains no vendor or device IDs.

Captures are tied to one machine

Collection stores a salted hash of the host's machine ID in the capture. Validating, importing or building offline refuses a capture collected on a different machine, or one with no host binding.

  • Reinstalling the OS or regenerating /etc/machine-id invalidates existing captures for offline use. Collect them again.
  • A host without a machine ID can collect for live builds, but those captures can't be used offline.
  • The lock discourages copying captures between machines. It is not tamper-proof.

Each capture directory also gets a CAPTURE_WARNING.txt. A capture holds your donor's real PCIe identity: don't share it.

When a capture is rejected

Captures from older releases, incomplete captures (for example after an interrupted collection), and captures without measured BAR sizes can't be upgraded. The build stops and asks you to collect again.

Collection never overwrites an existing capture, so collect into a new directory:

pcileech-sudo build --bdf 0000:03:00.0 --board pcileech_35t325_x1 \
    --datastore ./captures/donor-new --host-collect-only

Then use that same --datastore for the build. If you move a capture, copy device_context.json and msix_data.json together; they must come from the same collection.

Limits

  • Offline builds skip behavior profiling, register learning and anything else that reads the live device. --profile and --force-recapture are rejected with --from-capture.
  • The donor needs at least one memory BAR. BAR sizes come from the capture; very large BARs may be refused by the Vivado PCIe IP during synthesis.
  • Extended config space is cloned only when the capture holds the full 4 KB. See Config Space Shadow.
  • MSI-X tables are served where the donor put them. See MSI-X and Requester Support.
  • Validation checks that a capture is internally consistent. It can't prove the capture came from a genuine device or that the firmware will work with the donor's driver.