WIP: Improve iplESMisc matching #11

Closed
coah80 wants to merge 9 commits from codex/ipl-esmisc-integration-20260921 into main
coah80 commented 2026-09-21 19:17:52 +00:00 (Migrated from github.com)

Combines the measured worker candidates for iplESMisc.cpp.

Results:

  • iplESMisc fuzzy match: 95.608925% baseline to 97.23286%
  • 29/31 functions matched
  • DeleteUnauthorizedData: 81.62361% to 83.64588%, still non-exact
  • TMDFile::Exist: 95.12048%, unchanged
  • full 43U build passed
  • DOL SHA-1: 26116613f624061ba99c8d1a299aaa6efa85670d

The raw pool diff still diverges at index 83 in the remaining unauthorized-data string order. No re-agent files are included.

Note

Fix buffer addressing in DeleteUnauthorizedData and refine iplESMisc matching

  • Fixes DeleteUnauthorizedData to use the declared ticket scratch buffer instead of an address eight bytes before it for zeroing, ticket-view copying, ES_DeleteTicket, and failure logging
  • Changes GetValidTicketIndex allocation alignment from positive 32 to negative 32 for the 0x40-byte content-read buffer
  • Refactors several ESMisc functions (checkContentsNum, NumPrivateContents, NumInodesSaveDirRoot, CheckSafeDeleteTitle, DeleteEmptyTitles, DeleteMetaContent, DeleteSavedata) for closer matching: narrower-scope unsigned locals, direct returns, pointer-based traversal, ESTitleId accessors, and hoisted declarations
  • Risk: DeleteMetaContent now passes a fixed 0x40-byte bound to snprintf and uses an expanded path buffer; verify the bound covers all metadata path formats

Macroscope summarized da1841c.

Combines the measured worker candidates for `iplESMisc.cpp`. Results: - `iplESMisc` fuzzy match: 95.608925% baseline to 97.23286% - 29/31 functions matched - `DeleteUnauthorizedData`: 81.62361% to 83.64588%, still non-exact - `TMDFile::Exist`: 95.12048%, unchanged - full 43U build passed - DOL SHA-1: `26116613f624061ba99c8d1a299aaa6efa85670d` The raw pool diff still diverges at index 83 in the remaining unauthorized-data string order. No re-agent files are included. <!-- 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] > ### Fix buffer addressing in `DeleteUnauthorizedData` and refine `iplESMisc` matching > - Fixes `DeleteUnauthorizedData` to use the declared ticket scratch buffer instead of an address eight bytes before it for zeroing, ticket-view copying, `ES_DeleteTicket`, and failure logging > - Changes `GetValidTicketIndex` allocation alignment from positive 32 to negative 32 for the 0x40-byte content-read buffer > - Refactors several `ESMisc` functions (`checkContentsNum`, `NumPrivateContents`, `NumInodesSaveDirRoot`, `CheckSafeDeleteTitle`, `DeleteEmptyTitles`, `DeleteMetaContent`, `DeleteSavedata`) for closer matching: narrower-scope unsigned locals, direct returns, pointer-based traversal, `ESTitleId` accessors, and hoisted declarations > - Risk: `DeleteMetaContent` now passes a fixed 0x40-byte bound to `snprintf` and uses an expanded path buffer; verify the bound covers all metadata path formats > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized da1841c.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->

Pull request closed

Sign in to join this conversation.