decomp: reconstruct ESMisc cleanup helpers and return ABI #964

Merged
coah80 merged 1 commits from agent/bittle/esmisc-reconstruction into main 2026-10-02 21:42:08 +00:00
coah80 commented 2026-10-02 21:40:49 +00:00 (Migrated from github.com)

Decompilation-first correction

Reconstructs DeleteUnauthorizedData through three real inline helper boundaries named in target diagnostic strings: verifySavedataZD, DeleteTicketsForce, InitSavedata. No linking flags, metadata, assembly or padding changes. Still non-exact.

Corrects out-of-object path-8/fileInfo-0x20 accesses, title iteration that failed to advance on the verifier path, the handwritten title-switch lowering, read-error cleanup order, and lifetime of enumeration status. Uses real aligned caller-owned buffers and typed title indexing.

Shared header change disclosed: DeleteUnauthorizedData returns s32 rather than void. Target object offsets0x1D20/0x1D9C save enumeration results in r27 and0x23C0 returns it in r3. Sole caller in iplSystem ignores the result; its compiled object is unchanged. Target verifier rejoins common iteration at0x238C; read failure joins cleanup0x2104 separately from successful close0x20E0.

Independently verified on d0e54836

  • Unit decompiled/fuzzy96.76036%→99.33143%; function79.797325%→95.830734%.
  • Function434/449→446/449 instructions, still non-exact. Existing30/31 exact functions preserved, all30 also instruction-exact.
  • Exact code9404/11200 and data4416/4416 unchanged; no report regressions.
  • Pool114/114 now identical, fixing first divergence83. Actual4378 source data bytes match target; its last6 bytes are zero alignment, no padding added.
  • Forced clean rebuild of all1027 source objects: only ESMisc.text/.data change; all other objects, including iplSystem, unchanged in bytes/normalized relocations.
  • Full43U all_source/progress/report/DOL passes SHA1 26116613f624061ba99c8d1a299aaa6efa85670d.
  • Parent regenerated source-extracted host harness:12 scenarios pass ASan/UBSan. LeakSanitizer disabled due ptrace limitation. Supplemental stubbed testing, not Wii runtime execution.
  • Literal audit30 functions/204 arguments:zero candidates/errors; changed function explicitly skipped due unequal sizes.
  • Tests workflow8/literal36/jump-table27/pool8 pass; worktree and diff checks pass.

Remote tree685a752ea9d65cde52ff427cb3f20d659f0f0260 equals tested local tree. AOSS/ATERM unchanged. Attempts/evidence included. Left for review; no merge performed.

Note

Decompile ESMisc cleanup helpers and make DeleteUnauthorizedData return s32

  • Splits the former monolithic ESMisc::DeleteUnauthorizedData body into three helpers: verifySavedataZD (Zelda save-data verification), DeleteTicketsForce (ticket-view enumeration and deletion), and InitSavedata (title-list processing) in iplESMisc.cpp
  • InitSavedata verifies masked Zelda save titles, force-deletes five explicit title IDs with their tickets, and frees the title list on all exits
  • ESMisc::DeleteUnauthorizedData now returns the s32 status from InitSavedata; its declaration in iplESMisc.h changes from void to s32
  • Adds a decompilation-attempt report in allhands-system-decompile.attempts.md
  • Behavioral Change: DeleteUnauthorizedData now propagates a signed status; existing callers that ignore the return value are unaffected, but code matching on void ABI breaks

Macroscope summarized d22cb99.

## Decompilation-first correction Reconstructs DeleteUnauthorizedData through three real inline helper boundaries named in target diagnostic strings: verifySavedataZD, DeleteTicketsForce, InitSavedata. No linking flags, metadata, assembly or padding changes. Still non-exact. Corrects out-of-object path-8/fileInfo-0x20 accesses, title iteration that failed to advance on the verifier path, the handwritten title-switch lowering, read-error cleanup order, and lifetime of enumeration status. Uses real aligned caller-owned buffers and typed title indexing. **Shared header change disclosed:** DeleteUnauthorizedData returns s32 rather than void. Target object offsets0x1D20/0x1D9C save enumeration results in r27 and0x23C0 returns it in r3. Sole caller in iplSystem ignores the result; its compiled object is unchanged. Target verifier rejoins common iteration at0x238C; read failure joins cleanup0x2104 separately from successful close0x20E0. ## Independently verified on d0e54836 - Unit decompiled/fuzzy96.76036%→99.33143%; function79.797325%→95.830734%. - Function434/449→446/449 instructions, still non-exact. Existing30/31 exact functions preserved, all30 also instruction-exact. - Exact code9404/11200 and data4416/4416 unchanged; no report regressions. - Pool114/114 now identical, fixing first divergence83. Actual4378 source data bytes match target; its last6 bytes are zero alignment, no padding added. - Forced clean rebuild of all1027 source objects: only ESMisc.text/.data change; all other objects, including iplSystem, unchanged in bytes/normalized relocations. - Full43U all_source/progress/report/DOL passes SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. - Parent regenerated source-extracted host harness:12 scenarios pass ASan/UBSan. LeakSanitizer disabled due ptrace limitation. Supplemental stubbed testing, not Wii runtime execution. - Literal audit30 functions/204 arguments:zero candidates/errors; changed function explicitly skipped due unequal sizes. - Tests workflow8/literal36/jump-table27/pool8 pass; worktree and diff checks pass. Remote tree685a752ea9d65cde52ff427cb3f20d659f0f0260 equals tested local tree. AOSS/ATERM unchanged. Attempts/evidence included. Left for review; no merge performed. <!-- 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] > ### Decompile `ESMisc` cleanup helpers and make `DeleteUnauthorizedData` return `s32` > - Splits the former monolithic `ESMisc::DeleteUnauthorizedData` body into three helpers: `verifySavedataZD` (Zelda save-data verification), `DeleteTicketsForce` (ticket-view enumeration and deletion), and `InitSavedata` (title-list processing) in [iplESMisc.cpp](https://github.com/coah80/wii-ipl/pull/964/files#diff-b8f46e0c2917099bae4e1c4954943fba2cd86dc3d5c793da7418fa2cc1e9bb79) > - `InitSavedata` verifies masked Zelda save titles, force-deletes five explicit title IDs with their tickets, and frees the title list on all exits > - `ESMisc::DeleteUnauthorizedData` now returns the `s32` status from `InitSavedata`; its declaration in [iplESMisc.h](https://github.com/coah80/wii-ipl/pull/964/files#diff-9b172d61b6cdab12a2a5bc1c96d10167363b1addb8c0390877feee8018d9020e) changes from `void` to `s32` > - Adds a decompilation-attempt report in [allhands-system-decompile.attempts.md](https://github.com/coah80/wii-ipl/pull/964/files#diff-318410918fd7f38155cddb3b47be22a339efca49a90090892d80e530c20de88c) > - Behavioral Change: `DeleteUnauthorizedData` now propagates a signed status; existing callers that ignore the return value are unaffected, but code matching on `void` ABI breaks > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized d22cb99.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 21:42:06 +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.