Skip to content

feat(tools): show what a mod.cpk changes with p3p-cpk diff - #77

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

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

Conversation

@endercodezz

Copy link
Copy Markdown
Owner

What changed

p3p-cpk diff shows what a mod.cpk does to the game's archives, the first step of #23:

p3p-cpk diff <mod.cpk> <base.cpk>
p3p-cpk diff <mod.cpk> <image.iso> <cpk path on image>...
  • Each file of the mod is added, changed or same, by extracted content, so a stored copy of a compressed file counts as the same.
  • Several base archives are allowed, because a mod overlays both umd0.cpk and umd1.cpk. The first that has a file wins.
  • Names match without regard to case, and a match that differs in case is marked case-differs.
  • Exit 0 when nothing is added or changed, 1 otherwise, 2 on errors.

Verification

On the local ULUS-10512 ISO:

Input Result
all of umd0.cpk as the mod, against both archives same=5860, exit 0, 6 s, every file extracted from both sides
mod from real game files: compressed file stored plain same
same mod: one byte flipped, same size changed
same mod: file from umd1.cpk same against both, added against umd0.cpk alone
same mod: lower-case name same ... case-differs
same mod: new file added, exit 1
CriFsV2Lib sample CPK, written by another tool 3 added, exit 1

python tools/cpk/check.py: format check, Debug and safe unit tests, 24/24 CLI tests, including 150 damaged mods through diff (exit 0, 1 or 2, never a panic).

Not verified

Closes #76
Refs #23

Each file of a mod is added, changed or same against one or more base
archives, by extracted content, so a stored copy of a compressed file
counts as the same. Names match without regard to case and a match that
differs in case is marked: how the game's CRI library matches names is
not known yet.

Verified on ULUS-10512: all of umd0.cpk against the image is 5,860 same;
a mod of real game files with one edited is reported as expected.
tools/cpk/check.py: 24/24 CLI tests, 150 damaged mods included.
@github-actions
github-actions Bot enabled auto-merge November 6, 2026 14:53
@github-actions
github-actions Bot merged commit 4e3b079 into master Nov 6, 2026
9 checks passed
@endercodezz
endercodezz deleted the feat/cpk-diff-76 branch November 6, 2026 15:04
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: p3p-cpk diff, what a mod.cpk changes in the game's archives

1 participant