Living Tool
Browse the docs
Docs/Build & test

Building a patch

File patcher turns your project into a bootable disc image and a BPS patch. This page follows one build from the plan to the player.

v0.1.27 · updated 16 Oct 2026 · 7 min read

The placement plan

Open File patcher and choose Build from project. Before a single sector is written, Living Tool works out where each staged change will go. The plan is a dry run: it writes nothing, and it refreshes each time your project saves.

File patcher lists the staged changes and the placement plan: npc/7 relocates to LBA 185,985 and npc/2 is blocked.
File patcher lists the staged changes and the placement plan: npc/7 relocates to LBA 185,985 and npc/2 is blocked.

Every change gets one of three results. What decides it is how many sectors the new file needs, compared with the sectors its table entry gives it.

ResultWhenExample
In placeThe file still fits the sectors it has. A smaller file is zero-filled to the end of its extent.chunk/39 · LBA 24,886
RelocateIt needs more sectors than it has. It is appended past the end of the disc and its entry is repointed.npc/7 · 96 → 98
BlockedIt would break a loader cap or another hard rule. The build refuses it.npc/2 · 98 → 99

World chunks never move. Each is a fixed 125-sector slot at LBA 20,011 + id × 125, so a chunk change is either in place or blocked. New areas (chunk ids from 1328) have fixed slots past the end of the disc. Relocated files go after them in table order, from LBA 185,985 on retail, so the layout is the same on every build.

Blocked changes

Each loader has a size cap, and a file past its cap hangs the game when it loads. Living Tool checks every staged change against the cap of the loader that reads it. Caps count whole sectors, because the game always reads 2,048-byte sectors. A blocked row names the rule it breaks:

