1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-11-22 18:06:40 +00:00

Allow verification cancel. Backup still remains.

This commit is contained in:
Kostas Missos 2018-09-24 23:51:04 +03:00
parent 1392e6eaf4
commit 04ac8ebd43
2 changed files with 25 additions and 9 deletions

View file

@ -57,18 +57,18 @@ PATCHSET_DEF(_secmon_4_patchset,
PATCHSET_DEF(_secmon_5_patchset,
// Patch package2 decryption and signature/hash checks.
{ 0xDA8 + 0x9D8 , _NOP() }, //package2 structure.
{ 0xDA8 + 0x9E4 , _NOP() }, //Version.
{ 0xDA8 + 0xC9C , _NOP() }, //Header signature.
{ 0xDA8 + 0x1038 , _NOP() } //Sections SHA2.
{ 0xDA8 + 0x9D8, _NOP() }, //package2 structure.
{ 0xDA8 + 0x9E4, _NOP() }, //Version.
{ 0xDA8 + 0xC9C, _NOP() }, //Header signature.
{ 0xDA8 + 0x1038, _NOP() } //Sections SHA2.
);
PATCHSET_DEF(_secmon_6_patchset,
// Patch package2 decryption and signature/hash checks.
{ 0xDC8 + 0x820 , _NOP() }, //package2 structure.
{ 0xDC8 + 0x82C , _NOP() }, //Version.
{ 0xDC8 + 0xE90 , _NOP() }, //Header signature.
{ 0xDC8 + 0x112C , _NOP() } //Sections SHA2.
{ 0xDC8 + 0x820, _NOP() }, //package2 structure.
{ 0xDC8 + 0x82C, _NOP() }, //Version.
{ 0xDC8 + 0xE90, _NOP() }, //Header signature.
{ 0xDC8 + 0x112C, _NOP() } //Sections SHA2.
);
/*

View file

@ -840,6 +840,7 @@ out:
int dump_emmc_verify(sdmmc_storage_t *storage, u32 lba_curr, char *outFilename, emmc_part_t *part)
{
FIL fp;
u32 btn = 0;
u32 prevPct = 200;
int res = 0;
@ -898,7 +899,7 @@ int dump_emmc_verify(sdmmc_storage_t *storage, u32 lba_curr, char *outFilename,
default:
se_calc_sha256(&hashEm, bufEm, num << 9);
se_calc_sha256(&hashSd, bufSd, num << 9);
res = memcmp(hashEm, hashSd, 0x20);
res = memcmp(hashEm, hashSd, 0x10);
break;
}
if (res)
@ -921,6 +922,21 @@ int dump_emmc_verify(sdmmc_storage_t *storage, u32 lba_curr, char *outFilename,
lba_curr += num;
totalSectorsVer -= num;
btn = btn_wait_timeout(0, BTN_VOL_DOWN | BTN_VOL_UP);
if ((btn & BTN_VOL_DOWN) && (btn & BTN_VOL_UP))
{
gfx_con.fntsz = 16;
WPRINTF("\n\nThe verification was cancelled!");
EPRINTF("\nPress any key...\n");
msleep(1500);
free(bufEm);
free(bufSd);
f_close(&fp);
return 0;
}
}
free(bufEm);
free(bufSd);