cleanup(nandsd,esmisc): structured control flow replaces decompiler gotos #1367
File diff suppressed because it is too large
Load Diff
@@ -38,21 +38,19 @@ namespace ipl {
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("ESMisc::GetTmdView: ES_GetTmdView1 err %d\n", ret);
|
||||
*outTmdView = NULL;
|
||||
goto out;
|
||||
} else {
|
||||
tmdView = (ESTmdView*)heap->alloc(OSRoundUp32B(tmdViewSize), -DEFAULT_ALIGN);
|
||||
*outTmdView = tmdView;
|
||||
memset(tmdView, 0, OSRoundUp32B(tmdViewSize));
|
||||
|
||||
ret = ES_GetTmdView(titleId, *outTmdView, &tmdViewSize);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("ESMisc::GetTmdView: ES_GetTmdView2 err %d\n", ret);
|
||||
heap->free(*outTmdView);
|
||||
*outTmdView = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
tmdView = (ESTmdView*)heap->alloc(OSRoundUp32B(tmdViewSize), -DEFAULT_ALIGN);
|
||||
*outTmdView = tmdView;
|
||||
memset(tmdView, 0, OSRoundUp32B(tmdViewSize));
|
||||
|
||||
ret = ES_GetTmdView(titleId, *outTmdView, &tmdViewSize);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("ESMisc::GetTmdView: ES_GetTmdView2 err %d\n", ret);
|
||||
heap->free(*outTmdView);
|
||||
*outTmdView = NULL;
|
||||
}
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -287,63 +285,59 @@ namespace ipl {
|
||||
|
||||
ticketView = (ESTicketView*)heap->alloc(0xe0, -DEFAULT_ALIGN);
|
||||
|
||||
if (ESP_InitLib() < ES_ERR_OK) {
|
||||
goto error;
|
||||
}
|
||||
if (ESP_InitLib() >= ES_ERR_OK) {
|
||||
index = __OSGetValidTicketIndex(ticket, ticketLength);
|
||||
|
||||
index = __OSGetValidTicketIndex(ticket, ticketLength);
|
||||
if (index >= -1) {
|
||||
if (index == -1) {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
if (index < -1) {
|
||||
goto error;
|
||||
}
|
||||
memcpy(ticketView, &ticket[index], sizeof(ESTicketView));
|
||||
|
||||
if (index == -1) {
|
||||
index = 0;
|
||||
}
|
||||
{
|
||||
ESFd fd = ES_OpenTitleContentFile(titleId, ticketView, 0);
|
||||
|
||||
memcpy(ticketView, &ticket[index], sizeof(ESTicketView));
|
||||
|
||||
{
|
||||
ESFd fd = ES_OpenTitleContentFile(titleId, ticketView, 0);
|
||||
|
||||
if (fd < 0) {
|
||||
OSReport("ESMisc::GetValidTicketIndex: ES_OpenTitleContentFile fd %d\n", fd);
|
||||
} else {
|
||||
char* buf = (char*)heap->alloc(0x40, -DEFAULT_ALIGN);
|
||||
u32 numRead = ES_ReadContentFile(fd, buf, 0x40);
|
||||
|
||||
if (numRead != 0x40) {
|
||||
OSReport("ESMisc::GetValidTicketIndex: ES_ReadContentFile err %d\n", numRead);
|
||||
heap->free(buf);
|
||||
|
||||
if (ES_CloseContentFile(fd) < ES_ERR_OK) {
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
if (ES_CloseContentFile(fd) < ES_ERR_OK) {
|
||||
heap->free(buf);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (buf[0] == 0) {
|
||||
OSReport("ESMisc::GetValidTicketIndex: No name\n");
|
||||
heap->free(buf);
|
||||
if (fd < 0) {
|
||||
OSReport("ESMisc::GetValidTicketIndex: ES_OpenTitleContentFile fd %d\n", fd);
|
||||
} else {
|
||||
heap->free(buf);
|
||||
found = true;
|
||||
char* buf = (char*)heap->alloc(0x40, -DEFAULT_ALIGN);
|
||||
u32 numRead = ES_ReadContentFile(fd, buf, 0x40);
|
||||
|
||||
if (numRead != 0x40) {
|
||||
OSReport("ESMisc::GetValidTicketIndex: ES_ReadContentFile err %d\n", numRead);
|
||||
heap->free(buf);
|
||||
|
||||
if (ES_CloseContentFile(fd) < ES_ERR_OK) {
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
if (ES_CloseContentFile(fd) < ES_ERR_OK) {
|
||||
heap->free(buf);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (buf[0] == 0) {
|
||||
OSReport("ESMisc::GetValidTicketIndex: No name\n");
|
||||
heap->free(buf);
|
||||
} else {
|
||||
heap->free(buf);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
heap->free(ticketView);
|
||||
|
||||
if (allocated && ticket != NULL) {
|
||||
heap->free(ticket);
|
||||
}
|
||||
|
||||
return found ? index : -1;
|
||||
}
|
||||
}
|
||||
|
||||
heap->free(ticketView);
|
||||
|
||||
if (allocated && ticket != NULL) {
|
||||
heap->free(ticket);
|
||||
}
|
||||
|
||||
return found ? index : -1;
|
||||
|
||||
error:
|
||||
heap->free(ticketView);
|
||||
|
||||
@@ -405,66 +399,65 @@ namespace ipl {
|
||||
ret = ES_ListTitlesOnCard(NULL, &numTitles);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("DeleteSharedContent: ES_ListTitlesOnCard1 err %d\n", ret);
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
if (numTitles != 0) {
|
||||
titleIds = (ESTitleId*)heap->alloc(OSRoundUp32B(numTitles * sizeof(ESTitleId)), -DEFAULT_ALIGN);
|
||||
if (titleIds == NULL) {
|
||||
OSReport("DeleteSharedContent: MEMAllocate for Title List err\n");
|
||||
ret = ES_ERR_MEMORY_ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (numTitles != 0) {
|
||||
titleIds = (ESTitleId*)heap->alloc(OSRoundUp32B(numTitles * sizeof(ESTitleId)), -DEFAULT_ALIGN);
|
||||
if (titleIds == NULL) {
|
||||
OSReport("DeleteSharedContent: MEMAllocate for Title List err\n");
|
||||
ret = ES_ERR_MEMORY_ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = ES_ListTitlesOnCard(titleIds, &numTitles);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("DeleteSharedContent: ES_ListTitlesOnCard2 err %d\n", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < numTitles; i++) {
|
||||
u32 tmdSize = 0;
|
||||
|
||||
ret = ES_GetTmd(titleIds[i], NULL, &tmdSize);
|
||||
ret = ES_ListTitlesOnCard(titleIds, &numTitles);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("DeleteSharedContent: ES_GetTmd1 err %d\n", ret);
|
||||
OSReport("DeleteSharedContent: ES_ListTitlesOnCard2 err %d\n", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (tmdSize == 0 || tmdSize > sizeof(ESTitleMeta)) {
|
||||
ret = ES_ERR_INVALID;
|
||||
goto out;
|
||||
}
|
||||
for (u32 i = 0; i < numTitles; i++) {
|
||||
u32 tmdSize = 0;
|
||||
|
||||
ret = ES_GetTmd(titleIds[i], tmd, &tmdSize);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("DeleteSharedContent: ES_GetTmd2 err %d\n", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (u16 c = 0; c < tmd->head.numContents; c++) {
|
||||
if ((tmd->contents[c].type & 0x8000) == 0) {
|
||||
continue;
|
||||
ret = ES_GetTmd(titleIds[i], NULL, &tmdSize);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("DeleteSharedContent: ES_GetTmd1 err %d\n", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (u32 h = 0; h < numShared; h++) {
|
||||
if (memcmp(tmd->contents[c].hash, hashes[h], sizeof(ESHash)) == 0) {
|
||||
used[h] = 1;
|
||||
break;
|
||||
if (tmdSize == 0 || tmdSize > sizeof(ESTitleMeta)) {
|
||||
ret = ES_ERR_INVALID;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = ES_GetTmd(titleIds[i], tmd, &tmdSize);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("DeleteSharedContent: ES_GetTmd2 err %d\n", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (u16 c = 0; c < tmd->head.numContents; c++) {
|
||||
if ((tmd->contents[c].type & 0x8000) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (u32 h = 0; h < numShared; h++) {
|
||||
if (memcmp(tmd->contents[c].hash, hashes[h], sizeof(ESHash)) == 0) {
|
||||
used[h] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (u32 h = 0; h < numShared; h++) {
|
||||
if (used[h] != 0) {
|
||||
continue;
|
||||
}
|
||||
for (u32 h = 0; h < numShared; h++) {
|
||||
if (used[h] != 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = ES_DeleteSharedContent(hashes[h]);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("DeleteSharedContent: ES_DeleteSharedContent err %d\n", ret);
|
||||
ret = ES_DeleteSharedContent(hashes[h]);
|
||||
if (ret < ES_ERR_OK) {
|
||||
OSReport("DeleteSharedContent: ES_DeleteSharedContent err %d\n", ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,48 +577,43 @@ namespace ipl {
|
||||
|
||||
if (ret < ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_GetTmdView1 failed: %d", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = ES_ListTitleContentsOnCard(titleId, NULL, &numContents);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_ListTitleContentsOnCard1 failed: %d for %016llx", ret, titleId);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (numContents == 0) {
|
||||
return ES_ERR_OK;
|
||||
}
|
||||
|
||||
tmdView = (ESTmdView*)heap->alloc(OSRoundUp32B(tmdViewSize), -DEFAULT_ALIGN);
|
||||
contentIds = (ESContentId*)heap->alloc(OSRoundUp32B(numContents * sizeof(ESContentId)), -DEFAULT_ALIGN);
|
||||
|
||||
ret = ES_ListTitleContentsOnCard(titleId, contentIds, &numContents);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_ListTitleContentsOnCard2 failed: %d for %016llx", ret, titleId);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = ES_GetTmdView(titleId, tmdView, &tmdViewSize);
|
||||
if (ret < ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_GetTmdView2 failed: %d", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
u32 i = 0;
|
||||
u32 j = 0;
|
||||
ESCmdView* content = tmdView->contents;
|
||||
for (; i < tmdView->head.numContents && j < numContents; i++, content++) {
|
||||
if (content->cid == contentIds[j]) {
|
||||
if (!(content->type & 0x8000)) {
|
||||
ret++;
|
||||
} else {
|
||||
ret = ES_ListTitleContentsOnCard(titleId, NULL, &numContents);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_ListTitleContentsOnCard1 failed: %d for %016llx", ret, titleId);
|
||||
} else {
|
||||
if (numContents == 0) {
|
||||
return ES_ERR_OK;
|
||||
}
|
||||
|
||||
tmdView = (ESTmdView*)heap->alloc(OSRoundUp32B(tmdViewSize), -DEFAULT_ALIGN);
|
||||
contentIds = (ESContentId*)heap->alloc(OSRoundUp32B(numContents * sizeof(ESContentId)), -DEFAULT_ALIGN);
|
||||
|
||||
ret = ES_ListTitleContentsOnCard(titleId, contentIds, &numContents);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_ListTitleContentsOnCard2 failed: %d for %016llx", ret, titleId);
|
||||
} else {
|
||||
ret = ES_GetTmdView(titleId, tmdView, &tmdViewSize);
|
||||
if (ret < ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_GetTmdView2 failed: %d", ret);
|
||||
} else {
|
||||
ret = 0;
|
||||
u32 i = 0;
|
||||
u32 j = 0;
|
||||
ESCmdView* content = tmdView->contents;
|
||||
for (; i < tmdView->head.numContents && j < numContents; i++, content++) {
|
||||
if (content->cid == contentIds[j]) {
|
||||
if (!(content->type & 0x8000)) {
|
||||
ret++;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
if (contentIds != NULL) {
|
||||
heap->free(contentIds);
|
||||
}
|
||||
@@ -946,35 +934,31 @@ namespace ipl {
|
||||
|
||||
if (ret != ES_ERR_OK || entryCount == 0) {
|
||||
ES_ERR_REPORT("Could not read1 %s: %d", dirPath, ret);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
entries = (char*)heap->alloc(OSRoundUp32B(entryCount * (NAND_MAX_PATH + 1)), -DEFAULT_ALIGN);
|
||||
if (entries == NULL) {
|
||||
ret = -2;
|
||||
ES_ERR_REPORT("Could not alloc: %d", -2);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = NANDReadDir(dirPath, entries, &entryCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("Could not read2 %s: %d", dirPath, ret);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
entry = entries;
|
||||
for (i = 0; i < entryCount;) {
|
||||
snprintf(filePath, NAND_MAX_PATH, "%s%s", dirPath, entry);
|
||||
filePath[NAND_MAX_PATH] = 0;
|
||||
ret = NANDPrivateDelete(filePath);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("Failed to delete %s: %d", filePath, ret);
|
||||
} else {
|
||||
entries = (char*)heap->alloc(OSRoundUp32B(entryCount * (NAND_MAX_PATH + 1)), -DEFAULT_ALIGN);
|
||||
if (entries == NULL) {
|
||||
ret = -2;
|
||||
ES_ERR_REPORT("Could not alloc: %d", -2);
|
||||
} else {
|
||||
ret = NANDReadDir(dirPath, entries, &entryCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("Could not read2 %s: %d", dirPath, ret);
|
||||
} else {
|
||||
entry = entries;
|
||||
for (i = 0; i < entryCount;) {
|
||||
snprintf(filePath, NAND_MAX_PATH, "%s%s", dirPath, entry);
|
||||
filePath[NAND_MAX_PATH] = 0;
|
||||
ret = NANDPrivateDelete(filePath);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("Failed to delete %s: %d", filePath, ret);
|
||||
}
|
||||
i++;
|
||||
entry += strlen(entry) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
entry += strlen(entry) + 1;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (entries != NULL) {
|
||||
heap->free(entries);
|
||||
}
|
||||
@@ -1020,65 +1004,65 @@ namespace ipl {
|
||||
ret = NANDRead(fileInfo, saveData, 0x4000);
|
||||
if (ret < 0) {
|
||||
OSReport("%s::%s: Read file failed: %d\n", __FILE__, __FUNCTION__, ret);
|
||||
goto cleanup;
|
||||
} else if (ret != 0x4000) {
|
||||
OSReport("%s::%s: File size is not correct: %d\n", __FILE__, __FUNCTION__, ret);
|
||||
deleteSaveData = TRUE;
|
||||
} else {
|
||||
offset = 8;
|
||||
valid = FALSE;
|
||||
j = 0;
|
||||
while (j < 3) {
|
||||
firstBlock = saveData + offset;
|
||||
if (!checkForNullTermination((char*)firstBlock + 0x4e, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x58, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x72, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x8e, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x1b4, 0x11) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x1c5, 0x11)) {
|
||||
goto verify_failed;
|
||||
}
|
||||
j++;
|
||||
offset += 0xa94;
|
||||
}
|
||||
|
||||
offset = 0x2008;
|
||||
j = 0;
|
||||
while (j < 3) {
|
||||
secondBlock = saveData + offset;
|
||||
if (!checkForNullTermination((char*)secondBlock + 0x4e, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x58, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x72, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x8e, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x1b4, 0x11) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x1c5, 0x11)) {
|
||||
goto verify_failed;
|
||||
}
|
||||
j++;
|
||||
offset += 0xa94;
|
||||
}
|
||||
valid = TRUE;
|
||||
|
||||
// MWCC needs both verification loops to share this failure label.
|
||||
verify_failed:
|
||||
|
||||
if (!valid) {
|
||||
OSReport("%s::%s: Verify failed for %016llx\n", __FILE__, __FUNCTION__,
|
||||
titleId);
|
||||
if (ret != 0x4000) {
|
||||
OSReport("%s::%s: File size is not correct: %d\n", __FILE__, __FUNCTION__, ret);
|
||||
deleteSaveData = TRUE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
offset = 8;
|
||||
valid = FALSE;
|
||||
j = 0;
|
||||
while (j < 3) {
|
||||
firstBlock = saveData + offset;
|
||||
if (!checkForNullTermination((char*)firstBlock + 0x4e, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x58, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x72, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x8e, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x1b4, 0x11) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x1c5, 0x11)) {
|
||||
goto verify_failed;
|
||||
}
|
||||
j++;
|
||||
offset += 0xa94;
|
||||
}
|
||||
|
||||
NANDClose(fileInfo);
|
||||
fileOpen = FALSE;
|
||||
if (deleteSaveData) {
|
||||
ESMisc::DeleteSavedata(titleId, heap);
|
||||
offset = 0x2008;
|
||||
j = 0;
|
||||
while (j < 3) {
|
||||
secondBlock = saveData + offset;
|
||||
if (!checkForNullTermination((char*)secondBlock + 0x4e, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x58, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x72, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x8e, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x1b4, 0x11) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x1c5, 0x11)) {
|
||||
goto verify_failed;
|
||||
}
|
||||
j++;
|
||||
offset += 0xa94;
|
||||
}
|
||||
valid = TRUE;
|
||||
|
||||
// MWCC needs direct failure branches; loop breaks add completion tests.
|
||||
verify_failed:
|
||||
|
||||
if (!valid) {
|
||||
OSReport("%s::%s: Verify failed for %016llx\n", __FILE__, __FUNCTION__,
|
||||
titleId);
|
||||
deleteSaveData = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
NANDClose(fileInfo);
|
||||
fileOpen = FALSE;
|
||||
if (deleteSaveData) {
|
||||
ESMisc::DeleteSavedata(titleId, heap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (saveData != NULL) {
|
||||
heap->free(saveData);
|
||||
}
|
||||
@@ -1098,26 +1082,26 @@ namespace ipl {
|
||||
ret = ES_GetTicketViews(titleId, NULL, ticketViewCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: ES_GetTicketViews failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret, titleId);
|
||||
goto cleanup;
|
||||
}
|
||||
if (*ticketViewCount == 0) {
|
||||
return ret;
|
||||
}
|
||||
ticketViewList = (ESTicketView*)heap->alloc(*ticketViewCount * OSRoundUp32B(sizeof(ESTicketView)), -DEFAULT_ALIGN);
|
||||
ret = ES_GetTicketViews(titleId, ticketViewList, ticketViewCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: ES_GetTicketViews failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret, titleId);
|
||||
goto cleanup;
|
||||
}
|
||||
for (j = 0; j < *ticketViewCount; j++) {
|
||||
memcpy(ticketViews, &ticketViewList[j], sizeof(ESTicketView));
|
||||
ret = ES_DeleteTicket((ESTicketView*)ticketViews);
|
||||
} else {
|
||||
if (*ticketViewCount == 0) {
|
||||
return ret;
|
||||
}
|
||||
ticketViewList = (ESTicketView*)heap->alloc(*ticketViewCount * OSRoundUp32B(sizeof(ESTicketView)), -DEFAULT_ALIGN);
|
||||
ret = ES_GetTicketViews(titleId, ticketViewList, ticketViewCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: ES_DeleteTicket failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret,
|
||||
((ESTicketView*)ticketViews)->ticketId);
|
||||
OSReport("%s::%s: ES_GetTicketViews failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret, titleId);
|
||||
} else {
|
||||
for (j = 0; j < *ticketViewCount; j++) {
|
||||
memcpy(ticketViews, &ticketViewList[j], sizeof(ESTicketView));
|
||||
ret = ES_DeleteTicket((ESTicketView*)ticketViews);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: ES_DeleteTicket failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret,
|
||||
((ESTicketView*)ticketViews)->ticketId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cleanup:
|
||||
|
||||
if (ticketViewList != NULL) {
|
||||
heap->free(ticketViewList);
|
||||
}
|
||||
@@ -1138,42 +1122,38 @@ namespace ipl {
|
||||
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: Failed to ES_ListTitlesOnCard1: %d\n", __FILE__, __FUNCTION__, ret);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
titleIds = (ESTitleId*)heap->alloc(OSRoundUp32B(titleCount * sizeof(ESTitleId)), -DEFAULT_ALIGN);
|
||||
if (titleIds == NULL) {
|
||||
OSReport("%s::%s: Unable to allocate\n", __FILE__, __FUNCTION__);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = ES_ListTitlesOnCard(titleIds, &titleCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: Failed to ES_ListTitlesOnCard2: %d\n", __FILE__, __FUNCTION__, ret);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
{
|
||||
ticketScratch = ticketViews;
|
||||
for (i = 0; i < titleCount; i++) {
|
||||
if ((titleIds[i] & 0xFFFFFFFFFFFFFF00ULL) == 0x00010000525A4400ULL) {
|
||||
verifySavedataZD(heap, titleIds[i], &fileInfo);
|
||||
continue;
|
||||
}
|
||||
switch (titleIds[i]) {
|
||||
case 0x0001000844495343ULL:
|
||||
case 0x000100014A4F4449ULL:
|
||||
case 0x0001000148415858ULL:
|
||||
case 0x0001000844564458ULL:
|
||||
case 0x000100084449534BULL:
|
||||
ES_DeleteTitle(titleIds[i]);
|
||||
DeleteTicketsForce(heap, titleIds[i], ticketScratch, &ticketViewCount);
|
||||
break;
|
||||
} else {
|
||||
titleIds = (ESTitleId*)heap->alloc(OSRoundUp32B(titleCount * sizeof(ESTitleId)), -DEFAULT_ALIGN);
|
||||
if (titleIds == NULL) {
|
||||
OSReport("%s::%s: Unable to allocate\n", __FILE__, __FUNCTION__);
|
||||
} else {
|
||||
ret = ES_ListTitlesOnCard(titleIds, &titleCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: Failed to ES_ListTitlesOnCard2: %d\n", __FILE__, __FUNCTION__, ret);
|
||||
} else {
|
||||
{
|
||||
ticketScratch = ticketViews;
|
||||
for (i = 0; i < titleCount; i++) {
|
||||
if ((titleIds[i] & 0xFFFFFFFFFFFFFF00ULL) == 0x00010000525A4400ULL) {
|
||||
verifySavedataZD(heap, titleIds[i], &fileInfo);
|
||||
continue;
|
||||
}
|
||||
switch (titleIds[i]) {
|
||||
case 0x0001000844495343ULL:
|
||||
case 0x000100014A4F4449ULL:
|
||||
case 0x0001000148415858ULL:
|
||||
case 0x0001000844564458ULL:
|
||||
case 0x000100084449534BULL:
|
||||
ES_DeleteTitle(titleIds[i]);
|
||||
DeleteTicketsForce(heap, titleIds[i], ticketScratch, &ticketViewCount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (titleIds != NULL) {
|
||||
heap->free(titleIds);
|
||||
}
|
||||
@@ -1342,12 +1322,11 @@ namespace ipl {
|
||||
ret = NANDWrite(&mFile, entry, entryLen);
|
||||
if (ret != entryLen) {
|
||||
ES_ERR_REPORT("NANDWrite err: %d!=%d", ret, entryLen);
|
||||
goto out;
|
||||
} else {
|
||||
// We are done!!!
|
||||
ret = NAND_RESULT_OK;
|
||||
mFileLength += entryLen;
|
||||
}
|
||||
|
||||
// We are done!!!
|
||||
ret = NAND_RESULT_OK;
|
||||
mFileLength += entryLen;
|
||||
}
|
||||
out:
|
||||
if (entry != NULL) {
|
||||
@@ -1396,18 +1375,17 @@ namespace ipl {
|
||||
ret = NANDRead(&mFile, tmdBuffer, fileLen);
|
||||
if (ret != fileLen) {
|
||||
ES_ERR_REPORT("NANDRead err: %d!=%d", ret, fileLen);
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
ret = ES_ImportTitleInit(tmdBuffer, tmdSize, NULL, 0, NULL, 0, 2, 1);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_ImportTitleInit err: %d", ret);
|
||||
ES_ImportTitleCancel();
|
||||
}
|
||||
|
||||
ret = ES_ImportTitleInit(tmdBuffer, tmdSize, NULL, 0, NULL, 0, 2, 1);
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_ImportTitleInit err: %d", ret);
|
||||
ES_ImportTitleCancel();
|
||||
}
|
||||
|
||||
ret = ES_ImportTitleDone();
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_ImportTitleDone err: %d", ret);
|
||||
ret = ES_ImportTitleDone();
|
||||
if (ret != ES_ERR_OK) {
|
||||
ES_ERR_REPORT("ES_ImportTitleDone err: %d", ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
out:
|
||||
|
||||
@@ -103,3 +103,231 @@ The retry-loop rewrite in ESMisc also renumbers compiler-generated `__FUNCTION__
|
||||
|
||||
- `483f492f`: NandSDWorker cleanup only.
|
||||
- `6daf7896`: ESMisc cleanup only.
|
||||
|
||||
## Round b, MAX effort
|
||||
|
||||
- Worktree `data-d3`, branch `agent/w1009/cleanup2-w2b`, baseline `8e47db4a`, containing round a as PR #1353. Re-read cleanup-common.md, this log, unslop, and writing-for-agents.
|
||||
- Fresh 43U build and completion checker passed. DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`. Section-aware baseline verification is 203/203 NandSDWorker and 31/31 ESMisc exact functions.
|
||||
- Inventory: 197 NandSDWorker gotos in 25 functions; 43 ESMisc gotos in 11 functions. Every remaining NandSDWorker target is a common cleanup or return label, not a state-machine label. ESMisc also has the Zelda verification failure label.
|
||||
- Do not repeat round-a pragma, weak-emitter, buffer, boolean-conversion, or inline-verification-helper experiments. Test structured error chains, existing loop exits, and return lifetime with assembly evidence per function.
|
||||
|
||||
### Structured control-flow trials
|
||||
|
||||
- `NandSDWorker::do_startup`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_nand_save_banner`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_check_for_sd_app_to_nand`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::check_backup_fits`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::delete_nand_disk_app_with_ticket`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::delete_nand_titles`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_copy_nand_save_to_sd`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_copy_sd_save_to_nand`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_sd_save_banner`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_sd_wad_header`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_copy_nand_app_to_sd`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_save_banner_for_data_only_title`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_app_banner_from_meta`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::open_nand_app_content`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_copy_sd_app_to_nand`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_sd_app_banner`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_sd_app_thumbnail`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::nand_app_exist_ex`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_nand_save_perms`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::check_sd_title_restorable`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::GetTmdView`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::GetValidTicketIndex`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::DeleteSharedContent`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::NumPrivateContents`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::DeleteSavedata`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `DeleteTicketsForce`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `InitSavedata`: replace the last error-exit jump with a success else. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_startup`: express the save-cache requirement as a positive guard. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::GetValidTicketIndex`: express the valid ticket index as a positive guard. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_startup`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- do_startup__Q23ipl12NandSDWorkerFv: 323 -> 480 instructions; #32 `bne 0x98` -> `bne 0xc4`; #33 `lwz r3, 0(r28)` -> `lwz r4, 0(r28)`; #35 `addis r3, r3, 4` -> `mr r3, r28`.
|
||||
- `NandSDWorker::do_check_for_sd_app_to_nand`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- do_check_for_sd_app_to_nand__Q23ipl12NandSDWorkerFv: 242 -> 292 instructions; #29 `beq 0x98` -> `beq 0xac`; #35 `addis r3, r3, 4` -> `mr r4, r28`; #36 `stw r30, -0x15dc(r3)` -> `addis r3, r3, 4`.
|
||||
- `NandSDWorker::check_backup_fits`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- check_backup_fits__Q23ipl12NandSDWorkerFv: 246 -> 291 instructions; #36 `b 0x3ac` -> `b 0x460`; #41 `b 0x188` -> `b 0x1c4`; #44 `beq 0xc8` -> `beq 0xdc`.
|
||||
- `NandSDWorker::do_list_nand_apps_usage`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- do_list_nand_apps_usage__Q23ipl12NandSDWorkerFv: 114 -> 119 instructions; #38 `b 0x180` -> `b 0x194`; #40 `bge 0x18c` -> `bge 0x1a0`; #46 `beq 0x178` -> `beq 0x18c`.
|
||||
- `NandSDWorker::delete_nand_disk_app_with_ticket`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- delete_nand_disk_app_with_ticket__Q23ipl12NandSDWorkerFv: 108 -> 107 instructions; #5 `li r27, 0` -> `li r30, 0`; #7 `stw r27, 8(r1)` -> `stw r30, 8(r1)`; #19 `li r28, -2` -> `li r3, -2`.
|
||||
- `NandSDWorker::delete_nand_titles`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- delete_nand_titles__Q23ipl12NandSDWorkerFv: 146 -> 168 instructions; #5 `li r22, 0` -> `li r25, 0`; #6 `lis r25, 0` -> `lis r24, 0`; #7 `stw r22, 8(r1)` -> `stw r25, 8(r1)`.
|
||||
- `NandSDWorker::do_copy_nand_save_to_sd`: use early returns with the existing cleanup at each exit. reverted; changed ('.data', 0), ('.text', 0), rel('.rodata', 0), rel('.text', 0), symbols.
|
||||
- change_nand_app_count__Q23ipl12NandSDWorkerFl: 47 -> 47 instructions; #16 `addi r3, r31, 0x26af` -> `addi r3, r31, 0x2684`; #21 `addi r3, r31, 0x26e4` -> `addi r3, r31, 0x26b9`; #32 `addi r3, r31, 0x2716` -> `addi r3, r31, 0x26eb`.
|
||||
- check_sd_title_restorable__Q23ipl12NandSDWorkerFUl: 97 -> 97 instructions; #51 `addi r3, r31, 0x2ec5` -> `addi r3, r31, 0x2e9a`; #72 `addi r3, r31, 0x2f00` -> `addi r3, r31, 0x2ed5`; #81 `addi r3, r31, 0x2f29` -> `addi r3, r31, 0x2efe`.
|
||||
- `NandSDWorker::do_copy_sd_save_to_nand`: use early returns with the existing cleanup at each exit. reverted; changed ('.data', 0), ('.text', 0), rel('.text', 0), symbols.
|
||||
- change_nand_app_count__Q23ipl12NandSDWorkerFl: 47 -> 47 instructions; #16 `addi r3, r31, 0x26af` -> `addi r3, r31, 0x261f`; #21 `addi r3, r31, 0x26e4` -> `addi r3, r31, 0x2654`; #32 `addi r3, r31, 0x2716` -> `addi r3, r31, 0x2686`.
|
||||
- check_sd_title_restorable__Q23ipl12NandSDWorkerFUl: 97 -> 97 instructions; #51 `addi r3, r31, 0x2ec5` -> `addi r3, r31, 0x2e35`; #72 `addi r3, r31, 0x2f00` -> `addi r3, r31, 0x2e70`; #81 `addi r3, r31, 0x2f29` -> `addi r3, r31, 0x2e99`.
|
||||
- `NandSDWorker::get_sd_save_banner`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- get_sd_save_banner__Q23ipl12NandSDWorkerFUlPQ33ipl12NandSDWorker12SDSaveBanner: 142 -> 166 instructions; #6 `mr r31, r3` -> `mr r30, r3`; #7 `lis r29, 0` -> `lis r28, 0`; #10 `lis r30, 1` -> `lis r29, 1`.
|
||||
- `NandSDWorker::delete_download_task`: use early returns with the existing cleanup at each exit. reverted; changed ('.data', 0), ('.text', 0), rel('.text', 0), symbols.
|
||||
- delete_download_task__Q23ipl12NandSDWorkerFUl: 133 -> 143 instructions; #6 `mr r25, r3` -> `mr r26, r3`; #8 `mr r26, r4` -> `mr r27, r4`; #10 `li r27, 0` -> `li r4, 0x4000`.
|
||||
- `NandSDWorker::do_copy_nand_app_to_sd`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- do_copy_nand_app_to_sd__Q23ipl12NandSDWorkerFv: 332 -> 481 instructions; #6 `mr r23, r3` -> `mr r25, r3`; #15 `lwz r4, 0(r23)` -> `lwz r4, 0(r25)`; #18 `li r26, 0` -> `addis r4, r4, 4`.
|
||||
- `NandSDWorker::get_save_banner_for_data_only_title`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- get_save_banner_for_data_only_title__Q23ipl12NandSDWorkerFUxP17WIISaveBannerFilePUl: 88 -> 115 instructions; #26 `b 0x148` -> `b 0x1b4`; #32 `bge 0x98` -> `bge 0xbc`; #36 `li r31, -3` -> `mr r3, r30`.
|
||||
- `NandSDWorker::get_app_banner_from_meta`: use early returns with the existing cleanup at each exit. reverted; changed ('.data', 0), ('.text', 0), rel('.text', 0), symbols.
|
||||
- change_nand_app_count__Q23ipl12NandSDWorkerFl: 47 -> 47 instructions; #16 `addi r3, r31, 0x26af` -> `addi r3, r31, 0x2688`; #21 `addi r3, r31, 0x26e4` -> `addi r3, r31, 0x26bd`; #32 `addi r3, r31, 0x2716` -> `addi r3, r31, 0x26ef`.
|
||||
- check_sd_title_restorable__Q23ipl12NandSDWorkerFUl: 97 -> 97 instructions; #51 `addi r3, r31, 0x2ec5` -> `addi r3, r31, 0x2e9e`; #72 `addi r3, r31, 0x2f00` -> `addi r3, r31, 0x2ed9`; #81 `addi r3, r31, 0x2f29` -> `addi r3, r31, 0x2f02`.
|
||||
- `NandSDWorker::open_nand_app_content`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- open_nand_app_content__Q23ipl12NandSDWorkerFUxUsPUlPP12ESTicketView: 135 -> 203 instructions; #6 `lis r30, 0` -> `lis r29, 0`; #9 `mr r31, r3` -> `mr r30, r3`; #14 `mr r28, r9` -> `mr r31, r9`.
|
||||
- `NandSDWorker::do_copy_sd_app_to_nand`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- do_copy_sd_app_to_nand__Q23ipl12NandSDWorkerFb: 300 -> 370 instructions; #19 `bne 0xa8` -> `bne 0xc4`; #23 `beq 0x9c` -> `beq 0xb8`; #30 `bne 0xa8` -> `bne 0xc4`.
|
||||
- `NandSDWorker::get_sd_app_banner`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- get_sd_app_banner__Q23ipl12NandSDWorkerFUlPQ33ipl12NandSDWorker11SDAppBanner: 157 -> 187 instructions; #20 `bne 0x6c` -> `bne 0x84`; #25 `stw r0, 8(r1)` -> `mr r4, r31`; #26 `b 0x244` -> `stw r0, 8(r1)`.
|
||||
- `NandSDWorker::get_sd_app_thumbnail`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- get_sd_app_thumbnail__Q23ipl12NandSDWorkerFPCQ33ipl12NandSDWorker11SDAppBannerPUc: 172 -> 236 instructions; #13 `li r30, 0` -> `bl 0x34`; #14 `li r29, 0` -> `lwz r5, 8(r27)`; #15 `bl 0x3c` -> `cmplwi r5, 0xc800`.
|
||||
- `NandSDWorker::nand_app_exist_ex`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- nand_app_exist_ex__Q23ipl12NandSDWorkerFUx: 226 -> 274 instructions; #29 `beq 0x98` -> `beq 0xb4`; #31 `beq 0x98` -> `beq 0xb4`; #36 `li r26, 0` -> `lwz r4, 0x2c(r1)`.
|
||||
- `NandSDWorker::recursion_nand`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- recursion_nand__Q23ipl12NandSDWorkerFPCcPCcQ33ipl12NandSDWorker16RecursiveProcessPPCcUl: 318 -> 479 instructions; #83 `b 0x484` -> `b 0x708`; #89 `beq 0x188` -> `beq 0x1d0`; #96 `stw r0, 0xc(r1)` -> `lwz r4, 0x1c(r1)`.
|
||||
- `NandSDWorker::get_nand_save_perms`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- get_nand_save_perms__Q23ipl12NandSDWorkerFUx: 96 -> 144 instructions; #6 `mr r27, r3` -> `mr r30, r3`; #8 `mr r29, r5` -> `mr r28, r5`; #10 `mr r28, r6` -> `mr r27, r6`.
|
||||
- `NandSDWorker::check_sd_title_restorable`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- check_sd_title_restorable__Q23ipl12NandSDWorkerFUl: 97 -> 130 instructions; #15 `mr r30, r3` -> `mr r29, r3`; #19 `mr r5, r30` -> `mr r5, r29`; #24 `bne 0x154` -> `beq 0x80`.
|
||||
- `ESMisc::DeleteSharedContent`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- DeleteSharedContent__Q33ipl7utility6ESMiscFPQ23EGG4Heap: 261 -> 477 instructions; #5 `li r28, 0` -> `li r25, 0`; #7 `stw r28, 0x10(r1)` -> `stw r25, 0x10(r1)`; #10 `li r27, 0` -> `li r4, 0x4a00`.
|
||||
- `ESMisc::NumPrivateContents`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- NumPrivateContents__Q33ipl7utility6ESMiscFPQ23EGG4HeapUx: 153 -> 170 instructions; #13 `li r28, 0` -> `li r5, 0`; #14 `li r27, 0` -> `bl 0x38`; #15 `li r5, 0` -> `cmpwi r3, -0x6a`.
|
||||
- `DeleteDownloadTask`: use early returns with the existing cleanup at each exit. reverted; changed ('.data', 0), ('.text', 0), rel('.text', 0), symbols.
|
||||
- DeleteDownloadTask__Q33ipl7utility6ESMiscFv: 154 -> 168 instructions; #23 `b 0xcc` -> `b 0x104`; #43 `ble 0xcc` -> `ble 0x104`; #47 `li r23, -0x1a` -> `crclr cr1eq`.
|
||||
- `ESMisc::DeleteSavedata`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- DeleteSavedata__Q33ipl7utility6ESMiscFUxPQ23EGG4Heap: 123 -> 140 instructions; #31 `bne 0xa0` -> `bne 0xc4`; #39 `b 0x1ac` -> `cmpwi r29, 0`; #40 `mulli r4, r0, 0x41` -> `beq 0xbc`.
|
||||
- `DeleteTicketsForce`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- DeleteUnauthorizedData__Q33ipl7utility6ESMiscFPQ23EGG4Heap: 449 -> 457 instructions; #25 `b 0x6c4` -> `b 0x6e4`; #44 `b 0x6c4` -> `b 0x6e4`; #56 `b 0x6c4` -> `b 0x6e4`.
|
||||
- `InitSavedata`: use early returns with the existing cleanup at each exit. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- DeleteUnauthorizedData__Q33ipl7utility6ESMiscFPQ23EGG4Heap: 449 -> 465 instructions; #18 `beq 0x68` -> `beq 0x88`; #25 `b 0x6c4` -> `cmpwi r28, 0`; #26 `lwz r0, 0x24(r1)` -> `beq 0x724`.
|
||||
- `NandSDWorker::get_nand_save_perms`: classify permissions with a single guarded if/else chain. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::clean_duplicated_nand_app`: return the known corruption result directly, preserving the final result assignment. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- clean_duplicated_nand_app__Q23ipl12NandSDWorkerFPUxUl: 130 -> 134 instructions; #16 `b 0x1e4` -> `b 0x1f4`; #24 `beq 0x1dc` -> `beq 0x1ec`; #30 `beq 0x1dc` -> `beq 0x1ec`.
|
||||
- `NandSDWorker::clean_partial_nand_app`: return the known corruption result directly, preserving the final result assignment. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- clean_partial_nand_app__Q23ipl12NandSDWorkerFPUxUlPUl: 100 -> 102 instructions; #19 `b 0x16c` -> `b 0x174`; #24 `b 0x178` -> `b 0x180`; #30 `beq 0x164` -> `beq 0x16c`.
|
||||
- `TMDFile::Backup`: use early returns with the existing backup-buffer cleanup. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- Backup__Q33ipl7utility7TMDFileFUx: 173 -> 203 instructions; #6 `lis r30, 0` -> `lis r28, 0`; #7 `mr r31, r3` -> `mr r29, r3`; #8 `mr r26, r5` -> `mr r31, r5`.
|
||||
- `TMDFile::Restore`: use early returns with the existing backup-buffer cleanup. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- Restore__Q33ipl7utility7TMDFileFUx: 134 -> 145 instructions; #18 `b 0x200` -> `b 0x22c`; #26 `beq 0x1dc` -> `beq 0x208`; #28 `beq 0x90` -> `beq 0x94`.
|
||||
- `NandSDWorker::delete_nand_disk_app_with_ticket`: structure the remaining outer error checks while sharing the final cleanup. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_sd_wad_header`: structure the remaining outer error checks while sharing the final cleanup. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::DeleteSavedata`: structure the remaining outer error checks while sharing the final cleanup. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `DeleteTicketsForce`: structure the remaining outer error checks while sharing the final cleanup. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `InitSavedata`: structure the remaining outer error checks while sharing the final cleanup. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::NumPrivateContents`: structure the remaining outer error checks while sharing the final cleanup. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::GetValidTicketIndex`: structure the remaining outer error checks while sharing the final cleanup. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_startup`: structure the final error check inside the existing operation branch. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `TMDFile::Backup`: structure the final error check inside the existing operation branch. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `TMDFile::Restore`: structure the final error check inside the existing operation branch. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `verifySavedataZD`: put verification and save deletion in the successful-read branch. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `verifySavedataZD`: use loop breaks and validate completion before the second verification pass. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- DeleteUnauthorizedData__Q33ipl7utility6ESMiscFPQ23EGG4Heap: 449 -> 453 instructions; #8 `li r28, 0` -> `li r18, 0`; #9 `lis r21, 0` -> `lis r28, 0`; #10 `stw r28, 0x24(r1)` -> `stw r18, 0x24(r1)`.
|
||||
- `NandSDWorker::delete_download_task`: break on timeout and use the existing result to guard the library operations. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- delete_download_task__Q23ipl12NandSDWorkerFUl: 133 -> 135 instructions; #47 `b 0x1cc` -> `b 0xd0`; #52 `li r0, 0` -> `cmpwi r27, 0`; #53 `addi r3, r1, 8` -> `bne 0x1d4`.
|
||||
- `DeleteDownloadTask`: break on timeout and guard the library operations with the result. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- DeleteDownloadTask__Q33ipl7utility6ESMiscFv: 154 -> 156 instructions; #7 `mr r27, r4` -> `mr r26, r4`; #8 `mr r26, r3` -> `mr r25, r3`; #15 `mr r28, r3` -> `mr r27, r3`.
|
||||
- `NandSDWorker::clean_partial_nand_app`: break on corruption and preserve the operation result at the shared return. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- clean_partial_nand_app__Q23ipl12NandSDWorkerFPUxUlPUl: 100 -> 105 instructions; #0 `stwu r1, -0x30(r1)` -> `stwu r1, -0x40(r1)`; #2 `stw r0, 0x34(r1)` -> `stw r0, 0x44(r1)`; #3 `addi r11, r1, 0x30` -> `addi r11, r1, 0x40`.
|
||||
- `NandSDWorker::clean_duplicated_nand_app`: use the result to stop both title loops after corruption. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- clean_duplicated_nand_app__Q23ipl12NandSDWorkerFPUxUl: 130 -> 138 instructions; #6 `mr r19, r3` -> `mr r18, r3`; #8 `mr r20, r4` -> `mr r19, r4`; #9 `mr r21, r5` -> `mr r20, r5`.
|
||||
- `NandSDWorker::do_list_nand_apps_usage`: break on usage failure and report success only after successful iteration. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- do_list_nand_apps_usage__Q23ipl12NandSDWorkerFv: 114 -> 118 instructions; #10 `mr r27, r3` -> `mr r26, r3`; #20 `lwz r3, 0(r27)` -> `lwz r3, 0(r26)`; #30 `lwz r3, 0(r27)` -> `lwz r3, 0(r26)`.
|
||||
- `NandSDWorker::recursion_nand`: use a traversal failure flag and ordinary loop and switch breaks. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- recursion_nand__Q23ipl12NandSDWorkerFPCcPCcQ33ipl12NandSDWorker16RecursiveProcessPPCcUl: 318 -> 329 instructions; #5 `li r31, 0` -> `li r27, 0`; #6 `lis r30, 0` -> `lis r26, 0`; #7 `stw r31, 0x10(r1)` -> `stw r27, 0x10(r1)`.
|
||||
- `NandSDWorker::get_save_banner_for_data_only_title`: use one if/else chain for adjacent error outcomes and the successful operation. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_check_for_sd_app_to_nand`: use one if/else chain for adjacent error outcomes and the successful operation. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_copy_nand_save_to_sd`: use one if/else chain for adjacent error outcomes and the successful operation. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_copy_sd_save_to_nand`: use one if/else chain for adjacent error outcomes and the successful operation. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::do_copy_sd_app_to_nand`: use one if/else chain for adjacent error outcomes and the successful operation. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::open_nand_app_content`: use one if/else chain for adjacent error outcomes and the successful operation. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- open_nand_app_content__Q23ipl12NandSDWorkerFUxUsPUlPP12ESTicketView: 135 -> 133 instructions; #20 `bne 0x1b8` -> `bne 0x1b0`; #33 `b 0x1b8` -> `b 0x1b0`; #40 `beq 0xc0` -> `beq 0xb8`.
|
||||
- `NandSDWorker::open_nand_app_content`: structure ticket query failure, zero tickets, and content opening as one error chain. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_sd_save_banner`: structure the preceding validation before the successful final checks. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_sd_app_banner`: structure the preceding validation before the successful final checks. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_sd_app_thumbnail`: structure the preceding validation before the successful final checks. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::check_sd_title_restorable`: structure the preceding validation before the successful final checks. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::nand_app_exist_ex`: structure the preceding validation before the successful final checks. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::GetValidTicketIndex`: write the library initialization success test directly. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `ESMisc::GetValidTicketIndex`: return through the existing error cleanup after either content-close failure. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- GetValidTicketIndex__Q33ipl7utility6ESMiscFPQ23EGG4HeapUxP12ESTicketViewUl: 183 -> 235 instructions; #30 `b 0x2c4` -> `b 0x394`; #42 `blt 0x25c` -> `blt 0x32c`; #48 `blt 0x25c` -> `blt 0x32c`.
|
||||
- `ESMisc::GetValidTicketIndex`: share one error jump after both content-close outcomes. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- GetValidTicketIndex__Q33ipl7utility6ESMiscFPQ23EGG4HeapUxP12ESTicketViewUl: 183 -> 185 instructions; #30 `b 0x2c4` -> `b 0x2cc`; #42 `blt 0x25c` -> `blt 0x264`; #48 `blt 0x25c` -> `blt 0x264`.
|
||||
- `verifySavedataZD`: keep validation status in the existing flag and stop each verification loop with break. reverted; changed ('.text', 0), rel('.text', 0), symbols.
|
||||
- DeleteUnauthorizedData__Q33ipl7utility6ESMiscFPQ23EGG4Heap: 449 -> 454 instructions; #25 `b 0x6c4` -> `b 0x6d8`; #44 `b 0x6c4` -> `b 0x6d8`; #56 `b 0x6c4` -> `b 0x6d8`.
|
||||
- `NandSDWorker::check_sd_title_restorable`: guard device verification with the successful WAD-header result. kept; all allocated sections, relocations, and named symbols unchanged.
|
||||
- `NandSDWorker::get_nand_save_banner`: return after closing the file and restoring the UID on each banner error. reverted; changed ('.data', 0), ('.text', 0), rel('.text', 0), symbols.
|
||||
- get_app_banner_from_meta__Q23ipl12NandSDWorkerFUxPQ33ipl12NandSDWorker15SDAppBackupData: 288 -> 288 instructions; #253 `addi r3, r30, 0xa48` -> `addi r3, r30, 0x9c2`.
|
||||
- get_nand_save_banner__Q23ipl12NandSDWorkerFUxP17WIISaveBannerFilePUl: 236 -> 383 instructions; #0 `stwu r1, -0x100(r1)` -> `stwu r1, -0x110(r1)`; #2 `stw r0, 0x104(r1)` -> `stw r0, 0x114(r1)`; #3 `addi r11, r1, 0x100` -> `addi r11, r1, 0x110`.
|
||||
|
||||
### Round-b results by function
|
||||
|
||||
Every function containing a goto was reviewed. The 197 NandSDWorker jumps all went to a single cleanup or return label per function; there was no remaining state-machine dispatch to replace with a switch. ESMisc had the same pattern plus two jumps out of Zelda verification loops. Keep the remaining ordinary resource/error exits after the structured changes below.
|
||||
|
||||
#### iplNandSDWorker
|
||||
|
||||
| Function | Gotos before -> after | Kept structure or measured reason for retention |
|
||||
|---|---:|---|
|
||||
| `NandSDWorker::do_startup` | 14 -> 12 | Early cleanup returns change block layout/allocation, 323 -> 480 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::clean_duplicated_nand_app` | 2 -> 2 | Constant early returns add 4 instructions. Result-controlled loops add 8 and change saved-register allocation. |
|
||||
| `NandSDWorker::clean_partial_nand_app` | 1 -> 1 | Constant early return adds 2 instructions. Result-driven break adds 5 and grows the stack frame from 0x30 to 0x40. |
|
||||
| `NandSDWorker::get_nand_save_banner` | 9 -> 8 | Early cleanup returns reorder error-report literals and change text/data; shared error cleanup stays. |
|
||||
| `NandSDWorker::do_check_for_sd_app_to_nand` | 11 -> 8 | Early cleanup returns change block layout/allocation, 242 -> 292 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::check_backup_fits` | 10 -> 9 | Early cleanup returns change block layout/allocation, 246 -> 291 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::do_list_nand_apps_usage` | 1 -> 1 | Early cleanup return grows 114 -> 119 instructions. Break plus final status check grows 114 -> 118 and changes allocation. |
|
||||
| `NandSDWorker::delete_nand_disk_app_with_ticket` | 2 -> 0 | Structured checks and one final cleanup/return preserve every byte. |
|
||||
| `NandSDWorker::delete_nand_titles` | 5 -> 4 | Early cleanup returns change block layout/allocation, 146 -> 168 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::do_copy_nand_save_to_sd` | 19 -> 16 | Early cleanup returns reorder error-report literals and change text/data; shared error cleanup stays. |
|
||||
| `NandSDWorker::do_copy_sd_save_to_nand` | 27 -> 24 | Early cleanup returns reorder error-report literals and change text/data; shared error cleanup stays. |
|
||||
| `NandSDWorker::get_sd_save_banner` | 5 -> 3 | Early cleanup returns change block layout/allocation, 142 -> 166 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::get_sd_wad_header` | 4 -> 0 | Structured checks and one final cleanup/return preserve every byte. |
|
||||
| `NandSDWorker::delete_download_task` | 1 -> 1 | Timeout break plus result guard adds one `cmpwi` and one `bne`, 133 -> 135 instructions. Direct returns duplicate cleanup and alter literal order. |
|
||||
| `NandSDWorker::do_copy_nand_app_to_sd` | 11 -> 10 | Early cleanup returns change block layout/allocation, 332 -> 481 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::get_save_banner_for_data_only_title` | 4 -> 1 | Early cleanup returns change block layout/allocation, 88 -> 115 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::get_app_banner_from_meta` | 12 -> 11 | Early cleanup returns reorder error-report literals and change text/data; shared error cleanup stays. |
|
||||
| `NandSDWorker::open_nand_app_content` | 5 -> 2 | Early cleanup returns change block layout/allocation, 135 -> 203 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::do_copy_sd_app_to_nand` | 11 -> 8 | Early cleanup returns change block layout/allocation, 300 -> 370 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::get_sd_app_banner` | 6 -> 4 | Early cleanup returns change block layout/allocation, 157 -> 187 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::get_sd_app_thumbnail` | 7 -> 5 | Early cleanup returns change block layout/allocation, 172 -> 236 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::nand_app_exist_ex` | 8 -> 6 | Early cleanup returns change block layout/allocation, 226 -> 274 instructions; shared error cleanup stays. |
|
||||
| `NandSDWorker::recursion_nand` | 9 -> 9 | Early cleanup returns grow 318 -> 479 instructions. Failure-controlled loop/switch breaks grow 318 -> 329, with three extra comparisons and new failure branches. |
|
||||
| `NandSDWorker::get_nand_save_perms` | 7 -> 0 | Structured checks and one final cleanup/return preserve every byte. |
|
||||
| `NandSDWorker::check_sd_title_restorable` | 6 -> 4 | Early cleanup returns change block layout/allocation, 97 -> 130 instructions; shared error cleanup stays. |
|
||||
|
||||
#### iplESMisc
|
||||
|
||||
| Function | Gotos before -> after | Kept structure or measured reason for retention |
|
||||
|---|---:|---|
|
||||
| `ESMisc::GetTmdView` | 1 -> 0 | Structured checks and one final cleanup/return preserve every byte. |
|
||||
| `ESMisc::GetValidTicketIndex` | 4 -> 2 | Library/index checks are structured. Direct error returns grow 183 -> 235; merging the two close-error jumps grows 183 -> 185 with two extra register moves. |
|
||||
| `ESMisc::DeleteSharedContent` | 11 -> 10 | Early cleanup returns change block layout/allocation, 261 -> 477 instructions; shared error cleanup stays. |
|
||||
| `ESMisc::NumPrivateContents` | 4 -> 0 | Structured checks and one final cleanup/return preserve every byte. |
|
||||
| `DeleteDownloadTask` | 1 -> 1 | Timeout break plus result guard grows 154 -> 156 instructions and changes register allocation. Direct returns duplicate cleanup and alter literal order. |
|
||||
| `ESMisc::DeleteSavedata` | 3 -> 0 | Structured checks and one final cleanup/return preserve every byte. |
|
||||
| `verifySavedataZD` | 3 -> 2 | Successful-read branch removes the cleanup jump. Loop-index and validation-flag break forms add 4 and 5 instructions to `DeleteUnauthorizedData`, including completion tests and different failure branches. |
|
||||
| `DeleteTicketsForce` | 2 -> 0 | Structured checks and one final cleanup/return preserve every byte. |
|
||||
| `InitSavedata` | 3 -> 0 | Structured checks and one final cleanup/return preserve every byte. |
|
||||
| `TMDFile::Backup` | 7 -> 6 | Early cleanup returns change block layout/allocation, 173 -> 203 instructions; shared error cleanup stays. |
|
||||
| `TMDFile::Restore` | 4 -> 3 | Early cleanup returns change block layout/allocation, 134 -> 145 instructions; shared error cleanup stays. |
|
||||
|
||||
### Scope and comparison notes
|
||||
|
||||
- NandSDWorker: 197 -> 149 gotos, 48 removed. ESMisc: 43 -> 24 gotos, 19 removed. No new goto, carrier flag, helper, compiler pragma, inline assembly, or volatile access was kept.
|
||||
- Rejected candidates include register allocation changes, extra exit tests/branches, duplicated cleanup blocks, and reordered error-report literals. The detailed trial entries above give function sizes and the first changed instructions. Zelda validation retains its one-line compiler explanation.
|
||||
- The first ticket-query chain trial used two independent checks after deleting jumps. It changed the failure flow and was reverted. Discard that trial as compiler evidence; the corrected explicit else-if trial preserved every allocated byte and was kept.
|
||||
- Formatting was limited to changed functions. Removed unreferenced labels and blank lines left by rewritten guards. Reviewed both focused source diffs; no unrelated edit was kept.
|
||||
- After formatting, both rebuilt objects have identical allocated sections, relocation destinations, and named symbols versus the fresh round-b baseline. Only compiler-generated anonymous literal/`__FUNCTION__` symbol numbers are normalized, with offsets/sizes/bytes checked.
|
||||
- Section-aware comparison against retail: NandSDWorker 203/203 and ESMisc 31/31 instruction-exact functions, zero raw-byte differences. Pools remain 280/280 and 114/114 identical strings.
|
||||
|
||||
### Round-b final validation
|
||||
|
||||
- Required gate ran once after all source changes: `python3 /mnt/drive2/projects/wii-ipl-workers/_restore0928-tools/gate.py src/system/iplNandSDWorker src/utility/iplESMisc --quick`.
|
||||
- `GATE PASS`: full 43U build passed; 0 regressions; 0 forbidden-pattern additions; 0 readability warnings. Gate output: `/tmp/cleanup2-w2b-gate.log`.
|
||||
- NandSDWorker: 203/203 functions; 51428/51428 code bytes; 12312/12312 data bytes. ESMisc: 31/31 functions; 11200/11200 code bytes; 4416/4416 data bytes. Both units, code/data/link metrics, and every reported section remain 100%.
|
||||
- Regenerated live report, `ninja build/43U/ok`, and `check_decomp_complete.py` passed with `DECOMPLETE_OK`. DOL SHA1 remains `26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
- Rechecked all original functions with the section-aware decoder: 203/203 and 31/31, identical instruction counts, zero instruction differences, and zero raw-byte differences. This independently resolves the gate's known `.text` reader bug, which still prints 7/203 for the two-text-section NandSDWorker object.
|
||||
- The additional strict assembly inventory check reports three existing placeholders: `TMCJPEGDEC_err_restart`, `CNTCACHEClear`, and `System::warning_run`. Their three source files are byte-identical to baseline `8e47db4a` and outside this assignment. This is a baseline inventory failure; this cleanup introduces no assembly changes.
|
||||
- Final scope is the two assigned source files and this attempts log. No push, PR, merge, rebase, other-worktree edit, or subagent.
|
||||
|
||||
### Round-b source commits
|
||||
|
||||
- `ecfc73c9e`: NandSDWorker structured error paths only.
|
||||
- `866b01d3e`: ESMisc structured error paths only.
|
||||
|
||||
Reference in New Issue
Block a user