tools: audit direct call destinations against original DOL #1019

Merged
coah80 merged 1 commits from agent/bittle/call-identity-audit into main 2026-10-03 02:05:09 +00:00
coah80 commented 2026-10-03 02:04:34 +00:00 (Migrated from github.com)

Advisory verification tool

Add call_target_diff.py, usage/limits documentation and synthetic tests. Checks equal-extent objdiff100 functions for direct-call destination mismatches against the original 43U DOL, including relocation-backed and raw BL instructions. Same-address aliases and possible identical-body aliases remain visible for review.

No source/header/configuration, CI policy, completion gate or linking changes. No original executable bytes or assembly embedded in the committed files or emitted report.

Parent verification

  • 22 authored ELF/PPC/DOL fixture tests pass, plus 27 existing shared-helper tests
  • Full fresh 43U all_source/report/progress/DOL passes; entire report unchanged
  • Parent scan on 6619098e: 1004 units, 12387 equal-extent exact-scored functions, 51440 calls; 51418 same destinations, 22 review rows, four explicit symbol lookup skips, zero input errors
  • All calls in this snapshot have explicit relocations; raw-call support is separately tested, not claimed as the cause of prior incorrect callee matches
  • Rows include the separately proposed onCursor correction (#1018), manually reviewable wrapper/constructor aliases and unresolved legacy SDMemory API names. Rows are not automatically bugs
  • Exact input hashes, DOL SHA1, starting/ending Git heads and mid-scan mutation detection are recorded; fingerprints do not prove build freshness
  • Exit 1 for review rows/skips is expected; exit 2 denotes invalid/changing inputs
  • Worktree and base-relative diff checks pass

Limits: no indirect calls, tail calls, nonexact callers, unequal extents, callee-behavior proof or whole-program completion claim. Empty selections may inspect zero calls; counts remain explicit.

Base: 6619098ea7
Tested tree: b8b62630b7
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d

No merge performed or requested by this author.

Note

Add direct-call audit tool call_target_diff for the 43U DOL

  • Adds a new decomp-assist tool that compares direct call destinations in source and reference ELF objects against the original DOL image, per call_target_diff.py
  • Decodes PPC bl instructions, resolves relocations and raw relative/absolute calls, and validates the DOL by SHA1 and section layout
  • Emits JSON review rows for wrong destinations, unresolved symbols, same-address aliases, and one-sided calls; exit codes are 0 (clean), 1 (review rows), and 2 (input error)
  • Detects input file mutation during the audit via SHA-256 fingerprints, records git HEAD provenance, and refuses to overwrite report inputs
  • Includes a synthetic-only unittest suite in test_call_target_diff.py covering decoding, relocations, aliases, DOL validation, and CLI behavior, plus usage docs in call_target_diff.md

Macroscope summarized f6f77bd.

## Advisory verification tool Add call_target_diff.py, usage/limits documentation and synthetic tests. Checks equal-extent objdiff100 functions for direct-call destination mismatches against the original 43U DOL, including relocation-backed and raw BL instructions. Same-address aliases and possible identical-body aliases remain visible for review. No source/header/configuration, CI policy, completion gate or linking changes. No original executable bytes or assembly embedded in the committed files or emitted report. ## Parent verification - 22 authored ELF/PPC/DOL fixture tests pass, plus 27 existing shared-helper tests - Full fresh 43U all_source/report/progress/DOL passes; entire report unchanged - Parent scan on 6619098e: 1004 units, 12387 equal-extent exact-scored functions, 51440 calls; 51418 same destinations, 22 review rows, four explicit symbol lookup skips, zero input errors - All calls in this snapshot have explicit relocations; raw-call support is separately tested, not claimed as the cause of prior incorrect callee matches - Rows include the separately proposed onCursor correction (#1018), manually reviewable wrapper/constructor aliases and unresolved legacy SDMemory API names. Rows are not automatically bugs - Exact input hashes, DOL SHA1, starting/ending Git heads and mid-scan mutation detection are recorded; fingerprints do not prove build freshness - Exit 1 for review rows/skips is expected; exit 2 denotes invalid/changing inputs - Worktree and base-relative diff checks pass Limits: no indirect calls, tail calls, nonexact callers, unequal extents, callee-behavior proof or whole-program completion claim. Empty selections may inspect zero calls; counts remain explicit. Base: 6619098ea7146df9d7f7f84b7386ee314d679960 Tested tree: b8b62630b7f34226aa4f95019b86bf848fe7fdfc DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d No merge performed or requested by this author. <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Add direct-call audit tool `call_target_diff` for the 43U DOL > - Adds a new decomp-assist tool that compares direct call destinations in source and reference ELF objects against the original DOL image, per [call_target_diff.py](https://github.com/coah80/wii-ipl/pull/1019/files#diff-48271615d250cfd0a222f535808cc3b09aa9d0bf76189627e5e43e0cb8c46b06) > - Decodes PPC `bl` instructions, resolves relocations and raw relative/absolute calls, and validates the DOL by SHA1 and section layout > - Emits JSON review rows for wrong destinations, unresolved symbols, same-address aliases, and one-sided calls; exit codes are 0 (clean), 1 (review rows), and 2 (input error) > - Detects input file mutation during the audit via SHA-256 fingerprints, records git HEAD provenance, and refuses to overwrite report inputs > - Includes a synthetic-only unittest suite in [test_call_target_diff.py](https://github.com/coah80/wii-ipl/pull/1019/files#diff-681e3059e7029a0713f5a2b320c29bdac9ebe6908e6175084ad425a7a203e66c) covering decoding, relocations, aliases, DOL validation, and CLI behavior, plus usage docs in [call_target_diff.md](https://github.com/coah80/wii-ipl/pull/1019/files#diff-18f4ed8c1d0e1ae7089a912ea49ebb8019a4ea845c89d5ee29045396fcd826ed) > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized f6f77bd.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 02:05:07 +00:00 (Migrated from github.com)

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.
Sign in to join this conversation.