1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-12-26 11:26:05 +00:00

Misc changes

This commit is contained in:
Such Meme, Many Skill 2020-03-17 00:26:35 +01:00
parent 3f6d1b532c
commit 761ceb7dbe
5 changed files with 34 additions and 9 deletions

View file

@ -10,6 +10,7 @@
#include "../utils/util.h"
#include "io.h"
#include "script.h"
#include "te.h"
fs_entry *fileobjects;
char rootpath[10] = "";
@ -19,7 +20,7 @@ u8 clipboardhelper = 0;
extern const char sizevalues[4][3];
extern int launch_payload(char *path);
menu_item explfilemenu[12] = {
menu_item explfilemenu[13] = {
{"-- File Menu --", COLOR_BLUE, -1, 0},
{"FILE", COLOR_GREEN, -1, 0},
{"\nSIZE", COLOR_VIOLET, -1, 0},
@ -31,7 +32,8 @@ menu_item explfilemenu[12] = {
{"Launch Payload", COLOR_ORANGE, PAYLOAD, 1},
{"Launch Script", COLOR_YELLOW, SCRIPT, 1},
{"View Hex", COLOR_GREEN, HEXVIEW, 1},
{"Extract Bis", COLOR_RED, DUMPBIS, 1}
{"Extract BIS", COLOR_RED, DUMPBIS, 1},
{"Restore BIS", COLOR_RED, RESTOREBIS, 1}
};
menu_item explfoldermenu[6] = {
@ -317,12 +319,16 @@ int filemenu(fs_entry file){
else
explfilemenu[9].property = -1;
if (strstr(file.name, ".bis") != NULL)
if (strstr(file.name, ".bis") != NULL){
explfilemenu[11].property = 1;
else
explfilemenu[12].property = 1;
}
else {
explfilemenu[11].property = -1;
explfilemenu[12].property = -1;
}
temp = makemenu(explfilemenu, 12);
temp = makemenu(explfilemenu, 13);
switch (temp){
case COPY:
@ -348,6 +354,9 @@ int filemenu(fs_entry file){
extract_bis_file(getnextloc(currentpath, file.name), currentpath);
btn_wait();
break;
case RESTOREBIS:
message(COLOR_ORANGE, "Stubbed");
break;
}
return 0;

View file

@ -36,7 +36,8 @@ enum filemenuoptions {
PAYLOAD,
SCRIPT,
HEXVIEW,
DUMPBIS
DUMPBIS,
RESTOREBIS
};
enum foldermenuoptions {

View file

@ -10,6 +10,8 @@
#include "../mem/minerva.h"
#include "../power/max17050.h"
#include <stdarg.h>
#include "../storage/emummc.h"
#include "emmc.h"
const char fixedoptions[3][50] = {
"Folder -> previous folder ",
@ -136,6 +138,16 @@ int makewaitmenunoclear(char *initialmessage, char *hiddenmessage, int timer){
}
}
/*
int mmcChoiceMenu(){
if (emu_cfg.enabled){
}
return SYSMMC;
}
*/
void gfx_print_length(int size, char *toprint){
char *temp;
temp = (char*) malloc (size + 1);

View file

@ -375,6 +375,11 @@ int restore_emmc_part(char *path, sdmmc_storage_t *mmcstorage, emmc_part_t *part
buf = calloc(16384, sizeof(u8));
if (!buf){
message(COLOR_RED, "Calloc returned null!");
return -1;
}
if ((res = f_stat(path, &fno))){
message(COLOR_RED, "f_stat() failed! err: %d", res);
return -1;
@ -430,7 +435,7 @@ int restore_emmc_part(char *path, sdmmc_storage_t *mmcstorage, emmc_part_t *part
totalSectors -= num;
bytesWritten += num * NX_EMMC_BLOCKSIZE;
pct = (u64)((u64)(lba_curr - part->lba_start) * 100u) / (u64)(part->lba_end - part->lba_start);
pct = (u64)((u64)(bytesWritten) * 100u) / (u64)(fno.fsize);
gfx_printf("Progress: %d%%\r", pct);
}
@ -457,7 +462,6 @@ int restore_emmc_file(char *path, const char *target, u8 partition, u8 mmctype){
restore_emmc_part(path, &storage, &bootPart);
}
else {
sdmmc_storage_set_mmc_partition(&storage, partition);
if (connect_part(target)){
message(COLOR_RED, "Find of partition failed!\nPart: %s", target);
return -1;

View file

@ -130,7 +130,6 @@ void MainMenu_Tools(){
dump_emmc_parts(PART_BOOT | PART_PKG2, SYSMMC);
break;
case RESTORE_BOOT:
SWAPCOLOR(COLOR_ORANGE);
if (makewaitmenu(
"WARNING!\nThis will mess with your switch boot files\nMake a nand backup beforehand!\n\nThis will pull from path:\nsd:/tegraexplorer/boot.bis\n\nVol +/- to cancel\n",
"Power to confirm",