Skip to content

feat(tools): add optional Zig BinDiff CLI for ELF32/PRX - #60

Merged
github-actions[bot] merged 3 commits into
masterfrom
feat/bindiff-zig
Nov 5, 2026
Merged

github-actions[bot] merged 3 commits into
masterfrom
feat/bindiff-zig

Conversation

@endercodezz

@endercodezz endercodezz commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Add p3p-bindiff, an optional Zig 0.17.1 host CLI for positional binary comparison and structural comparison of decrypted ELF32 little-endian MIPS/PSP PRX files. Reports byte counts/ranges and header/segment/section changes in text or deterministic JSON, with exit codes 0/1/2 and malformed-input checks. Entries match by table index; no decryption, relocation normalization or function matching is added.

The runtime, Builder and their CMake builds do not depend on Zig. tools/bindiff/check.py contains downloads/caches/build outputs in the workspace and verifies pinned official compiler archive SHA-256 values. Add separate Windows/Linux CI jobs using the same checks; only source and synthetic fixture generators are tracked.

Verified locally on Windows:

  • python tools/bindiff/check.py --download: official archive verification/extraction, format check, 4/4 Debug unit tests, 4/4 safe unit tests, safe build and 14/14 CLI regression tests. CLI tests compare actual repeated JSON bytes and 40 seeded file pairs against a Python oracle.
  • Safe x86_64-linux cross-build passed. Native Windows and Linux BinDiff CI both passed on 622dfd3: CI run, including official archive verification, Debug/safe unit tests, safe builds and all 14 CLI regressions. All six CI jobs passed, including existing host/3DS/texpack checks.
  • After merging origin/master (0b4845e) without rewriting history, separate no-game Release host build and full ctest --test-dir build/host -j6 --output-on-failure --no-tests=error: 19 passed, 6 fixture-dependent skips, no failures. All BinDiff checks passed again.
  • Local P3P ELF self-comparison: exit 0, no byte/structural changes (5,849,468 bytes, 3 segments, 54 sections). No game fixtures committed.
  • git diff --check and repository precommit gate passed.
  • Windows CI exposed CRLF checkout conversion at the formatter gate. Pin LF for tools/bindiff/** and verify a clean core.autocrlf=true index checkout with the unchanged Zig formatter, then rerun all BinDiff checks successfully.

Closes #59

Compare positional byte ranges and ELF32 MIPS/PSP metadata through a
standalone Zig 0.17.1 host tool with deterministic JSON and explicit errors.
Add synthetic regressions and SHA-256-pinned Windows/Linux CI checks.

Verified: 4 unit tests in Debug and safe, 14 CLI tests, safe Windows and
Linux cross-builds, host Release build and CTest (18 pass, 6 fixture skips).
Closes #59.
@endercodezz
endercodezz marked this pull request as ready for review November 5, 2026 18:38
@github-actions
github-actions Bot merged commit 519acf4 into master Nov 5, 2026
7 checks passed
@endercodezz
endercodezz deleted the feat/bindiff-zig branch November 5, 2026 18:42
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.

feat(tools): add optional Zig BinDiff CLI for ELF32/PRX

1 participant