Skip to content

feat(tools): apply xdelta patches with p3p-cpk patch - #84

Merged
github-actions[bot] merged 1 commit into
masterfrom
feat/cpk-vcdiff
Nov 6, 2026
Merged

github-actions[bot] merged 1 commit into
masterfrom
feat/cpk-vcdiff

Conversation

@endercodezz

Copy link
Copy Markdown
Owner

What changed

p3p-cpk patch <source> <patch.xdelta> <output> applies VCDIFF (RFC 3284) patches as xdelta3 writes them, with their Adler-32 checked. Patches with secondary compression are refused. p3p-bindiff --elf then shows what changed.

Verification

The Russian translation's rus_eboot_patch_v0.8.2.xdelta on the local decrypted EBOOT: the checksum matches, so this is its source. 47,707 of 5,849,468 bytes change, size unchanged: 29,798 in .rodata, 17,907 in .data, 2 in .text.

python tools/cpk/check.py: 31/31 CLI tests (ADD, COPY, RUN, overlapping copy, bad checksum, secondary compression, truncated input, 150 damaged patches: exit 0 or 2, never a panic) and a unit test of the code table.

Not verified

  • [UNVERIFIED] What the two changed instructions do. They need the generated code to change, or a profile patch.
  • [UNVERIFIED] The patched EBOOT was not run, and xdelta3 itself is not available here to compare with. The matching checksum covers the output of the real patch.

Closes #83
Refs #23

Mods ship EBOOT patches as VCDIFF, and P3P3DS generates its AOT code from
the EBOOT, so it matters what they change. patch applies them with their
checksums checked; p3p-bindiff --elf shows the result.

Verified: the Russian translation's patch applies to the local EBOOT with
a matching Adler-32 and changes 47,707 bytes, 2 of them in .text.
tools/cpk/check.py: 31/31 CLI tests, 150 damaged patches included.
@github-actions
github-actions Bot enabled auto-merge November 6, 2026 15:15
@github-actions
github-actions Bot merged commit 04a8ed1 into master Nov 6, 2026
9 checks passed
@endercodezz
endercodezz deleted the feat/cpk-vcdiff branch November 6, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools: apply xdelta patches with p3p-cpk patch

1 participant