decomp: recover ATERM digest and payload lifetimes #997

Merged
coah80 merged 1 commits from agent/bittle/aterm-digest-lifetimes into main 2026-10-03 00:07:02 +00:00
coah80 commented 2026-10-03 00:05:18 +00:00 (Migrated from github.com)

Source reconstruction

Serialize each MD5 state word from one snapshot before its four byte stores, scope the initialized digest scratch to authentication processing, and construct payload pointers after checksum validation.

Independent verification

  • ATERMRunConfigProtocol: 87.438484% → 88.19559%; source 972 → 958 instructions, target 951
  • Unit fuzzy: 96.624664% → 96.77463%; 17/26 exact functions and 10460/19204 exact code unchanged
  • Data measures remain 18584/18864. Raw allocated non-text bytes are unchanged; five existing jump-table relocation addends move with the shorter function. Each changed destination was independently mapped to the same normalized body entry
  • All 1027 objects compared: only ATERM .text and those five .data relocations change; no function/unit/data regressions
  • Parent verified the tested MD5 functions and serializer against production source, then ran 2050 MD5 vectors against hashlib and 2042 valid/invalid checksum cases under ASan/UBSan
  • Tests cover local digest/checksum operations, not live Wii/network initialization
  • All 17 exact functions retain ctxdiff zero; pool identical; literal audit clean; full 43U build/report/DOL and worktree/diff checks pass

Partial reconstruction only. Existing incomplete data remains incomplete; no new exact function or linking claim.

Parent baseline: fa0cb9b7b4
Tested tree: 403ffca759
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d

User priority is decompilation, then matching, then linking. No merge performed or requested by this author.

Note

Refactor MD5 digest and payload handling in ATERMRunConfigProtocol

Cleans up checksum-validation logic in ATERM.c. Moves the MD5 context and digest-length declarations into the authentication-option block where they are used, and replaces the unrolled 16-byte digest serialization with a loop over the four MD5 state words. The payload pointer is now assigned with a conditional expression after checksum calculation. The serialized digest byte layout is unchanged.

Macroscope summarized f78e43c.

## Source reconstruction Serialize each MD5 state word from one snapshot before its four byte stores, scope the initialized digest scratch to authentication processing, and construct payload pointers after checksum validation. ## Independent verification - ATERMRunConfigProtocol: 87.438484% → 88.19559%; source 972 → 958 instructions, target 951 - Unit fuzzy: 96.624664% → 96.77463%; 17/26 exact functions and 10460/19204 exact code unchanged - Data measures remain 18584/18864. Raw allocated non-text bytes are unchanged; five existing jump-table relocation addends move with the shorter function. Each changed destination was independently mapped to the same normalized body entry - All 1027 objects compared: only ATERM .text and those five .data relocations change; no function/unit/data regressions - Parent verified the tested MD5 functions and serializer against production source, then ran 2050 MD5 vectors against hashlib and 2042 valid/invalid checksum cases under ASan/UBSan - Tests cover local digest/checksum operations, not live Wii/network initialization - All 17 exact functions retain ctxdiff zero; pool identical; literal audit clean; full 43U build/report/DOL and worktree/diff checks pass Partial reconstruction only. Existing incomplete data remains incomplete; no new exact function or linking claim. Parent baseline: fa0cb9b7b43018c542b9768a6cd8cd121426b519 Tested tree: 403ffca7597dc4d5a3a11199fb79dbbc4a76d7af DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d User priority is decompilation, then matching, then linking. 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] > ### Refactor MD5 digest and payload handling in `ATERMRunConfigProtocol` > Cleans up checksum-validation logic in [ATERM.c](https://github.com/coah80/wii-ipl/pull/997/files#diff-e67bb234e10edec28359a3022bc49117cf56df7cd361cea3415fc9a54636e50d). Moves the MD5 context and digest-length declarations into the authentication-option block where they are used, and replaces the unrolled 16-byte digest serialization with a loop over the four MD5 state words. The payload pointer is now assigned with a conditional expression after checksum calculation. The serialized digest byte layout is unchanged. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized f78e43c.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 00:07:00 +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.