Skip to content

Commit 5b9d791

Browse files
committed
fix fmw detection + clean debug display
1 parent d00dcad commit 5b9d791

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

NxNandManager/NxStorage.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,7 @@ int NxStorage::fat32_read(const char* partition)
19821982
return -1;
19831983

19841984
auto printEntry = [this](fat32_dir_entry *cur_entry, fs_attr fs, u64 root_addr) -> int {
1985-
if (!DEBUG_MODE)
1985+
//if (!DEBUG_MODE)
19861986
return 1;
19871987

19881988
char str_buff[20];
@@ -2048,7 +2048,7 @@ int NxStorage::fat32_read(const char* partition)
20482048

20492049

20502050
// Check for firmare version in play report
2051-
bool search_fmw = FALSE;
2051+
bool search_fmw = FALSE, report_based_fwm = FALSE;
20522052
if (play_report_off > 0 && readCluster(buffer, play_report_off) > 0)
20532053
{
20542054
search_fmw = true;
@@ -2070,6 +2070,7 @@ int NxStorage::fat32_read(const char* partition)
20702070
if(DEBUG_MODE) printf("Newer firmware version found in PLAY REPORTS (%s) \n", fwv);
20712071
memcpy(fw_version, fwv, 5);
20722072
fw_detected = true;
2073+
report_based_fwm = true;
20732074
}
20742075
}
20752076

@@ -2081,7 +2082,7 @@ int NxStorage::fat32_read(const char* partition)
20812082

20822083
// Check form firmware version in journal
20832084
if (journal_report_off > 0 && (search_fmw || strlen(serial_number) <= 3 ) && readCluster(buffer, journal_report_off) > 0)
2084-
{
2085+
{
20852086
if (DEBUG_MODE) printf("Searching patterns in JOURNAL at offset %s\n", int_to_hex(journal_report_off).c_str());
20862087

20872088
u64 cur_off = journal_report_off + CLUSTER_SIZE;
@@ -2103,6 +2104,7 @@ int NxStorage::fat32_read(const char* partition)
21032104
if (DEBUG_MODE) printf("Newer firmware version found in JOURNAL (%s) \n", fwv);
21042105
memcpy(fw_version, fwv, 5);
21052106
fw_detected = true;
2107+
report_based_fwm = true;
21062108
}
21072109
}
21082110
}
@@ -2125,7 +2127,7 @@ int NxStorage::fat32_read(const char* partition)
21252127
}
21262128
}
21272129

2128-
if (fw_detected && search_fmw)
2130+
if (report_based_fwm && search_fmw)
21292131
strcat(fw_version, " (or higher)");
21302132

21312133
if (NULL != p_crypto)

0 commit comments

Comments
 (0)