cleanup of mmc restores/dumps

This commit is contained in:
Such Meme, Many Skill
2020-04-05 16:07:25 +02:00
parent c2a2694baf
commit 6551930233
11 changed files with 110 additions and 100 deletions

View File

@@ -146,9 +146,8 @@ int filemenu(menu_entry file){
SETBIT(fs_menu_file[7].property, ISHIDE, !(strstr(file.name, ".bin") != NULL && file.property & ISKB));
SETBIT(fs_menu_file[8].property, ISHIDE, !(strstr(file.name, ".te") != NULL));
SETBIT(fs_menu_file[10].property, ISHIDE, !(strstr(file.name, ".bis") != NULL));
SETBIT(fs_menu_file[11].property, ISHIDE, !(strstr(file.name, ".bis") != NULL));
temp = menu_make(fs_menu_file, 12, "-- File Menu --");
temp = menu_make(fs_menu_file, 11, "-- File Menu --");
switch (temp){
case FILE_COPY:
@@ -177,9 +176,6 @@ int filemenu(menu_entry file){
fsreader_readfolder(currentpath);
btn_wait();
break;
case FILE_RESTOREBIS:
restore_bis_using_file(fsutil_getnextloc(currentpath, file.name), SYSMMC);
break;
case -1:
return -1;
}

View File

@@ -12,6 +12,7 @@
#include "../../storage/nx_emmc.h"
#include "../common/types.h"
#include "../utils/utils.h"
#include "fsactions.h"
u32 DecodeInt(u8* data) {
u32 out = 0;
@@ -55,6 +56,7 @@ int extract_bis_file(char *path, char *outfolder){
u8 args;
u8 temp[0x4];
u32 filesizes[4];
char *tempPath;
if ((res = f_open(&in, path, FA_READ | FA_OPEN_EXISTING))){
gfx_errDisplay("extract_bis_file", res, 0);
@@ -71,21 +73,35 @@ int extract_bis_file(char *path, char *outfolder){
gfx_printf("Version: %s\n\n", version);
gfx_printf("\nExtracting BOOT0\n");
if (args & BOOT0_ARG)
if (args & BOOT0_ARG){
gfx_printf("\nExtracting BOOT0\n");
gen_part(filesizes[0], &in, fsutil_getnextloc(outfolder, "BOOT0.bin"));
gfx_printf("Extracting BOOT1\n");
if (args & BOOT1_ARG)
}
if (args & BOOT1_ARG){
gfx_printf("Extracting BOOT1\n");
gen_part(filesizes[1], &in, fsutil_getnextloc(outfolder, "BOOT1.bin"));
}
gfx_printf("Extracting BCPKG2_1\n");
if (args & BCPKG2_1_ARG)
gen_part(filesizes[2], &in, fsutil_getnextloc(outfolder, "BCPKG2-1-Normal-Main"));
if (args & BCPKG2_1_ARG){
utils_copystring(fsutil_getnextloc(outfolder, "BCPKG2-1-Normal-Main"), &tempPath);
gfx_printf("Extracting BCPKG2_1/2\n");
gfx_printf("Extracting BCPKG2_3\n");
if (args & BCPKG2_3_ARG)
gen_part(filesizes[3], &in, fsutil_getnextloc(outfolder, "BCPKG2-3-SafeMode-Main"));
gen_part(filesizes[2], &in, tempPath);
fsact_copy(tempPath, fsutil_getnextloc(outfolder, "BCPKG2-2-Normal-Sub"), COPY_MODE_PRINT);
RESETCOLOR;
free(tempPath);
}
if (args & BCPKG2_3_ARG){
utils_copystring(fsutil_getnextloc(outfolder, "BCPKG2-3-SafeMode-Main"), &tempPath);
gfx_printf("Extracting BCPKG2_3/4\n");
gen_part(filesizes[3], &in, tempPath);
fsact_copy(tempPath, fsutil_getnextloc(outfolder, "BCPKG2-4-SafeMode-Sub"), COPY_MODE_PRINT);
RESETCOLOR;
free(tempPath);
}
gfx_printf("\n\nDone!\n");