Compare commits

...

1 Commits

8 changed files with 1309 additions and 2601 deletions

View File

@@ -34,7 +34,11 @@ void CDBConvTypeStrToFullPath(char* fullPath, char* yearStr, char* monthStr, cha
void CDBConvFileNameStrToFullPath(char* fullPath, char* yearStr, char* monthStr, char* dayStr, char* hourStr, char* minuteStr, char* codeStr,
char* typeStr, char* fileStr, CDBLocation location, u64* wiiId);
#ifdef CDB_DATABASE_IMPLEMENTATION
CDBDate CDBConvDirStrToCDBDate(char* yearStr, char* monthStr, char* dayStr, char* hourStr, char* minuteStr);
#else
CDBDate CDBConvDirStrToCDBDate(char* yearStr, char* monthStr, char* dayStr, char* hourStr, char* minuteStr, CDBLocation location, u64* wiiId);
#endif
void CDBConvGCStrToGCValue(char* gcStr, u32* gcValue);
void CDBConvGCValueToGCStr(u32 gcValue, char* gcStr);

View File

@@ -13,12 +13,21 @@ void CDBClampCDBDate(CDBDate* cdbDate);
CDBDate CDBMakeCDBDate(int year, int month, int day, int hour, int min, int sec);
#ifdef CDB_DATABASE_IMPLEMENTATION
CDBDate CDBMakeCDBDateDayBegin(int year, int month, int day);
CDBDate CDBMakeCDBDateDayEnd(int year, int month, int day);
CDBDate CDBMakeCDBDateMonthBegin(int year, int month);
CDBDate CDBMakeCDBDateMonthEnd(int year, int month);
CDBDate CDBMakeCDBDateYearBegin(int year);
CDBDate CDBMakeCDBDateYearEnd(int year);
#else
CDBDate CDBMakeCDBDateDayBegin(int year, int month, int day, int hour, int min, int sec);
CDBDate CDBMakeCDBDateDayEnd(int year, int month, int day, int hour, int min, int sec);
CDBDate CDBMakeCDBDateMonthBegin(int year, int month, int day, int hour, int min, int sec);
CDBDate CDBMakeCDBDateMonthEnd(int year, int month, int day, int hour, int min, int sec);
CDBDate CDBMakeCDBDateYearBegin(int year, int month, int day, int hour, int min, int sec);
CDBDate CDBMakeCDBDateYearEnd(int year, int month, int day, int hour, int min, int sec);
#endif
#ifdef __cplusplus
}

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,8 @@
#include <revolution/nwc24.h>
#include <revolution/os.h>
#include <revolution/sc.h>
#include <revolution/ncd.h>
#include <revolution/verdefs.h>
#define MANAGE_ERROR_CODE_BASE 109000
@@ -290,166 +292,104 @@ NWC24Err NWC24GetSchedulerError(s32* numErrors, s32* errorCode) {
return result;
}
#ifdef __MWERKS__
extern void _savegpr_27();
extern void _restgpr_27();
extern void NCDiGetEnabledConfigList();
extern NWC24Err AnalyzeScdErrors(s32* errorCode, u32 usage);
extern void NWC24iMBoxCheck();
extern void SCCheckStatus();
extern void SCGetWCFlags();
extern void SCGetEULA();
extern void SCGetNetContentRestrictions();
extern void SCGetParentalControl();
extern NCDErr NCDiGetEnabledConfigList(u32* wiredList, u32* wirelessList, u32* aossList);
extern NWC24Err NWC24iMBoxCheck(NWC24MBoxType type, u32 size);
NWC24Err AnalyzeScdErrors(s32* errorCode, u32 usage);
asm NWC24Err NWC24Check(register u32 usage) {
nofralloc
NWC24Err NWC24Check(u32 usage) {
NWC24Err result;
NWC24Err err;
SCParentalControlsInfo pcInfo;
u32 wiredList;
u32 wirelessList;
u32 aossList;
NWC24IdCreationStage stage;
s32 errorCode;
u32 status;
u32 wcFlags;
BOOL eula;
u32 restrictions;
stwu r1, -0x80(r1)
mflr r0
stw r0, 0x84(r1)
addi r11, r1, 0x80
bl _savegpr_27
lwz r0, Opened(r0)
li r4, 0
stw r4, GlobalErrorCode(r0)
mr r27, r3
cmpwi r0, 1
beq _NWC24Check_open
li r31, -9
b _NWC24Check_return
GlobalErrorCode = 0;
_NWC24Check_open:
li r31, -0x27
if (Opened != NWC24_LIB_OPENED) {
result = NWC24_ERR_LIB_NOT_OPENED;
} else {
result = NWC24_ERR_DISABLED;
_NWC24Check_status:
bl SCCheckStatus
cmplwi r3, 1
beq _NWC24Check_status
cmplwi r3, 2
bne _NWC24Check_status_ok
lis r3, -2
addi r0, r3, 0x55c8
stw r0, GlobalErrorCode(r0)
b _NWC24Check_return
do {
do {
status = SCCheckStatus();
} while (status == SC_STATUS_BUSY);
_NWC24Check_status_ok:
bl SCGetWCFlags
clrlwi r29, r3, 0x1f
bl SCGetEULA
mr r30, r3
bl SCGetNetContentRestrictions
rlwinm r28, r3, 0, 0x1e, 0x1e
addi r3, r1, 0x1c
bl SCGetParentalControl
cmpwi r29, 0
bne _NWC24Check_eula
lis r3, -2
addi r0, r3, 0x55ad
stw r0, GlobalErrorCode(r0)
b _NWC24Check_return
if (status == SC_STATUS_FATAL) {
GlobalErrorCode = -109112;
break;
}
_NWC24Check_eula:
cmpwi r30, 0
bne _NWC24Check_restrictions
lis r3, -2
addi r0, r3, 0x55cd
stw r0, GlobalErrorCode(r0)
b _NWC24Check_return
wcFlags = SCGetWCFlags() & SC_WC_FLAGS_ENABLED;
eula = SCGetEULA();
restrictions =
SCGetNetContentRestrictions() & SC_NET_RESTRICTIONS_MSG_BOARD;
SCGetParentalControl(&pcInfo);
_NWC24Check_restrictions:
clrlwi. r30, r27, 0x1f
beq _NWC24Check_config
lbz r0, 0x1c(r1)
rlwinm. r0, r0, 0, 0x18, 0x18
beq _NWC24Check_config
cmpwi r28, 0
beq _NWC24Check_config
lis r3, -2
addi r0, r3, 0x55cd
stw r0, GlobalErrorCode(r0)
b _NWC24Check_return
if (!wcFlags) {
GlobalErrorCode = -109139;
break;
}
_NWC24Check_config:
addi r3, r1, 0x18
addi r4, r1, 0x14
addi r5, r1, 0x10
li r31, -0x1f
bl NCDiGetEnabledConfigList
cmpwi r3, 0
bge _NWC24Check_config_ok
lis r3, -2
addi r0, r3, 0x55b3
stw r0, GlobalErrorCode(r0)
b _NWC24Check_return
if (!eula) {
GlobalErrorCode = -109107;
break;
}
_NWC24Check_config_ok:
lwz r0, 0x18(r1)
cmpwi r0, 0
bne _NWC24Check_id
lwz r0, 0x14(r1)
cmpwi r0, 0
bne _NWC24Check_id
lwz r0, 0x10(r1)
cmpwi r0, 0
bne _NWC24Check_id
lis r3, -1
addi r0, r3, 0x3b85
stw r0, GlobalErrorCode(r0)
b _NWC24Check_return
if ((usage & 1) && (pcInfo.enable & SC_PARENTAL_FLAG_ENABLED) &&
restrictions) {
GlobalErrorCode = -109107;
break;
}
_NWC24Check_id:
cmpwi r30, 0
beq _NWC24Check_scheduler
addi r3, r1, 0xc
bl NWC24GetIdCreationStage
lwz r0, 0xc(r1)
cmpwi r0, 2
beq _NWC24Check_scheduler
lis r3, -2
addi r0, r3, 0x55a8
stw r0, GlobalErrorCode(r0)
b _NWC24Check_return
result = NWC24_ERR_NETWORK;
if (NCDiGetEnabledConfigList(&wiredList, &wirelessList,
&aossList) < 0) {
GlobalErrorCode = -109133;
break;
}
_NWC24Check_scheduler:
li r0, 0
mr r4, r27
stw r0, 8(r1)
addi r3, r1, 8
bl AnalyzeScdErrors
cmpwi r3, 0
bge _NWC24Check_mbox
lwz r0, 8(r1)
mr r31, r3
stw r0, GlobalErrorCode(r0)
b _NWC24Check_return
if (wiredList == 0 && wirelessList == 0 && aossList == 0) {
GlobalErrorCode = -50299;
break;
}
_NWC24Check_mbox:
li r3, 0
li r4, 0
bl NWC24iMBoxCheck
cmpwi r3, -6
mr r31, r3
bne _NWC24Check_mbox_done
lis r4, -2
addi r0, r4, 0x55ce
stw r0, GlobalErrorCode(r0)
if (usage & 1) {
NWC24GetIdCreationStage(&stage);
if (stage != NWC24_IDCS_REGISTERED) {
GlobalErrorCode = -109144;
break;
}
}
_NWC24Check_mbox_done:
cmpwi r3, -6
beq _NWC24Check_return
li r31, 0
errorCode = 0;
err = AnalyzeScdErrors(&errorCode, usage);
if (err < 0) {
result = err;
GlobalErrorCode = errorCode;
break;
}
_NWC24Check_return:
addi r11, r1, 0x80
mr r3, r31
bl _restgpr_27
lwz r0, 0x84(r1)
mtlr r0
addi r1, r1, 0x80
blr
result = NWC24iMBoxCheck(NWC24_MBOX_TYPE_SEND, 0);
if (result == NWC24_ERR_FULL) {
GlobalErrorCode = -109106;
}
if (result != NWC24_ERR_FULL) {
result = NWC24_OK;
}
} while (0);
}
return result;
}
#endif
s32 NWC24GetErrorCode() {
return GlobalErrorCode;

View File

@@ -8,74 +8,35 @@ extern void __shr2u(void);
extern void __shl2i(void);
static NWC24UserId getUnScrambleId(NWC24UserId id);
asm NWC24Err NWC24CheckUserId(register NWC24UserId id) {
stwu r1,-0x30(r1)
mfspr r0,LR
stw r0,0x34(r1)
addi r11,r1,0x30
bl _savegpr_27
or r28,r3,r3
or r27,r4,r4
addi r3,r1,0x8
bl NWC24GetMyUserId
lwz r3,0x8(r1)
lwz r4,0xc(r1)
xor r0,r3,r28
xor r5,r4,r27
or. r0,r5,r0
bne NWC24CheckUserId_not_same
li r3,-0x23
b NWC24CheckUserId_return
NWC24CheckUserId_not_same:
bl getUnScrambleId
or r4,r27,r27
rlwinm r27,r3,0x11,0x1d,0x1f
or r3,r28,r28
bl getUnScrambleId
or r30,r4,r4
or r31,r3,r3
rlwinm r28,r3,0x11,0x1d,0x1f
li r29,0
NWC24CheckUserId_crc_loop:
addi r0,r29,1
or r3,r31,r31
or r4,r30,r30
subfic r5,r0,0x35
bl __shr2u
rlwinm. r0,r4,0,0x1f,0x1f
beq NWC24CheckUserId_crc_next
subfic r5,r29,0x2a
li r4,0x635
li r3,0
bl __shl2i
xor r30,r30,r4
xor r31,r31,r3
NWC24CheckUserId_crc_next:
addi r29,r29,1
cmpwi r29,0x2b
blt NWC24CheckUserId_crc_loop
or. r0,r30,r31
beq NWC24CheckUserId_crc_ok
li r3,-0x25
b NWC24CheckUserId_return
NWC24CheckUserId_crc_ok:
cmpwi r27,0
bne NWC24CheckUserId_return_ok
cmpwi r28,0
beq NWC24CheckUserId_return_ok
li r3,-0x7
b NWC24CheckUserId_return
NWC24CheckUserId_return_ok:
li r3,0
NWC24CheckUserId_return:
addi r11,r1,0x30
bl _restgpr_27
lwz r0,0x34(r1)
mtspr LR,r0
addi r1,r1,0x30
blr
NWC24Err NWC24CheckUserId(NWC24UserId id) {
NWC24UserId myId;
u64 value;
int i;
u32 area;
u32 myArea;
NWC24GetMyUserId(&myId);
if (myId == id) {
return NWC24_ERR_ID_GENERATED;
}
myArea = (getUnScrambleId(myId) >> 47) & 7;
value = getUnScrambleId(id);
area = (value >> 47) & 7;
for (i = 0; i < 0x2B; i++) {
if ((value >> (0x35 - (i + 1))) & 1) {
value ^= (u64)0x635 << (0x2A - i);
}
}
if (value != 0) {
return NWC24_ERR_ID_CRC;
}
if (myArea == 0 && area != 0) {
return NWC24_ERR_PROTECTED;
}
return NWC24_OK;
}
NWC24Err NWC24iCheckUserIdCRC(NWC24UserId id) {
u64 value = getUnScrambleId(id);
int i;

View File

@@ -414,503 +414,27 @@ s32 VFi_NandFlushNANDFromHandleIdx(s32 i_handleIdx, BOOL i_setLastDeviceError) {
return NAND_RESULT_OK;
}
#ifdef __MWERKS__
extern void _savegpr_23();
extern void _restgpr_23();
static asm s32 _MountPrfFile(register PDM_DISK* p_disk, register char* i_fullpath_p) {
nofralloc
clrlwi r11, r1, 26
mr r12, r1
subfic r11, r11, -0xc0
stwux r1, r1, r11
mflr r0
mr r11, r12
stw r0, 0x4(r12)
bl _savegpr_23
mr r26, r3
mr r27, r4
bl VFSysPDMDisk2DriveP
mr r23, r3
mr r3, r26
bl dCommon_getHandleIdxFromDisk
cmpwi r23, 0x0
mr r31, r3
bne _MountPrfFile_L_814D7C0C
li r3, -0x14
b _MountPrfFile_L_814D824C
_MountPrfFile_L_814D7C0C:
cmplwi r3, 0x1a
lwz r28, 0x0(r23)
bge _MountPrfFile_L_814D7CD8
lis r4, l_nandFunc@ha
slwi r0, r3, 4
addi r4, r4, l_nandFunc@l
add r3, r4, r0
lwz r12, 0x4(r3)
cmpwi r12, 0x0
beq _MountPrfFile_L_814D7C50
mr r3, r27
mr r4, r28
li r5, 0x1
mtctr r12
bctrl
mr r29, r3
b _MountPrfFile_L_814D7DF0
_MountPrfFile_L_814D7C50:
lis r3, 0x1062
lwz r30, VF_nand_retry_max(r0)
addi r25, r3, 0x4dd3
li r29, 0x0
lis r24, 0x8000
li r23, 0x0
b _MountPrfFile_L_814D7CC8
_MountPrfFile_L_814D7C6C:
mr r3, r27
mr r4, r28
li r5, 0x1
bl NANDOpen
cmpwi r3, -0x3
mr r29, r3
beq _MountPrfFile_L_814D7C94
cmpwi r3, -0x2
beq _MountPrfFile_L_814D7C94
b _MountPrfFile_L_814D7DF0
_MountPrfFile_L_814D7C94:
lwz r0, 0xf8(r24)
lwz r6, VF_nand_sleep_msec(r0)
srwi r0, r0, 2
mulhwu r3, r25, r0
srawi r0, r6, 31
mullw r4, r23, r6
srwi r5, r3, 6
mulhwu r3, r5, r6
mullw r0, r5, r0
add r3, r3, r4
mullw r4, r5, r6
add r3, r3, r0
bl OSSleepTicks
_MountPrfFile_L_814D7CC8:
cmpwi r30, 0x0
subi r30, r30, 0x1
bgt _MountPrfFile_L_814D7C6C
b _MountPrfFile_L_814D7DF0
_MountPrfFile_L_814D7CD8:
addis r0, r3, 0x1
cmplwi r0, 0xfff6
bne _MountPrfFile_L_814D7D6C
lis r3, 0x1062
lwz r30, VF_nand_retry_max(r0)
addi r25, r3, 0x4dd3
li r29, 0x0
lis r24, 0x8000
li r23, 0x0
b _MountPrfFile_L_814D7D5C
_MountPrfFile_L_814D7D00:
mr r3, r27
mr r4, r28
li r5, 0x1
bl NANDOpen
cmpwi r3, -0x3
mr r29, r3
beq _MountPrfFile_L_814D7D28
cmpwi r3, -0x2
beq _MountPrfFile_L_814D7D28
b _MountPrfFile_L_814D7DF0
_MountPrfFile_L_814D7D28:
lwz r0, 0xf8(r24)
lwz r6, VF_nand_sleep_msec(r0)
srwi r0, r0, 2
mulhwu r3, r25, r0
srawi r0, r6, 31
mullw r4, r23, r6
srwi r5, r3, 6
mulhwu r3, r5, r6
mullw r0, r5, r0
add r3, r3, r4
mullw r4, r5, r6
add r3, r3, r0
bl OSSleepTicks
_MountPrfFile_L_814D7D5C:
cmpwi r30, 0x0
subi r30, r30, 0x1
bgt _MountPrfFile_L_814D7D00
b _MountPrfFile_L_814D7DF0
_MountPrfFile_L_814D7D6C:
lis r3, 0x1062
lwz r30, VF_nand_retry_max(r0)
addi r23, r3, 0x4dd3
li r29, 0x0
lis r25, 0x8000
li r24, 0x0
b _MountPrfFile_L_814D7DE4
_MountPrfFile_L_814D7D88:
mr r3, r27
mr r4, r28
li r5, 0x1
bl NANDPrivateOpen
cmpwi r3, -0x3
mr r29, r3
beq _MountPrfFile_L_814D7DB0
cmpwi r3, -0x2
beq _MountPrfFile_L_814D7DB0
b _MountPrfFile_L_814D7DF0
_MountPrfFile_L_814D7DB0:
lwz r0, 0xf8(r25)
lwz r6, VF_nand_sleep_msec(r0)
srwi r0, r0, 2
mulhwu r3, r23, r0
srawi r0, r6, 31
mullw r4, r24, r6
srwi r5, r3, 6
mulhwu r3, r5, r6
mullw r0, r5, r0
add r3, r3, r4
mullw r4, r5, r6
add r3, r3, r0
bl OSSleepTicks
_MountPrfFile_L_814D7DE4:
cmpwi r30, 0x0
subi r30, r30, 0x1
bgt _MountPrfFile_L_814D7D88
_MountPrfFile_L_814D7DF0:
cmpwi r29, 0x0
bne _MountPrfFile_L_814D8038
addi r3, r1, 0x40
li r4, 0x0
li r5, 0x20
bl VFipf_memset
mr r3, r28
addi r4, r1, 0x40
li r5, 0x20
bl A32_NANDRead
cmpwi r3, 0x0
mr r30, r3
bge _MountPrfFile_L_814D7EAC
lis r3, 0x1062
lwz r29, VF_nand_retry_max(r0)
addi r27, r3, 0x4dd3
lis r25, 0x8000
li r24, 0x0
b _MountPrfFile_L_814D7E8C
_MountPrfFile_L_814D7E3C:
mr r3, r28
bl NANDClose
cmpwi r3, -0x3
beq _MountPrfFile_L_814D7E58
cmpwi r3, -0x2
beq _MountPrfFile_L_814D7E58
b _MountPrfFile_L_814D7E98
_MountPrfFile_L_814D7E58:
lwz r0, 0xf8(r25)
lwz r6, VF_nand_sleep_msec(r0)
srwi r0, r0, 2
mulhwu r3, r27, r0
srawi r0, r6, 31
mullw r4, r24, r6
srwi r5, r3, 6
mulhwu r3, r5, r6
mullw r0, r5, r0
add r3, r3, r4
mullw r4, r5, r6
add r3, r3, r0
bl OSSleepTicks
_MountPrfFile_L_814D7E8C:
cmpwi r29, 0x0
subi r29, r29, 0x1
bgt _MountPrfFile_L_814D7E3C
_MountPrfFile_L_814D7E98:
mr r3, r26
mr r4, r30
bl dCommon_setLastDeviceErrorToDisk
mr r3, r30
b _MountPrfFile_L_814D824C
_MountPrfFile_L_814D7EAC:
addi r3, r1, 0x40
bl dCommon_PrintSignature
addi r3, r1, 0x40
bl dCommon_IsPrfFile
cmpwi r3, 0x0
bne _MountPrfFile_L_814D7F40
lis r3, 0x1062
lwz r23, VF_nand_retry_max(r0)
addi r26, r3, 0x4dd3
lis r25, 0x8000
li r24, 0x0
b _MountPrfFile_L_814D7F2C
_MountPrfFile_L_814D7EDC:
mr r3, r28
bl NANDClose
cmpwi r3, -0x3
beq _MountPrfFile_L_814D7EF8
cmpwi r3, -0x2
beq _MountPrfFile_L_814D7EF8
b _MountPrfFile_L_814D7F38
_MountPrfFile_L_814D7EF8:
lwz r0, 0xf8(r25)
lwz r6, VF_nand_sleep_msec(r0)
srwi r0, r0, 2
mulhwu r3, r26, r0
srawi r0, r6, 31
mullw r4, r24, r6
srwi r5, r3, 6
mulhwu r3, r5, r6
mullw r0, r5, r0
add r3, r3, r4
mullw r4, r5, r6
add r3, r3, r0
bl OSSleepTicks
_MountPrfFile_L_814D7F2C:
cmpwi r23, 0x0
subi r23, r23, 0x1
bgt _MountPrfFile_L_814D7EDC
_MountPrfFile_L_814D7F38:
li r3, -0x1
b _MountPrfFile_L_814D824C
_MountPrfFile_L_814D7F40:
lbz r0, 0x49(r1)
mr r3, r26
lbz r6, 0x4a(r1)
lbz r5, 0x4b(r1)
slwi r0, r0, 16
lbz r4, 0x48(r1)
rlwimi r5, r6, 8, 16, 23
rlwimi r0, r4, 24, 0, 7
or r4, r5, r0
bl dCommon_setFileSizeToDisk
mr r3, r26
bl dCommon_getFileSizeFromDisk
subi r0, r3, 0x1f
li r3, 0x0
srwi r4, r0, 9
li r5, 0x1
li r6, 0x200
bl dCommon_GetNiceFatType
mr r23, r3
mr r3, r26
mr r4, r23
bl dCommon_setFatTypeToDisk
mr r3, r23
bl dCommon_GetReservedSecFromFatType
mr r4, r3
mr r3, r26
bl dCommon_setResvSecNumToDisk
mr r3, r23
bl dCommon_GetRootEntNumFromFatType
mr r4, r3
mr r3, r26
bl dCommon_setRootEntNumToDisk
lis r3, 0x1062
lwz r29, VF_nand_retry_max(r0)
addi r30, r3, 0x4dd3
lis r25, 0x8000
li r24, 0x0
b _MountPrfFile_L_814D8028
_MountPrfFile_L_814D7FD8:
mr r3, r28
bl NANDClose
cmpwi r3, -0x3
beq _MountPrfFile_L_814D7FF4
cmpwi r3, -0x2
beq _MountPrfFile_L_814D7FF4
b _MountPrfFile_L_814D804C
_MountPrfFile_L_814D7FF4:
lwz r0, 0xf8(r25)
lwz r6, VF_nand_sleep_msec(r0)
srwi r0, r0, 2
mulhwu r3, r30, r0
srawi r0, r6, 31
mullw r4, r24, r6
srwi r5, r3, 6
mulhwu r3, r5, r6
mullw r0, r5, r0
add r3, r3, r4
mullw r4, r5, r6
add r3, r3, r0
bl OSSleepTicks
_MountPrfFile_L_814D8028:
cmpwi r29, 0x0
subi r29, r29, 0x1
bgt _MountPrfFile_L_814D7FD8
b _MountPrfFile_L_814D804C
_MountPrfFile_L_814D8038:
mr r3, r26
mr r4, r29
bl dCommon_setLastDeviceErrorToDisk
mr r3, r29
b _MountPrfFile_L_814D824C
_MountPrfFile_L_814D804C:
cmplwi r31, 0x1a
bge _MountPrfFile_L_814D8114
lis r3, l_nandFunc@ha
slwi r0, r31, 4
addi r3, r3, l_nandFunc@l
add r3, r3, r0
lwz r12, 0x4(r3)
cmpwi r12, 0x0
beq _MountPrfFile_L_814D808C
mr r3, r27
mr r4, r28
li r5, 0x3
mtctr r12
bctrl
mr r30, r3
b _MountPrfFile_L_814D822C
_MountPrfFile_L_814D808C:
lis r3, 0x1062
lwz r29, VF_nand_retry_max(r0)
addi r31, r3, 0x4dd3
li r30, 0x0
lis r25, 0x8000
li r24, 0x0
b _MountPrfFile_L_814D8104
_MountPrfFile_L_814D80A8:
mr r3, r27
mr r4, r28
li r5, 0x3
bl NANDOpen
cmpwi r3, -0x3
mr r30, r3
beq _MountPrfFile_L_814D80D0
cmpwi r3, -0x2
beq _MountPrfFile_L_814D80D0
b _MountPrfFile_L_814D822C
_MountPrfFile_L_814D80D0:
lwz r0, 0xf8(r25)
lwz r6, VF_nand_sleep_msec(r0)
srwi r0, r0, 2
mulhwu r3, r31, r0
srawi r0, r6, 31
mullw r4, r24, r6
srwi r5, r3, 6
mulhwu r3, r5, r6
mullw r0, r5, r0
add r3, r3, r4
mullw r4, r5, r6
add r3, r3, r0
bl OSSleepTicks
_MountPrfFile_L_814D8104:
cmpwi r29, 0x0
subi r29, r29, 0x1
bgt _MountPrfFile_L_814D80A8
b _MountPrfFile_L_814D822C
_MountPrfFile_L_814D8114:
addis r0, r31, 0x1
cmplwi r0, 0xfff6
bne _MountPrfFile_L_814D81A8
lis r3, 0x1062
lwz r29, VF_nand_retry_max(r0)
addi r31, r3, 0x4dd3
li r30, 0x0
lis r25, 0x8000
li r24, 0x0
b _MountPrfFile_L_814D8198
_MountPrfFile_L_814D813C:
mr r3, r27
mr r4, r28
li r5, 0x3
bl NANDOpen
cmpwi r3, -0x3
mr r30, r3
beq _MountPrfFile_L_814D8164
cmpwi r3, -0x2
beq _MountPrfFile_L_814D8164
b _MountPrfFile_L_814D822C
_MountPrfFile_L_814D8164:
lwz r0, 0xf8(r25)
lwz r6, VF_nand_sleep_msec(r0)
srwi r0, r0, 2
mulhwu r3, r31, r0
srawi r0, r6, 31
mullw r4, r24, r6
srwi r5, r3, 6
mulhwu r3, r5, r6
mullw r0, r5, r0
add r3, r3, r4
mullw r4, r5, r6
add r3, r3, r0
bl OSSleepTicks
_MountPrfFile_L_814D8198:
cmpwi r29, 0x0
subi r29, r29, 0x1
bgt _MountPrfFile_L_814D813C
b _MountPrfFile_L_814D822C
_MountPrfFile_L_814D81A8:
lis r3, 0x1062
lwz r29, VF_nand_retry_max(r0)
addi r24, r3, 0x4dd3
li r30, 0x0
lis r25, 0x8000
li r31, 0x0
b _MountPrfFile_L_814D8220
_MountPrfFile_L_814D81C4:
mr r3, r27
mr r4, r28
li r5, 0x3
bl NANDPrivateOpen
cmpwi r3, -0x3
mr r30, r3
beq _MountPrfFile_L_814D81EC
cmpwi r3, -0x2
beq _MountPrfFile_L_814D81EC
b _MountPrfFile_L_814D822C
_MountPrfFile_L_814D81EC:
lwz r0, 0xf8(r25)
lwz r6, VF_nand_sleep_msec(r0)
srwi r0, r0, 2
mulhwu r3, r24, r0
srawi r0, r6, 31
mullw r4, r31, r6
srwi r5, r3, 6
mulhwu r3, r5, r6
mullw r0, r5, r0
add r3, r3, r4
mullw r4, r5, r6
add r3, r3, r0
bl OSSleepTicks
_MountPrfFile_L_814D8220:
cmpwi r29, 0x0
subi r29, r29, 0x1
bgt _MountPrfFile_L_814D81C4
_MountPrfFile_L_814D822C:
cmpwi r30, 0x0
bne _MountPrfFile_L_814D823C
li r3, 0x0
b _MountPrfFile_L_814D824C
_MountPrfFile_L_814D823C:
mr r3, r26
mr r4, r30
bl dCommon_setLastDeviceErrorToDisk
mr r3, r30
_MountPrfFile_L_814D824C:
lwz r10, 0x0(r1)
mr r11, r10
bl _restgpr_23
lwz r0, 0x4(r10)
mtlr r0
mr r1, r10
blr
}
#else
static s32 _MountPrfFile(PDM_DISK* p_disk, char* i_fullpath_p) {
PR_BINHEADER header ALIGN64;
VFSys_drive* drive_p = VFSysPDMDisk2DriveP(p_disk);
NANDFileInfo* fileInfo_p = NULL;
s32 nandError = NAND_RESULT_OK;
NANDFileInfo* fileInfo_p;
s32 nandError;
u32 handleIdx = dCommon_getHandleIdxFromDisk(p_disk);
if (drive_p == NULL) {
if (!drive_p) {
return -20;
}
fileInfo_p = drive_p->file_p;
nandError = VFi_NandOpenSp(i_fullpath_p, fileInfo_p, NAND_ACCESS_READ, handleIdx);
if (nandError == 0) {
s32 readResult;
VFipf_memset(&header, 0, 32);
nandError = A32_NANDRead(fileInfo_p, &header, 32);
if (nandError < NAND_RESULT_OK) {
readResult = A32_NANDRead(fileInfo_p, &header, 32);
if (readResult < NAND_RESULT_OK) {
VFi_NandClose(fileInfo_p);
dCommon_setLastDeviceErrorToDisk(p_disk, nandError);
return nandError;
dCommon_setLastDeviceErrorToDisk(p_disk, readResult);
return readResult;
}
dCommon_PrintSignature(&header);
if (!dCommon_IsPrfFile(&header)) {
@@ -923,7 +447,7 @@ static s32 _MountPrfFile(PDM_DISK* p_disk, char* i_fullpath_p) {
u32 fatType;
dCommon_setFileSizeToDisk(p_disk,
((header.fileSize[0] << 24) | (header.fileSize[1] << 16) | (header.fileSize[2] << 8) | (header.fileSize[3])));
((header.fileSize[2] << 8) | header.fileSize[3]) | ((header.fileSize[0] << 24) | (header.fileSize[1] << 16)));
fileSize = dCommon_getFileSizeFromDisk(p_disk);
dataSize = (fileSize - 0x20);
SPU = ((dataSize + 1) >> 9);
@@ -946,7 +470,6 @@ static s32 _MountPrfFile(PDM_DISK* p_disk, char* i_fullpath_p) {
return nandError;
}
}
#endif
static u16 _UnmountPrfFile(PDM_DISK* p_disk) {
VFSys_drive* drive_p = VFSysPDMDisk2DriveP(p_disk);

View File

@@ -40,8 +40,6 @@ const u8 scWpaFindOuiPad4 = 0;
#define scWpaFindOui0 (*((volatile const u8*)&scWpaFindOui0))
#define scWpaFindOui1 (*((volatile const u8*)&scWpaFindOui1))
#define scWpaFindOui2 (*((volatile const u8*)&scWpaFindOui2))
extern void _savegpr_21();
extern void _restgpr_21();
#define WAIT_FOR_OPERATION(...) \
do { \
@@ -310,80 +308,45 @@ BOOL WDFindInformationElement(WDInfoElement** outIE, u32* outIELength, WDBssDesc
return found;
}
asm BOOL WDiFindVendorSpecificIE(WDVendorInfoElement** outIE, u32* outIELength, WDBssDesc* bssDesc, int id, u8* data, u8 mode) {
nofralloc
stwu r1, -0x40(r1)
mflr r0
stw r0, 0x44(r1)
addi r11, r1, 0x40
bl _savegpr_21
cmpwi r5, 0
mr r30, r3
mr r31, r4
mr r21, r6
mr r22, r7
mr r23, r8
li r28, 0
beq WDiFindVendorSpecificIE_done
addi r26, r5, 0x3e
lhz r29, 0x3c(r5)
mr r25, r26
li r27, 0
b WDiFindVendorSpecificIE_loop_check
WDiFindVendorSpecificIE_loop:
lbzx r0, r26, r27
add r25, r26, r27
cmplw r0, r21
bne WDiFindVendorSpecificIE_next
lbz r24, 5(r25)
mr r4, r22
addi r3, r25, 2
li r5, 3
bl memcmp
cmpwi r3, 0
bne WDiFindVendorSpecificIE_next
cmplw r24, r23
beq WDiFindVendorSpecificIE_found
WDiFindVendorSpecificIE_next:
lbz r0, 1(r25)
add r3, r0, r27
addi r27, r3, 2
WDiFindVendorSpecificIE_loop_check:
cmpw r27, r29
blt WDiFindVendorSpecificIE_loop
WDiFindVendorSpecificIE_found:
cmpw r27, r29
bge WDiFindVendorSpecificIE_done
cmpwi r30, 0
beq WDiFindVendorSpecificIE_no_out
addi r0, r25, 6
stw r0, 0(r30)
WDiFindVendorSpecificIE_no_out:
cmpwi r31, 0
beq WDiFindVendorSpecificIE_set_found
lbz r3, 1(r25)
addi r0, r3, -4
stw r0, 0(r31)
WDiFindVendorSpecificIE_set_found:
li r28, 1
WDiFindVendorSpecificIE_done:
cmpwi r28, 0
bne WDiFindVendorSpecificIE_return
cmpwi r30, 0
beq WDiFindVendorSpecificIE_no_out_null
li r0, 0
stw r0, 0(r30)
WDiFindVendorSpecificIE_no_out_null:
cmpwi r31, 0
beq WDiFindVendorSpecificIE_return
li r0, 0
stw r0, 0(r31)
WDiFindVendorSpecificIE_return:
addi r11, r1, 0x40
mr r3, r28
bl _restgpr_21
lwz r0, 0x44(r1)
mtlr r0
addi r1, r1, 0x40
blr
BOOL WDiFindVendorSpecificIE(WDVendorInfoElement** outIE, u32* outIELength, WDBssDesc* bssDesc, int id, u8* data, u8 mode) {
u32* lengthResult = outIELength;
WDVendorInfoElement** elementResult = outIE;
int length;
BOOL found = FALSE;
if (bssDesc != NULL) {
s32 offset;
u8* ptr = (u8*)(bssDesc + 1);
WDVendorInfoElement* infoElement = (WDVendorInfoElement*)ptr;
length = bssDesc->ieLength;
for (offset = 0; offset < length; offset += infoElement->length + 2) {
infoElement = (WDVendorInfoElement*)(ptr + offset);
if (infoElement->id == (u32)id) {
u8 elementMode = infoElement->mode;
if (memcmp(infoElement->data, data, WD_VENDOR_LENGTH) == 0 && elementMode == mode) {
break;
}
}
}
if (offset < length) {
if (elementResult != NULL) {
*elementResult = infoElement + 1;
}
if (lengthResult != NULL) {
*lengthResult = infoElement->length - (sizeof(WDVendorInfoElement) - sizeof(WDInfoElement));
}
found = TRUE;
}
}
if (!found) {
if (elementResult != NULL) {
*elementResult = NULL;
}
if (lengthResult != NULL) {
*lengthResult = 0;
}
}
return found;
}

View File

@@ -0,0 +1,451 @@
# da2 de-asm attempts
Base: 9d40859ee8f4ee37dc692e444727d17367bfcbeb, agent/w1005/da2.
Scope: CDBDatabase, CDBFileSystemUtils, NWC24Manage, NWC24UserId, vf/develop/nand_drv, WDScan.
All six units begin linked with every function, code byte and data byte exact.
Initial DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d.
Each conversion starts from the original-object Ghidra export, uses typed C, and requires identical pools, exact objdiff, zero ctxdiff differences and a full gate before its own commit.
Evidence files live in build/da2 while this run is active. Rejected conversions restore the existing asm before final verification.
CDBDatabaseSearchCallCallback / callback-1: Ghidra callback branch with typed instance flags and success nesting. objdiff 100.0%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0xf4 base 0xf4 insns 61/61; diffs 0: []
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/cdb/CDBDatabase] pool: IDENTICAL
[libs/RevoEX/src/cdb/CDBDatabase] objdiff: code 12152/12152 data 312/312 functions 33/33 fuzzy 100.0000 linked code 12152
[libs/RevoEX/src/cdb/CDBDatabase] instruction-exact functions: 33/33
[libs/RevoEX/src/cdb/CDBDatabase] section .data size 312 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] section .text size 12152 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] baseline: code 12152/12152 data 312 functions 33 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
CDBDatabaseSearchRecordLayer / record-1: Ghidra traversal with typed search buffer and record key array, current directory date prototype. objdiff 97.76286%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x704 base 0x6fc insns 449/447; --- replace mine 6:7 base 6:9
CDBDatabaseSearchRecordLayer / record-2: Separate dictionary result to preserve call order, finished local before path bounds. objdiff 98.85906%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x704 base 0x6fc insns 449/447; --- replace mine 6:7 base 6:9
CDBDatabaseSearchRecordLayer / record-3: Repair five-argument target call through guarded header declaration; other translation units retain existing prototype. objdiff 100.0%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x6fc base 0x6fc insns 447/447; diffs 0: []
Record-layer evidence: the target only prepares r3-r7 for CDBConvDirStrToCDBDate, and CDBConv.c only consumes the five directory strings. The header currently advertises two unused trailing arguments. CDB_DATABASE_IMPLEMENTATION scopes the accurate five-argument declaration to this unit; no other source or output changes. The key storage starts at instance+8 because CDBRecordKey has 8-byte alignment; a typed prefix view replaces byte-offset casts.
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/cdb/CDBDatabase] pool: IDENTICAL
[libs/RevoEX/src/cdb/CDBDatabase] objdiff: code 12152/12152 data 312/312 functions 33/33 fuzzy 100.0000 linked code 12152
[libs/RevoEX/src/cdb/CDBDatabase] instruction-exact functions: 33/33
[libs/RevoEX/src/cdb/CDBDatabase] section .data size 312 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] section .text size 12152 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] baseline: code 12152/12152 data 312 functions 33 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
CDBDatabaseSearchMinuteLayer / minute-1: Ghidra two-location directory batching with typed integer array and separate dictionary result. objdiff 99.82758%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x3a0 base 0x3a0 insns 232/232; diffs 7: [154, 156, 159, 161, 180, 183, 186]
CDBDatabaseSearchMinuteLayer / minute-2: Branch-local forward iterator and current pointer declarations. objdiff 100.0%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x3a0 base 0x3a0 insns 232/232; diffs 0: []
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/cdb/CDBDatabase] pool: IDENTICAL
[libs/RevoEX/src/cdb/CDBDatabase] objdiff: code 12152/12152 data 312/312 functions 33/33 fuzzy 100.0000 linked code 12152
[libs/RevoEX/src/cdb/CDBDatabase] instruction-exact functions: 33/33
[libs/RevoEX/src/cdb/CDBDatabase] section .data size 312 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] section .text size 12152 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] baseline: code 12152/12152 data 312 functions 33 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
CDBDatabaseSearchHourLayer / hour-1: Ghidra hour search with branch-local forward iterator. objdiff 100.0%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x38c base 0x38c insns 227/227; diffs 0: []
CDBDatabaseSearchDayLayer / day-1: Ghidra day filter and traversal using earlier branch-local iterator fix. COMPILE FAILED.
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/cdb/CDBDatabase] pool: IDENTICAL
[libs/RevoEX/src/cdb/CDBDatabase] objdiff: code 12152/12152 data 312/312 functions 33/33 fuzzy 100.0000 linked code 12152
[libs/RevoEX/src/cdb/CDBDatabase] instruction-exact functions: 33/33
[libs/RevoEX/src/cdb/CDBDatabase] section .data size 312 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] section .text size 12152 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] baseline: code 12152/12152 data 312 functions 33 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
CDBDatabaseSearchDayLayer / day-2: Scoped date-boundary signatures now match actual used arguments, Ghidra day traversal. objdiff 98.63095%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x3f0 base 0x3f0 insns 252/252; diffs 63: [12, 13, 15, 19, 34, 39, 41, 47, 48, 52, 56, 61, 75, 79, 81, 85, 89, 95, 96, 100]
CDBDatabaseSearchDayLayer / day-3: Date predicates follow target compare operand order. objdiff 98.86905%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x3f0 base 0x3f0 insns 252/252; diffs 55: [12, 13, 15, 19, 34, 39, 41, 47, 48, 52, 56, 61, 75, 79, 81, 85, 89, 95, 96, 100]
CDBDatabaseSearchDayLayer / day-4: Outer typed iterator locals precede directory state. objdiff 99.80159%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x3f0 base 0x3f0 insns 252/252; diffs 9: [150, 152, 155, 157, 163, 170, 188, 191, 194]
CDBDatabaseSearchDayLayer / day-5: Forward and reverse loop counters are distinct outer locals. objdiff 99.60317%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x3f0 base 0x3f0 insns 252/252; diffs 18: [150, 152, 155, 157, 163, 170, 188, 191, 194, 199, 201, 204, 206, 212, 219, 237, 240, 241]
CDBDatabaseSearchDayLayer / day-6: Outer reverse locals plus branch-local forward iterator pair. objdiff 99.60317%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x3f0 base 0x3f0 insns 252/252; diffs 18: [150, 152, 155, 157, 163, 170, 188, 191, 194, 199, 201, 204, 206, 212, 219, 237, 240, 241]
CDBDatabaseSearchDayLayer / day-7: Iterator index declared before the pointer in each scope. objdiff 100.0%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x3f0 base 0x3f0 insns 252/252; diffs 0: []
Day-layer signature proof: CDBConv.c's DayBegin/DayEnd ignore the final three declared parameters; MonthBegin/MonthEnd ignore four, and YearBegin/YearEnd ignore five. Target calls pass only the calendar components used. The accurate declarations use the existing CDB_DATABASE_IMPLEMENTATION guard to leave every other translation unit unchanged. Day comparisons now use the target's operand order. All remaining day differences were resolved by iterator declaration scope and order.
CDBDatabaseSearchMonthLayer / month-1: Ghidra month traversal with corrected signatures and iterator order. objdiff 100.0%; POOL IDENTICAL up to 7 (mine=7 base=7); insns 240/240; positional diffs 0.
NWC24CheckUserId / usercheck-1: Ghidra area checks and CRC loop in existing file style. objdiff 95.50848%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 59/59; positional diffs 13.
_MountPrfFile / nand-1: Existing C fallback checked against Ghidra using native retry helpers. objdiff 97.511734%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 424/426; positional diffs 386.
WDiFindVendorSpecificIE / vendor-1: Ghidra traversal using WD vendor element fields and cached mode. objdiff 96.53846%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 35.
NWC24Check / manage-1: Original-object Ghidra flow with News Channel prior C and current SDK type names. objdiff 100.0%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 119/119; positional diffs 0.
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/cdb/CDBDatabase] pool: IDENTICAL
[libs/RevoEX/src/cdb/CDBDatabase] objdiff: code 12152/12152 data 312/312 functions 33/33 fuzzy 100.0000 linked code 12152
[libs/RevoEX/src/cdb/CDBDatabase] instruction-exact functions: 33/33
[libs/RevoEX/src/cdb/CDBDatabase] section .data size 312 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] section .text size 12152 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] baseline: code 12152/12152 data 312 functions 33 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
NWC24CheckUserId / usercheck-2: CRC iterator declared before area fields in lifetime order. objdiff 100.0%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 59/59; positional diffs 0.
CDBDatabaseSearchMonthLayer / month-live: Fresh worktree object confirms isolated exact candidate. objdiff 100.0%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x3c0 base 0x3c0 insns 240/240; diffs 0: []
CDBDatabaseSearchYearLayer / year-1: Ghidra root search with date boundary helpers and typed iterator scopes. objdiff 100.0%; POOL IDENTICAL up to 7 (mine=7 base=7); insns 222/222; positional diffs 0.
CDBFSIsCDBFileOnSD / fsutils-1: Ghidra hexadecimal digit pairs agree with existing C fallback. objdiff 98.85827%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 127/127; positional diffs 20.
CDBFSIsCDBFileOnSD / fsutils-2: Declare hexadecimal loop counters before character pointer. objdiff 98.74016%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 127/127; positional diffs 22.
WDiFindVendorSpecificIE / vendor-2: Typed output locals and signed two-byte IE header increment. objdiff 98.53846%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 14.
WDiFindVendorSpecificIE / vendor-3: Length local precedes found state; compound offset increment. COMPILE FAILED.
CDBFSIsCDBFileOnSD / fsutils-3: Explicit pair validation avoids inner-loop induction temporary. objdiff 97.20473%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 125/127; positional diffs 104.
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/cdb/CDBDatabase] pool: IDENTICAL
[libs/RevoEX/src/cdb/CDBDatabase] objdiff: code 12152/12152 data 312/312 functions 33/33 fuzzy 100.0000 linked code 12152
[libs/RevoEX/src/cdb/CDBDatabase] instruction-exact functions: 33/33
[libs/RevoEX/src/cdb/CDBDatabase] section .data size 312 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] section .text size 12152 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] baseline: code 12152/12152 data 312 functions 33 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
WDiFindVendorSpecificIE / vendor-4: C89 declaration order for length and signed compound offset. objdiff 99.84615%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 1.
CDBDatabaseSearchYearLayer / year-live: Fresh object verifies exact root traversal. objdiff 100.0%; POOL IDENTICAL up to 7 (mine=7 base=7); src 0x378 base 0x378 insns 222/222; diffs 0: []
CDBFSIsCDBFileOnSD / fsutils-4: Static inline character validation helper around ctype conversion. objdiff 93.97638%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 132/127; positional diffs 112.
CDBFSIsCDBFileOnSD / fsutils-5: Direct filename indexing removes cached element pointer. objdiff 97.125984%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 128/127; positional diffs 117.
CDBFSIsCDBFileOnSD / fsutils-6: Function-scope pointer and loop counters, assignment after length check. objdiff 98.85827%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 127/127; positional diffs 20.
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/cdb/CDBDatabase] pool: IDENTICAL
[libs/RevoEX/src/cdb/CDBDatabase] objdiff: code 12152/12152 data 312/312 functions 33/33 fuzzy 100.0000 linked code 12152
[libs/RevoEX/src/cdb/CDBDatabase] instruction-exact functions: 33/33
[libs/RevoEX/src/cdb/CDBDatabase] section .data size 312 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] section .text size 12152 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] baseline: code 12152/12152 data 312 functions 33 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
NWC24Check / manage-live: Prior C adapted to local SDK declarations, isolated exact candidate verified in worktree. objdiff 100.0%; POOL IDENTICAL up to 0 (mine=0 base=0); src 0x1dc base 0x1dc insns 119/119; diffs 0: []
WDiFindVendorSpecificIE / vendor-5: Unsigned IE length gives target addition operand order. objdiff 99.84615%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 1.
WDiFindVendorSpecificIE / vendor-6: Offset-first source sum leaves loaded length first in target instruction. objdiff 99.84615%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 1.
WDiFindVendorSpecificIE / vendor-7: Inline helper for the information-element offset step. objdiff 99.84615%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 1.
NWC24Check prior source: https://raw.githubusercontent.com/hotlandsoftware/wii-news-channel/main/src/revolution/NWC24/NWC24Manage.c . The original-object Ghidra control flow agrees with that C implementation. SDK names adapted locally; exact 119/119 instructions.
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/nwc24/NWC24Manage] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24Manage] objdiff: code 3784/3784 data 336/336 functions 21/21 fuzzy 100.0000 linked code 3784
[libs/RevoEX/src/nwc24/NWC24Manage] instruction-exact functions: 21/21
[libs/RevoEX/src/nwc24/NWC24Manage] section .bss size 32 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .data size 272 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .sbss size 24 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .sdata size 8 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .text size 3784 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] baseline: code 3784/3784 data 336 functions 21 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
NWC24CheckUserId / usercheck-live: Verify area and CRC checks in the live object. objdiff 100.0%; POOL IDENTICAL up to 0 (mine=0 base=0); src 0xec base 0xec insns 59/59; diffs 0: []
_MountPrfFile / nand-2: Remove dead initial values and separate read result from open result. objdiff 97.511734%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 424/426; positional diffs 386.
CDBFSIsCDBFileOnSD / fsutils-7: Inline helper owns prefix walker and nested hexadecimal loops. objdiff 95.03937%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 132/127; positional diffs 87.
getUnScrambleId / unscramble-1: Ghidra permutation reconstructed as 53-bit rotate, byte permutation, inverse nibble substitution. objdiff 50.298138%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 162/161; positional diffs 157.
getUnScrambleId / unscramble-2: 64-bit byte helper values preserve masks across inline boundaries. objdiff 49.826088%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 164/161; positional diffs 160.
getUnScrambleId / unscramble-3: Mask the rotated 53-bit result after the left shift. objdiff 40.51553%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 165/161; positional diffs 161.
_MountPrfFile / nand-3: Natural null test and grouped big-endian header words. objdiff 100.0%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 426/426; positional diffs 0.
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/nwc24/NWC24UserId] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24UserId] objdiff: code 1032/1032 data 16/16 functions 3/3 fuzzy 100.0000 linked code 1032
[libs/RevoEX/src/nwc24/NWC24UserId] instruction-exact functions: 3/3
[libs/RevoEX/src/nwc24/NWC24UserId] section .rodata size 16 match 100.0
[libs/RevoEX/src/nwc24/NWC24UserId] section .text size 1032 match 100.0
[libs/RevoEX/src/nwc24/NWC24UserId] baseline: code 1032/1032 data 16 functions 3 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
_MountPrfFile / nand-live: Verify native C mount with grouped header decoding. objdiff 100.0%; POOL IDENTICAL up to 0 (mine=0 base=0); src 0x6a8 base 0x6a8 insns 426/426; diffs 0: []
WDiFindVendorSpecificIE / vendor-8: Simplify source-search result to output local declaration order only. objdiff 99.84615%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 1.
getUnScrambleId / unscramble-4: Byte replacement helper mutates a typed 64-bit value in place. objdiff 39.62733%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 169/161; positional diffs 159.
WDiFindVendorSpecificIE / vendor-min-0: Single null-check operand reversal: element-success. objdiff 99.84615%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 1.
WDiFindVendorSpecificIE / vendor-min-1: Single null-check operand reversal: length-success. objdiff 99.84615%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 1.
WDiFindVendorSpecificIE / vendor-min-2: Single null-check operand reversal: element-failure. objdiff 99.84615%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 1.
CDBFSIsCDBFileOnSD / fsutils-8: Integer loop counters for the four pairs and extension. objdiff 97.28346%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 125/127; positional diffs 116.
WDiFindVendorSpecificIE / vendor-9: Signed SDK width for offset without reordered null tests. objdiff 100.0%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 65/65; positional diffs 0.
CDBFSIsCDBFileOnSD / fsutils-type-signed: Counter types s8 i, j;. objdiff 98.85827%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 127/127; positional diffs 20.
CDBFSIsCDBFileOnSD / fsutils-type-unsigned: Counter types u8 i, j;. objdiff 98.85827%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 127/127; positional diffs 20.
CDBFSIsCDBFileOnSD / fsutils-type-mixed: Counter types char i; int j;. objdiff 98.85827%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 127/127; positional diffs 20.
CDBFSIsCDBFileOnSD / fsutils-type-long: Counter types char i; s32 j;. objdiff 98.85827%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 127/127; positional diffs 20.
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/vf/develop/nand_drv] pool: IDENTICAL
[libs/RevoEX/src/vf/develop/nand_drv] objdiff: code 12144/12144 data 464/464 functions 33/33 fuzzy 100.0000 linked code 12144
[libs/RevoEX/src/vf/develop/nand_drv] instruction-exact functions: 33/33
[libs/RevoEX/src/vf/develop/nand_drv] section .bss size 424 match 100.0
[libs/RevoEX/src/vf/develop/nand_drv] section .rodata size 32 match 100.0
[libs/RevoEX/src/vf/develop/nand_drv] section .sbss size 8 match 100.0
[libs/RevoEX/src/vf/develop/nand_drv] section .text size 12144 match 100.0
[libs/RevoEX/src/vf/develop/nand_drv] baseline: code 12144/12144 data 464 functions 33 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
getUnScrambleId / unscramble-5: Unsigned byte positions and explicit ten-bit wraparound mask. objdiff 50.701862%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 161/161; positional diffs 155.
WDiFindVendorSpecificIE / vendor-live: Minimal C body uses s32 offset, existing neighboring functions unchanged. objdiff 100.0%; POOL IDENTICAL up to 0 (mine=0 base=0); src 0x104 base 0x104 insns 65/65; diffs 0: []
CDBFSIsCDBFileOnSD / fsutils-9: One-field cursor struct changes pointer temporary ownership. objdiff 99.09449%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 127/127; positional diffs 17.
CDBFSIsCDBFileOnSD / fsutils-10: Inline helper separates filename format validation from bounded length check. objdiff 98.74016%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 127/127; positional diffs 22.
CDBFSIsCDBFileOnSD / fsutils-11: Advance parameter as the prefix walker and preserve the filename for extension checks. objdiff 95.15748%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 129/127; positional diffs 122.
Wireless source search: stock srcsearch.py initially selected an earlier call site. A worktree-local copy anchors its function matcher to a definition; shared tools were not changed. Seed 25 found 100% after 11 trials. Removing unnecessary reordered null tests retained 100% when offset is s32. The SDK defines s32 as signed long, distinct from int for MWCC's expression lowering. Only the owned WDiFindVendorSpecificIE body and its now-unused asm helper declarations are changed.
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/wd/WDScan] pool: IDENTICAL
[libs/RevoEX/src/wd/WDScan] objdiff: code 2180/2180 data 16/16 functions 5/5 fuzzy 100.0000 linked code 2180
[libs/RevoEX/src/wd/WDScan] instruction-exact functions: 5/5
[libs/RevoEX/src/wd/WDScan] section .sdata size 8 match 100.0
[libs/RevoEX/src/wd/WDScan] section .sdata2 size 8 match 100.0
[libs/RevoEX/src/wd/WDScan] section .text size 2180 match 100.0
[libs/RevoEX/src/wd/WDScan] baseline: code 2180/2180 data 16 functions 5 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
getUnScrambleId / unscramble-6: Repeated trial 5; the intended edit did not run because git diff --check caught an EOF blank line. Superseded by trial 6b. objdiff 50.701862%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 161/161; positional diffs 155.
getUnScrambleId / unscramble-6b: Corrected trial: SDK u32 byte access helpers with explicit byte-width mask. objdiff 48.714287%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 161/161; positional diffs 155.
getUnScrambleId / unscramble-7b: Keep the target out-of-line boundary while factoring the byte permutation. objdiff 50.701862%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 161/161; positional diffs 155.
getUnScrambleId / unscramble-8: Direct byte expressions through macros instead of inline argument temporaries. objdiff 41.142857%; POOL IDENTICAL up to 0 (mine=0 base=0); insns 161/161; positional diffs 157.
## Retained assembly and remaining work
CDBFSIsCDBFileOnSD remains the original exact asm. The best readable C trial, fsutils-9, has 127/127 instructions and 99.09449% objdiff, with 17 differences in registers r3/r4/r5 around ctype map access and the prefix walker. Tried nested and explicit paired loops, counters with char/s8/u8/int/s32 types, function and block scopes, typed helpers, direct indexing, a one-field cursor, and advancing the input parameter. A 120-second source search tried 217 variants from fsutils-1 without improvement. No C trial was retained. Best source and detailed diff: build/da2/fsutils-9/.
getUnScrambleId remains the original exact asm. The best C trial, unscramble-5, reaches 161/161 instructions but only 50.701862% objdiff and 155 positional differences, including instruction scheduling through byte permutation and register allocation. Tried u8/u32/u64 byte helpers, return-value and pointer setters, explicit rotation masks, a separate permutation helper, and direct macro expressions. A 180-second source search tried 292 variants with no improvement. Trial 7 inlined away the function; trial 7b restored its original call boundary with NO_INLINE and remained non-exact. No experimental helper, macro, attribute or C body was retained. Best source and detailed diff: build/da2/unscramble-5/. Neither remaining function is claimed to require assembly.
Both retained functions have more than three distinct compiled source attempts. No untried assignment remains. The two helper-signature header changes are scoped to CDB_DATABASE_IMPLEMENTATION; all other units keep their existing declarations.
## Converted functions and commits
143785b0 decomp(cdb): convert search callback to c
ea8cd532 decomp(cdb): convert record search layer to c
e5989e5e decomp(cdb): convert minute search layer to c
4a653bb3 decomp(cdb): convert hour search layer to c
952dd221 decomp(cdb): convert day search layer to c
b72b9d27 decomp(cdb): convert month search layer to c
88082111 decomp(cdb): convert year search layer to c
0743c6da decomp(nwc24): convert library check to c
a1d0e162 decomp(nwc24): convert user id validation to c
19410104 decomp(vf): convert nand prf mount to c
d612eee9 decomp(wd): convert vendor element search to c
## Baseline and final comparison
Unit | Exact functions | Matched code | Matched data | Asm bodies before -> after
--- | --- | --- | --- | ---
libs/RevoEX/src/cdb/CDBDatabase | 33 -> 33 | 12152 -> 12152 | 312 -> 312 | 7 -> 0
libs/RevoEX/src/cdb/CDBFileSystemUtils | 11 -> 11 | 2480 -> 2480 | 8 -> 8 | 1 -> 1
libs/RevoEX/src/nwc24/NWC24Manage | 21 -> 21 | 3784 -> 3784 | 336 -> 336 | 1 -> 0
libs/RevoEX/src/nwc24/NWC24UserId | 3 -> 3 | 1032 -> 1032 | 16 -> 16 | 2 -> 1
libs/RevoEX/src/vf/develop/nand_drv | 33 -> 33 | 12144 -> 12144 | 464 -> 464 | 1 -> 0
libs/RevoEX/src/wd/WDScan | 5 -> 5 | 2180 -> 2180 | 16 -> 16 | 1 -> 0
Final full gate: clean 4.3U rebuild of all six units passed. The fresh report, object diffs, and DOL agree. Eleven assigned asm bodies are now exact C; the other two remain original asm with the failed C trials recorded above.
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/cdb/CDBDatabase] pool: IDENTICAL
[libs/RevoEX/src/cdb/CDBDatabase] objdiff: code 12152/12152 data 312/312 functions 33/33 fuzzy 100.0000 linked code 12152
[libs/RevoEX/src/cdb/CDBDatabase] instruction-exact functions: 33/33
[libs/RevoEX/src/cdb/CDBDatabase] section .data size 312 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] section .text size 12152 match 100.0
[libs/RevoEX/src/cdb/CDBDatabase] baseline: code 12152/12152 data 312 functions 33 fuzzy 100.0000
[libs/RevoEX/src/cdb/CDBFileSystemUtils] pool: IDENTICAL
[libs/RevoEX/src/cdb/CDBFileSystemUtils] objdiff: code 2480/2480 data 8/8 functions 11/11 fuzzy 100.0000 linked code 2480
[libs/RevoEX/src/cdb/CDBFileSystemUtils] instruction-exact functions: 11/11
[libs/RevoEX/src/cdb/CDBFileSystemUtils] section .sdata size 8 match 100.0
[libs/RevoEX/src/cdb/CDBFileSystemUtils] section .text size 2480 match 100.0
[libs/RevoEX/src/cdb/CDBFileSystemUtils] baseline: code 2480/2480 data 8 functions 11 fuzzy 100.0000
[libs/RevoEX/src/nwc24/NWC24Manage] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24Manage] objdiff: code 3784/3784 data 336/336 functions 21/21 fuzzy 100.0000 linked code 3784
[libs/RevoEX/src/nwc24/NWC24Manage] instruction-exact functions: 21/21
[libs/RevoEX/src/nwc24/NWC24Manage] section .bss size 32 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .data size 272 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .sbss size 24 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .sdata size 8 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] section .text size 3784 match 100.0
[libs/RevoEX/src/nwc24/NWC24Manage] baseline: code 3784/3784 data 336 functions 21 fuzzy 100.0000
[libs/RevoEX/src/nwc24/NWC24UserId] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24UserId] objdiff: code 1032/1032 data 16/16 functions 3/3 fuzzy 100.0000 linked code 1032
[libs/RevoEX/src/nwc24/NWC24UserId] instruction-exact functions: 3/3
[libs/RevoEX/src/nwc24/NWC24UserId] section .rodata size 16 match 100.0
[libs/RevoEX/src/nwc24/NWC24UserId] section .text size 1032 match 100.0
[libs/RevoEX/src/nwc24/NWC24UserId] baseline: code 1032/1032 data 16 functions 3 fuzzy 100.0000
[libs/RevoEX/src/vf/develop/nand_drv] pool: IDENTICAL
[libs/RevoEX/src/vf/develop/nand_drv] objdiff: code 12144/12144 data 464/464 functions 33/33 fuzzy 100.0000 linked code 12144
[libs/RevoEX/src/vf/develop/nand_drv] instruction-exact functions: 33/33
[libs/RevoEX/src/vf/develop/nand_drv] section .bss size 424 match 100.0
[libs/RevoEX/src/vf/develop/nand_drv] section .rodata size 32 match 100.0
[libs/RevoEX/src/vf/develop/nand_drv] section .sbss size 8 match 100.0
[libs/RevoEX/src/vf/develop/nand_drv] section .text size 12144 match 100.0
[libs/RevoEX/src/vf/develop/nand_drv] baseline: code 12144/12144 data 464 functions 33 fuzzy 100.0000
[libs/RevoEX/src/wd/WDScan] pool: IDENTICAL
[libs/RevoEX/src/wd/WDScan] objdiff: code 2180/2180 data 16/16 functions 5/5 fuzzy 100.0000 linked code 2180
[libs/RevoEX/src/wd/WDScan] instruction-exact functions: 5/5
[libs/RevoEX/src/wd/WDScan] section .sdata size 8 match 100.0
[libs/RevoEX/src/wd/WDScan] section .sdata2 size 8 match 100.0
[libs/RevoEX/src/wd/WDScan] section .text size 2180 match 100.0
[libs/RevoEX/src/wd/WDScan] baseline: code 2180/2180 data 16 functions 5 fuzzy 100.0000
regressions vs baseline: 0
global matched_code_percent: 92.73726 -> 92.73726
global fuzzy_match_percent: 99.78007 -> 99.78007
global complete_code_percent: 76.40339 -> 76.40339
global matched_data_percent: 99.99410 -> 99.99410
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
## Fresh function verification
```text
libs/RevoEX/src/cdb/CDBDatabase: POOL IDENTICAL up to 7 (mine=7 base=7)
CDBDatabaseSearchCallCallback: objdiff 100.0%; src 0xf4 base 0xf4 insns 61/61; diffs 0: []
CDBDatabaseSearchRecordLayer: objdiff 100.0%; src 0x6fc base 0x6fc insns 447/447; diffs 0: []
CDBDatabaseSearchMinuteLayer: objdiff 100.0%; src 0x3a0 base 0x3a0 insns 232/232; diffs 0: []
CDBDatabaseSearchHourLayer: objdiff 100.0%; src 0x38c base 0x38c insns 227/227; diffs 0: []
CDBDatabaseSearchDayLayer: objdiff 100.0%; src 0x3f0 base 0x3f0 insns 252/252; diffs 0: []
CDBDatabaseSearchMonthLayer: objdiff 100.0%; src 0x3c0 base 0x3c0 insns 240/240; diffs 0: []
CDBDatabaseSearchYearLayer: objdiff 100.0%; src 0x378 base 0x378 insns 222/222; diffs 0: []
libs/RevoEX/src/cdb/CDBFileSystemUtils: POOL IDENTICAL up to 0 (mine=0 base=0)
CDBFSIsCDBFileOnSD: objdiff 100.0%; src 0x1fc base 0x1fc insns 127/127; diffs 0: []
libs/RevoEX/src/nwc24/NWC24Manage: POOL IDENTICAL up to 0 (mine=0 base=0)
NWC24Check: objdiff 100.0%; src 0x1dc base 0x1dc insns 119/119; diffs 0: []
libs/RevoEX/src/nwc24/NWC24UserId: POOL IDENTICAL up to 0 (mine=0 base=0)
NWC24CheckUserId: objdiff 100.0%; src 0xec base 0xec insns 59/59; diffs 0: []
getUnScrambleId: objdiff 100.0%; src 0x284 base 0x284 insns 161/161; diffs 0: []
libs/RevoEX/src/vf/develop/nand_drv: POOL IDENTICAL up to 0 (mine=0 base=0)
_MountPrfFile: objdiff 100.0%; src 0x6a8 base 0x6a8 insns 426/426; diffs 0: []
libs/RevoEX/src/wd/WDScan: POOL IDENTICAL up to 0 (mine=0 base=0)
WDiFindVendorSpecificIE: objdiff 100.0%; src 0x104 base 0x104 insns 65/65; diffs 0: []
Owned totals: {"matched_functions": 106, "total_functions": 106, "matched_code": 33772, "total_code": 33772, "matched_data": 1152, "total_data": 1152}
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d
GATE PASS: final clean six-unit gate, pools, exact-name objdiff, ctxdiff, fully linked code/data, and DOL hash.
```
`ninja -C . progress build/43U/report.json build/43U/ok` also passed after the clean gate. Each unit retains 100% matched and linked code/data, totaling 106 exact functions, 33772 code bytes and 1152 data bytes. The only remaining assigned asm bodies are CDBFSIsCDBFileOnSD and getUnScrambleId. No rejected source-search change was retained.