mirror of
https://github.com/CTCaer/hekate
synced 2024-12-22 19:31:12 +00:00
Change partial backup msg + some fixes
This commit is contained in:
parent
a5f2bb9d57
commit
2f120d1cbb
7 changed files with 24 additions and 20 deletions
|
@ -42,6 +42,7 @@ void set_default_configuration()
|
||||||
h_cfg.bootwait = 3;
|
h_cfg.bootwait = 3;
|
||||||
h_cfg.customlogo = 0;
|
h_cfg.customlogo = 0;
|
||||||
h_cfg.verification = 2;
|
h_cfg.verification = 2;
|
||||||
|
h_cfg.se_keygen_done = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int create_config_entry()
|
int create_config_entry()
|
||||||
|
|
|
@ -25,6 +25,8 @@ typedef struct _hekate_config
|
||||||
u32 bootwait;
|
u32 bootwait;
|
||||||
u32 customlogo;
|
u32 customlogo;
|
||||||
u32 verification;
|
u32 verification;
|
||||||
|
// Global temporary config.
|
||||||
|
int se_keygen_done;
|
||||||
}hekate_config;
|
}hekate_config;
|
||||||
|
|
||||||
void set_default_configuration();
|
void set_default_configuration();
|
||||||
|
|
|
@ -360,7 +360,7 @@ void gfx_printf(gfx_con_t *con, const char *fmt, ...)
|
||||||
break;
|
break;
|
||||||
case 'K':
|
case 'K':
|
||||||
con->bgcol = va_arg(ap, u32);
|
con->bgcol = va_arg(ap, u32);
|
||||||
con->fillbg = fcnt;
|
con->fillbg = 1;
|
||||||
break;
|
break;
|
||||||
case '%':
|
case '%':
|
||||||
gfx_putc(con, '%');
|
gfx_putc(con, '%');
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include "pkg2.h"
|
#include "pkg2.h"
|
||||||
#include "ff.h"
|
#include "ff.h"
|
||||||
#include "di.h"
|
#include "di.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
extern gfx_ctxt_t gfx_ctxt;
|
extern gfx_ctxt_t gfx_ctxt;
|
||||||
|
@ -43,7 +44,7 @@ extern void sd_unmount();
|
||||||
//#define DPRINTF(...) gfx_printf(&gfx_con, __VA_ARGS__)
|
//#define DPRINTF(...) gfx_printf(&gfx_con, __VA_ARGS__)
|
||||||
#define DPRINTF(...)
|
#define DPRINTF(...)
|
||||||
|
|
||||||
extern int se_keygen_done;
|
extern hekate_config h_cfg;
|
||||||
|
|
||||||
typedef struct _launch_ctxt_t
|
typedef struct _launch_ctxt_t
|
||||||
{
|
{
|
||||||
|
@ -446,9 +447,10 @@ int hos_launch(ini_sec_t *cfg)
|
||||||
gfx_printf(&gfx_con, "Loaded package1 and keyblob\n");
|
gfx_printf(&gfx_con, "Loaded package1 and keyblob\n");
|
||||||
|
|
||||||
// Generate keys.
|
// Generate keys.
|
||||||
if (!se_keygen_done)
|
if (!h_cfg.se_keygen_done)
|
||||||
{
|
{
|
||||||
keygen(ctxt.keyblob, ctxt.pkg1_id->kb, (u8 *)ctxt.pkg1 + ctxt.pkg1_id->tsec_off);
|
keygen(ctxt.keyblob, ctxt.pkg1_id->kb, (u8 *)ctxt.pkg1 + ctxt.pkg1_id->tsec_off);
|
||||||
|
h_cfg.se_keygen_done = 1;
|
||||||
DPRINTF("Generated keys\n");
|
DPRINTF("Generated keys\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
28
ipl/main.c
28
ipl/main.c
|
@ -78,8 +78,6 @@ u8 *Kc_MENU_LOGO;
|
||||||
|
|
||||||
hekate_config h_cfg;
|
hekate_config h_cfg;
|
||||||
|
|
||||||
int se_keygen_done = 0;
|
|
||||||
|
|
||||||
int sd_mount()
|
int sd_mount()
|
||||||
{
|
{
|
||||||
if (sd_mounted)
|
if (sd_mounted)
|
||||||
|
@ -1017,11 +1015,11 @@ int dump_emmc_part(char *sd_path, sdmmc_storage_t *storage, emmc_part_t *part)
|
||||||
// More parts to backup that do not currently fit the sd card free space or fatal error.
|
// More parts to backup that do not currently fit the sd card free space or fatal error.
|
||||||
if (currPartIdx >= maxSplitParts)
|
if (currPartIdx >= maxSplitParts)
|
||||||
{
|
{
|
||||||
gfx_puts(&gfx_con, "\n\n1. Press any key and Power off Switch from the main menu.\n\
|
gfx_puts(&gfx_con, "\n\n1. Press any key to unmount SD Card.\n\
|
||||||
2. Move the files from SD card to free space.\n\
|
2. Remove SD Card and move files to free space.\n\
|
||||||
Don\'t move the partial.idx file!\n\
|
Don\'t move the partial.idx file!\n\
|
||||||
3. Unplug and re-plug USB while pressing Vol+.\n\
|
3. Re-insert SD Card.\n\
|
||||||
4. Run hekate again and press Backup eMMC RAW GPP (or eMMC USER) to continue.\n");
|
4. Select the SAME option again to continue.\n");
|
||||||
gfx_con.fntsz = 16;
|
gfx_con.fntsz = 16;
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
|
@ -1285,7 +1283,7 @@ int restore_emmc_part(char *sd_path, sdmmc_storage_t *storage, emmc_part_t *part
|
||||||
else if (((u32)((u64)f_size(&fp)>>(u64)9)) != totalSectors)
|
else if (((u32)((u64)f_size(&fp)>>(u64)9)) != totalSectors)
|
||||||
{
|
{
|
||||||
gfx_con.fntsz = 16;
|
gfx_con.fntsz = 16;
|
||||||
EPRINTF("Size of sd card backup does not match,\neMMC's selected part size.\n");
|
EPRINTF("Size of the SD Card backup does not match,\neMMC's selected part size.\n");
|
||||||
f_close(&fp);
|
f_close(&fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1541,7 +1539,7 @@ void dump_package1()
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!se_keygen_done)
|
if (!h_cfg.se_keygen_done)
|
||||||
{
|
{
|
||||||
// Read keyblob.
|
// Read keyblob.
|
||||||
u8 *keyblob = (u8 *)calloc(NX_EMMC_BLOCKSIZE, 1);
|
u8 *keyblob = (u8 *)calloc(NX_EMMC_BLOCKSIZE, 1);
|
||||||
|
@ -1550,7 +1548,7 @@ void dump_package1()
|
||||||
// Decrypt.
|
// Decrypt.
|
||||||
keygen(keyblob, pkg1_id->kb, (u8 *)pkg1 + pkg1_id->tsec_off);
|
keygen(keyblob, pkg1_id->kb, (u8 *)pkg1 + pkg1_id->tsec_off);
|
||||||
|
|
||||||
se_keygen_done = 1;
|
h_cfg.se_keygen_done = 1;
|
||||||
free(keyblob);
|
free(keyblob);
|
||||||
}
|
}
|
||||||
pkg1_decrypt(pkg1_id, pkg1);
|
pkg1_decrypt(pkg1_id, pkg1);
|
||||||
|
@ -1558,7 +1556,7 @@ void dump_package1()
|
||||||
pkg1_unpack(warmboot, secmon, loader, pkg1_id, pkg1);
|
pkg1_unpack(warmboot, secmon, loader, pkg1_id, pkg1);
|
||||||
|
|
||||||
// Display info.
|
// Display info.
|
||||||
gfx_printf(&gfx_con, "%kNX Bootloader size: %k0x%05X\n", 0xFFC7EA46, 0xFFCCCCCC, hdr->ldr_size);
|
gfx_printf(&gfx_con, "%kNX Bootloader size: %k0x%05X\n\n", 0xFFC7EA46, 0xFFCCCCCC, hdr->ldr_size);
|
||||||
|
|
||||||
gfx_printf(&gfx_con, "%kSecure monitor addr: %k0x%05X\n", 0xFFC7EA46, 0xFFCCCCCC, pkg1_id->secmon_base);
|
gfx_printf(&gfx_con, "%kSecure monitor addr: %k0x%05X\n", 0xFFC7EA46, 0xFFCCCCCC, pkg1_id->secmon_base);
|
||||||
gfx_printf(&gfx_con, "%kSecure monitor size: %k0x%05X\n\n", 0xFFC7EA46, 0xFFCCCCCC, hdr->sm_size);
|
gfx_printf(&gfx_con, "%kSecure monitor size: %k0x%05X\n\n", 0xFFC7EA46, 0xFFCCCCCC, hdr->sm_size);
|
||||||
|
@ -1999,7 +1997,7 @@ void fix_sd_attr(u32 type)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
memcpy(path, "/", 2);
|
memcpy(path, "/", 2);
|
||||||
memcpy(label, "sd card", 8);
|
memcpy(label, "SD Card", 8);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
default:
|
default:
|
||||||
|
@ -2361,7 +2359,7 @@ ment_t ment_options[] = {
|
||||||
|
|
||||||
menu_t menu_options = {
|
menu_t menu_options = {
|
||||||
ment_options,
|
ment_options,
|
||||||
"Launch options", 0, 0
|
"Launch Options", 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
ment_t ment_cinfo[] = {
|
ment_t ment_cinfo[] = {
|
||||||
|
@ -2382,7 +2380,7 @@ ment_t ment_cinfo[] = {
|
||||||
};
|
};
|
||||||
menu_t menu_cinfo = {
|
menu_t menu_cinfo = {
|
||||||
ment_cinfo,
|
ment_cinfo,
|
||||||
"Console info", 0, 0
|
"Console Info", 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
ment_t ment_autorcm[] = {
|
ment_t ment_autorcm[] = {
|
||||||
|
@ -2421,7 +2419,7 @@ ment_t ment_restore[] = {
|
||||||
|
|
||||||
menu_t menu_restore = {
|
menu_t menu_restore = {
|
||||||
ment_restore,
|
ment_restore,
|
||||||
"Restore options", 0, 0
|
"Restore Options", 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
ment_t ment_backup[] = {
|
ment_t ment_backup[] = {
|
||||||
|
@ -2439,7 +2437,7 @@ ment_t ment_backup[] = {
|
||||||
|
|
||||||
menu_t menu_backup = {
|
menu_t menu_backup = {
|
||||||
ment_backup,
|
ment_backup,
|
||||||
"Backup options", 0, 0
|
"Backup Options", 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
ment_t ment_tools[] = {
|
ment_t ment_tools[] = {
|
||||||
|
|
1
ipl/se.c
1
ipl/se.c
|
@ -284,3 +284,4 @@ int se_calc_sha256(void *dst, const void *src, u32 src_size)
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,13 @@ u32 get_tmr_s()
|
||||||
u32 get_tmr_ms()
|
u32 get_tmr_ms()
|
||||||
{
|
{
|
||||||
// The registers must be read with the following order:
|
// The registers must be read with the following order:
|
||||||
// -> RTC_MILLI_SECONDS (0x10) -> RTC_SHADOW_SECONDS (0x8)
|
// -> RTC_MILLI_SECONDS (0x10) -> RTC_SHADOW_SECONDS (0xC)
|
||||||
return (RTC(0x10) | (RTC(0xC)<< 10));
|
return (RTC(0x10) | (RTC(0xC)<< 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 get_tmr_us()
|
u32 get_tmr_us()
|
||||||
{
|
{
|
||||||
return TMR(0x10); //TMRUS
|
return TMR(0x10); //TIMERUS_CNTR_1US
|
||||||
}
|
}
|
||||||
|
|
||||||
void msleep(u32 milliseconds)
|
void msleep(u32 milliseconds)
|
||||||
|
|
Loading…
Reference in a new issue