CodeBlocks when
BUDGET_NPC_CAPAn npc/* pack needs more than 98 sectors (0x31000).
BUDGET_STAGINGA file loaded through the staging buffer needs more than 64 sectors (0x20000).
BUDGET_CHUNKA chunk needs more than its fixed 125 sectors (0x3E800).
BUDGET_SLOTAn area overlay is larger than its 0x4000-byte slot in RAM.
EXE_SIZE_CHANGEDThe EXE is not exactly 317,440 bytes.
BUILD_MOVIE_SECTORSA staged movie isn't whole 2,336-byte Mode 2 sectors.

Build patched disc stays disabled while a blocked row is ticked. You have two ways out:

  • Trim the change until it fits. Expand the row for its cap meter and an Open in … link to its editor.
  • Untick the row. The file is built from the source disc, and build.json notes it as excluded.

What a build writes

Choose Build patched disc (⌘B). Living Tool copies your source image and writes only into the copy, and every build starts from your dump, never from an earlier build. The Output panel sets what comes out:

Nameenglish-v0.4 · default <project slug>-b<N>
Folderbuilds/0004/ · you can change it
Disc image (.bin + .cue)on
BPS patch + player READMEon when your disc is verified · disabled when it isn't
Boot test in Redux after buildingdisabled · needs PCSX-Redux, which isn't in Living Tool yet
Add 150-sector postgapon

While it runs, the job card shows each step, from Copy retail image to Make BPS. The image is written as a .bin.partial file, and gets its real name only after Verify confirms that:

  • Each written file reads back as planned, zero-padded to its extent.
  • Each written sector passes EDC and ECC, and its header address matches its LBA.
  • The file table equals the source's plus the plan's rewrites, and each alias group points at one extent.
  • The volume size in the primary volume descriptor matches the image.

Each action gets one line in log.txt, in the same style as inject_disc.py:

builds/0004/log.txt
wrote npc/7 199820 bytes over 98 sector(s) at LBA 185985 RELOCATED, 98 changed
file table: npc/7 (#70) -> LBA 185985 (98 sectors)
volume size: 185985 -> 186233 sectors (+0.6 MB)

Next to it, build.json records the inputs, the plan, the hashes and any rows you left out. A pre-build snapshot is taken first, so the image can be rebuilt later from your project, that snapshot and the retail disc. A failed or cancelled build leaves only build.json and log.txt.

The result card lists the image and patch, their CRC32 and SHA-1, what was written and verified, and that the boot test didn't run.
The result card lists the image and patch, their CRC32 and SHA-1, what was written and verified, and that the boot test didn't run.

Checksums and volume size

A raw sector is 2,352 bytes: a header, 2,048 bytes of data and two error checks over them. Change one data byte and the checks stop matching, so Living Tool re-encodes every sector it writes.

Sync and headerkept · made fresh for appended sectors (MSF of LBA + 150)
Submode0x08 · 0x89 on the last sector of a file
User data2,048 B · zero-padded past the end of the file
EDCCRC-32 · poly 0xD8018001 · over 0x010..0x817
ECC P and QRS(26,24) + RS(45,43) · header bytes zeroed (Mode 2)

The encoder is a port of inject_disc.py. A test re-encodes more than 2,000 retail sectors and must get identical bytes back.

Appending also makes the image longer than its ISO volume says it is, so the build rewrites the volume size in the primary volume descriptor at LBA 16. With the postgap on, it adds 150 empty sectors after the last appended file, as retail has after its own.

npc/7 build · sectors
retail disc    LBA       0 .. 185,984   185,985
npc/7          LBA 185,985 .. 186,082        98
postgap        LBA 186,083 .. 186,232       150
volume size    185,985 → 186,233

A 74-minute CD-R holds 333,000 sectors, which leaves about 147,000 sectors (about 287 MB) for appended files. A plan that would pass that is refused with BUILD_CAPACITY.

Building on a base

On a project built on a base, such as HackerGC, the image comes from the base: Living Tool builds from the copy it cached when it applied the base's patch to your retail disc. The BPS is still made against retail, so players apply one file to their own dump.

On a base, npc/7 lands after the base's own appended data, and the callout says the BPS is made against the verified retail dump.
On a base, npc/7 lands after the base's own appended data, and the callout says the BPS is made against the verified retail dump.
  • If retail's CRC32 has changed since the base was mounted, the build stops with BUILD_BPS_SOURCE_CHANGED.
  • New areas start at the project's newAreaFirst (1328 on retail). A lower id the base doesn't hold is BUILD_AREA_RESERVED; one whose slot lands inside the base's image is BUILD_AREA_TAKEN.
  • HackerGC bases have spare table entries, new/0 to new/N, and a file staged there is appended. Without one, a new file is blocked with NEW_FILE_NEEDS_EXE_GROWTH.

Applying a patch

Living Tool makes the BPS from the plan instead of diffing all 437 MB, then applies it once to check that it reproduces the build. The README next to it gives players four steps:

  1. Check the image. One .bin of 437,436,720 B with CRC32 cdc72c62.
  2. Apply the .bps. Rom Patcher JS, Floating IPS or Living Tool.
  3. Make a .cue. One track, MODE2/2352.
  4. Play. Open the .cue in DuckStation, PCSX-Redux or another emulator.

To apply one yourself, switch File patcher to Apply a patch and drop the file in. Its card shows the image it needs and the image it makes. Source image shows the disc the patch will be applied to. Apply patch asks where to save the result and writes a .cue next to it.

On a project built on a base, the disc you have open is the base's image, and your retail disc stays open beside it. Living Tool picks whichever one the patch names by size and CRC32. Your project's own BPS is made against retail, so it applies to your retail disc, and the card says "Retail disc, kept open beside the base". A patch made against the base's image applies to the base.

FormatStatusNotes
.bpsAppliedHolds the source size and CRC32, so the wrong dump is refused.
.ppfNot yetRefused with PATCH_FORMAT in v0.1.6.
.xdelta .vcdiffNot yetRefused with PATCH_FORMAT in v0.1.6.
.ipsRefusedIts offsets stop at 16 MB (PATCH_IPS).

If no open disc has the size and CRC32 the patch needs, Living Tool stops with PATCH_WRONG_SOURCE. The new image is written only once its own CRC32 matches, and never over the source.