Various bugfixes

This commit is contained in:
CTCaer
2019-08-28 01:08:57 +03:00
parent e07dde1c58
commit 3472e7e7fb
19 changed files with 60 additions and 63 deletions

View File

@@ -57,8 +57,11 @@ static const pkg1_id_t _pkg1_ids[] = {
const pkg1_id_t *pkg1_identify(u8 *pkg1, char *build_date)
{
memcpy(build_date, (char *)(pkg1 + 0x10), 14);
build_date[14] = 0;
if (build_date)
{
memcpy(build_date, (char *)(pkg1 + 0x10), 14);
build_date[14] = 0;
}
for (u32 i = 0; _pkg1_ids[i].id; i++)
if (!memcmp(pkg1 + 0x10, _pkg1_ids[i].id, 12))

View File

@@ -73,10 +73,14 @@ extern void reloc_patcher(u32 payload_dst, u32 payload_src, u32 payload_size);
void check_sept()
{
// Check if non-hekate payload is used for sept and restore it.
if (h_cfg.sept_run && !f_stat("sept/payload.bak", NULL))
if (h_cfg.sept_run)
{
f_unlink("sept/payload.bin");
f_rename("sept/payload.bak", "sept/payload.bin");
if (!f_stat("sept/payload.bak", NULL))
{
f_unlink("sept/payload.bin");
f_rename("sept/payload.bak", "sept/payload.bin");
}
return;
}