[codex] Match ESMisc meta content deletion #3

Merged
coah80 merged 1 commits from codex/worker10-ipl-esmisc-review-20260921 into main 2026-09-21 19:27:33 +00:00
coah80 commented 2026-09-21 19:04:27 +00:00 (Migrated from github.com)

Summary

  • Adjust ESMisc::DeleteMetaContent to reproduce the reference MWCC codegen: a 0x41-byte zeroed local buffer, explicit 0x40 snprintf capacity, and named title-ID halves.
  • The focused function rises from 70.0% to an exact 100.0% fuzzy match.

Validation

  • Full 43U build completed with /home/cole/projects/tests/.venv/bin/ninja.
  • Exact-name objdiff: DeleteMetaContent__Q33ipl7utility6ESMiscFUx at 100.0%.
  • ctxdiff.py: src 0x6c base 0x6c insns 27/27, diffs 0.
  • No previously matched function regressed.
  • DOL SHA-1 remains 26116613f624061ba99c8d1a299aaa6efa85670d.
  • pool_diff.py still reports the pre-existing first divergence at string index 83 in later DeleteUnauthorizedData data; this patch does not change the pool.

Note

Match ESMisc::DeleteMetaContent buffer size and snprintf bound

Updates iplESMisc.cpp to match the original implementation. The local path buffer is now 0x41 (65) bytes instead of 64, title-ID components are stored in local variables, and the snprintf bound is set to the explicit value 0x40 instead of sizeof(metaPath). This means the buffer can hold 65 bytes but snprintf only writes up to 64, matching the original binary's behavior.

Macroscope summarized aefd891.

## Summary - Adjust `ESMisc::DeleteMetaContent` to reproduce the reference MWCC codegen: a 0x41-byte zeroed local buffer, explicit 0x40 `snprintf` capacity, and named title-ID halves. - The focused function rises from 70.0% to an exact 100.0% fuzzy match. ## Validation - Full 43U build completed with `/home/cole/projects/tests/.venv/bin/ninja`. - Exact-name objdiff: `DeleteMetaContent__Q33ipl7utility6ESMiscFUx` at `100.0%`. - `ctxdiff.py`: `src 0x6c base 0x6c insns 27/27`, `diffs 0`. - No previously matched function regressed. - DOL SHA-1 remains `26116613f624061ba99c8d1a299aaa6efa85670d`. - `pool_diff.py` still reports the pre-existing first divergence at string index 83 in later `DeleteUnauthorizedData` data; this patch does not change the pool. <!-- 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] > ### Match `ESMisc::DeleteMetaContent` buffer size and `snprintf` bound > Updates [iplESMisc.cpp](https://github.com/coah80/wii-ipl/pull/3/files#diff-b8f46e0c2917099bae4e1c4954943fba2cd86dc3d5c793da7418fa2cc1e9bb79) to match the original implementation. The local path buffer is now `0x41` (65) bytes instead of 64, title-ID components are stored in local variables, and the `snprintf` bound is set to the explicit value `0x40` instead of `sizeof(metaPath)`. This means the buffer can hold 65 bytes but `snprintf` only writes up to 64, matching the original binary's behavior. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized aefd891.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
Sign in to join this conversation.