A randomizer seed changes what a chest holds, what a monster drops, where a door leads and what a shop sells - on a retail disc that ships no source, no SDK and no extension points. Every one of those changes is one of seven injection techniques, and the techniques form a ladder: from same-size byte edits, through editing inside compression and rewriting bytecode, up to hand-assembled MIPS hosted in an overlay's dead space. This series walks the ladder one rung per page.
legaia-patcher (CLI) and the browser ROM patcher - same code, nothing uploadedpsx_lzs::compress · sector write-back psx_iso::write · PROT-entry bridge disc::DiscPatcherSeven techniques in ascending order of what they let you change - and of how much reverse engineering each demands before the first byte can move.
GIVE_ITEM splice, the new-game seed stamp, the string injection, the engine-facing config blob) are specialisations of a parent tier, tagged on their catalog rows rather than given their own rung.Later rungs assume the earlier ones' machinery. If you read only one, read tier B - it is where "we can only overwrite bytes in place" stops being a limitation.
| Tier | Page | What it is about | Why a player might care |
|---|---|---|---|
| A | Static-table overwrites | Fixed-width stat tables in the executable - steal items, spell costs, element affinities, prices, casino prizes. | The simplest way anything on the disc changes, and where every randomizer starts. |
| B | Editing inside LZS | Monster records live compressed inside fixed slots; an encoder the retail decoder accepts is what makes them editable. | Why "edit the monster" needed a compressor before it needed an editor. |
| C | Rewriting field-VM bytecode | Chests, shops, encounters and house doors are operands in each scene's script. | How a chest in Rim Elm can hold something it never held. |
| D | Variable-length relocation | A door carries its destination's name inline, so re-pointing it resizes the record. | The door randomizer and the high-capacity starting bag. |
| E | Code injection via the rodata gap | Hand-assembled MIPS detoured into reclaimed space in the executable. | New behaviour, not just new data - and the traps that bite the first time. |
| F | Overlay dead-region injection | A whole new screen hosted in a menu overlay's dead space: the Seru-trading vendor. | Where genuinely new features come from. |
| G | Carrying a RAM patch on disc | A community GameShark mod - the Super Arts Pack by ZetaPhoenix - parked in annex sectors and streamed into free RAM by an injected loader, installed byte-for-byte. | How someone else's cheat-device mod becomes a cold-boot disc patch, credit intact. |
The asset-preservation half of the project only reads the disc. Writing one back needs three pieces, and every mod stands on them.
| Capability | Module | Why |
|---|---|---|
| LZS encoder | psx_lzs::compress | Retail ships only a decoder. Greedy LZSS, slightly looser than Sony's packer, always accepted - Legaia LZS. |
| Sector write-back | psx_iso::write | A CD sector carries error-correction fields over its payload; overwrite the payload and they must be recomputed or the sector reads as damaged - disc geometry. |
| Disc bridge | disc::DiscPatcher | Maps a "PROT entry N, offset K" edit to the sector it lives in through the PROT.DAT table of contents. |
0x14000-byte slot) or is a fixed-width table field, so the patch is a byte overwrite plus a sector re-encode. No offset anywhere moves.Every current mod grouped by technique, plus the roadmap. The table is generated from site/_content/writeups/disc-patching/mods.toml at build time. Gap flags mods that share the executable's reclaimed rodata region - a finite resource, and the contention that tier F exists to escape. Edit is in-place (same-size) or relocate (footprint-bounded).
Planned rows concentrate at the top of the ladder, where system-level changes live.