1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-11-10 12:31:51 +00:00

Merge pull request #162 from balika011/ipatches_fix

Fix ipatches backup on dumping
This commit is contained in:
Kostas Missos 2018-12-15 21:45:26 +02:00 committed by GitHub
commit 09bfed9146
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -688,15 +688,15 @@ void bootrom_ipatches_info()
if (!sd_save_to_file((u8 *)BOOTROM_BASE, BOOTROM_SIZE, path))
gfx_puts(&gfx_con, "\nbootrom_patched.bin saved!\n");
u8 ipatch_backup[13];
memcpy(ipatch_backup, (void *) IPATCH_BASE, 13);
memset((void*)IPATCH_BASE, 0, 13);
u32 ipatch_backup[13];
memcpy(ipatch_backup, (void *) IPATCH_BASE, sizeof(ipatch_backup));
memset((void*)IPATCH_BASE, 0, sizeof(ipatch_backup));
emmcsn_path_impl(path, "/dumps", "bootrom_unpatched.bin", NULL);
if (!sd_save_to_file((u8 *)BOOTROM_BASE, BOOTROM_SIZE, path))
gfx_puts(&gfx_con, "\nbootrom_unpatched.bin saved!\n");
memcpy((void*)IPATCH_BASE, ipatch_backup, 13);
memcpy((void*)IPATCH_BASE, ipatch_backup, sizeof(ipatch_backup));
sd_unmount();
}

View file

@ -96,7 +96,7 @@ static void _se_lock(bool lock_se)
SE(SE_SECURITY_0) &= 0xFFFFFFFB; // Make access lock regs secure only.
}
memset((void *)IPATCH_BASE, 0, 13);
memset((void *)IPATCH_BASE, 0, 13 * sizeof(u32));
SB(SB_CSR) = 0x10; // Protected IROM enable.
// This is useful for documenting the bits in the SE config registers, so we can keep it around.