nyx: Clear partition start when creating emuMMC

This commit is contained in:
CTCaer 2020-04-30 02:05:24 +03:00
parent 08c81fe1f8
commit e14a7d1d4d
4 changed files with 16 additions and 11 deletions

View file

@ -713,7 +713,7 @@ void dump_emmc_selected(emmcPartType_t dumpType, emmc_tool_gui_t *gui)
int res = 0;
u32 timer = 0;
char *txt_buf = (char *)malloc(0x1000);
char *txt_buf = (char *)malloc(0x4000);
gui->txt_buf = txt_buf;
s_printf(txt_buf, "");
@ -1259,7 +1259,7 @@ void restore_emmc_selected(emmcPartType_t restoreType, emmc_tool_gui_t *gui)
int res = 0;
u32 timer = 0;
char *txt_buf = (char *)malloc(0x1000);
char *txt_buf = (char *)malloc(0x4000);
gui->txt_buf = txt_buf;
s_printf(txt_buf, "");
@ -1296,8 +1296,7 @@ void restore_emmc_selected(emmcPartType_t restoreType, emmc_tool_gui_t *gui)
lv_mbox_set_text(warn_mbox, txt_buf);
manual_system_maintenance(true);
u32 btn = btn_wait();
if (!(btn & BTN_POWER))
if (!(btn_wait() & BTN_POWER))
{
lv_label_set_text(gui->label_info, "#FFDD00 Restore operation was aborted!#");
lv_obj_del(warn_mbox_bg);

View file

@ -24,6 +24,7 @@
#include "gui.h"
#include "fe_emummc_tools.h"
#include "../config/config.h"
#include "../config/ini.h"
#include "../libs/fatfs/ff.h"
#include "../mem/heap.h"
#include "../sec/se.h"
@ -347,7 +348,7 @@ void dump_emummc_file(emmc_tool_gui_t *gui)
int base_len = 0;
u32 timer = 0;
char *txt_buf = (char *)malloc(0x1000);
char *txt_buf = (char *)malloc(0x4000);
gui->txt_buf = txt_buf;
s_printf(txt_buf, "");
@ -635,7 +636,7 @@ void dump_emummc_raw(emmc_tool_gui_t *gui, int part_idx, u32 sector_start)
int res = 0;
u32 timer = 0;
char *txt_buf = (char *)malloc(0x1000);
char *txt_buf = (char *)malloc(0x4000);
gui->txt_buf = txt_buf;
s_printf(txt_buf, "");
@ -674,6 +675,11 @@ void dump_emummc_raw(emmc_tool_gui_t *gui, int part_idx, u32 sector_start)
memset(&bootPart, 0, sizeof(bootPart));
bootPart.lba_start = 0;
bootPart.lba_end = (BOOT_PART_SIZE / NX_EMMC_BLOCKSIZE) - 1;
// Clear partition start.
memset((u8 *)MIXD_BUF_ALIGNED, 0, 0x1000000);
sdmmc_storage_write(&sd_storage, sector_start - 0x8000, 0x8000, (u8 *)MIXD_BUF_ALIGNED);
for (i = 0; i < 2; i++)
{
strcpy(bootPart.name, "BOOT");

View file

@ -265,7 +265,7 @@ static lv_res_t _create_window_fuses_info_status(lv_obj_t *btn)
lv_obj_t * lb_val = lv_label_create(val, lb_desc);
char *txt_buf = (char *)malloc(0x1000);
char *txt_buf = (char *)malloc(0x4000);
// Decode fuses.
u8 burntFuses7 = 0;
@ -729,7 +729,7 @@ static lv_res_t _create_window_sdcard_info_status(lv_obj_t *btn)
lv_obj_t * lb_val = lv_label_create(val, lb_desc);
char *txt_buf = (char *)malloc(0x1000);
char *txt_buf = (char *)malloc(0x4000);
s_printf(txt_buf,"\n%02x\n%c%c\n%c%c%c%c%c\n%X\n%X\n%08x\n%02d/%04d",
sd_storage.cid.manfid, (sd_storage.cid.oemid >> 8) & 0xFF, sd_storage.cid.oemid & 0xFF,
@ -898,7 +898,7 @@ static lv_res_t _create_window_battery_status(lv_obj_t *btn)
lv_obj_t * lb_val = lv_label_create(val, lb_desc);
char *txt_buf = (char *)malloc(0x1000);
char *txt_buf = (char *)malloc(0x4000);
int value = 0;
max17050_get_property(MAX17050_RepSOC, &value);

View file

@ -342,8 +342,8 @@ static lv_res_t _create_window_dump_pk12_tool(lv_obj_t *btn)
u8 *pkg2 = NULL;
u8 kb = 0;
char *txt_buf = (char *)malloc(0x1000);
char *txt_buf2 = (char *)malloc(0x1000);
char *txt_buf = (char *)malloc(0x4000);
char *txt_buf2 = (char *)malloc(0x4000);
tsec_ctxt_t tsec_ctxt;