Validate pkg1_identify result for main menu

This commit is contained in:
shchmue 2021-04-06 16:43:44 -06:00
parent b3f6e055b2
commit 20c0df3715
1 changed files with 14 additions and 10 deletions

View File

@ -304,6 +304,7 @@ void _get_key_generations(char *sysnand_label, char *emunand_label)
u32 pk1_offset = h_cfg.t210b01 ? sizeof(bl_hdr_t210b01_t) : 0; // Skip T210B01 OEM header.
const pkg1_id_t *pkg1_id = pkg1_identify(pkg1 + pk1_offset);
if (pkg1_id) {
sprintf(sysnand_label + 36, "% 3d", pkg1_id->kb);
ment_top[0].caption = sysnand_label;
if (h_cfg.emummc_force_disable)
@ -311,6 +312,7 @@ void _get_key_generations(char *sysnand_label, char *emunand_label)
free(pkg1);
return;
}
}
emummc_storage_init_mmc(&storage, &sdmmc);
memset(pkg1, 0, PKG1_MAX_SIZE);
@ -319,10 +321,12 @@ void _get_key_generations(char *sysnand_label, char *emunand_label)
emummc_storage_end(&storage);
pkg1_id = pkg1_identify(pkg1 + pk1_offset);
if (pkg1_id) {
sprintf(emunand_label + 36, "% 3d", pkg1_id->kb);
free(pkg1);
ment_top[1].caption = emunand_label;
}
}
extern void pivot_stack(u32 stack_top);