add dump to sd file option
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include "../storage/sdmmc.h"
|
||||
#include "graphics.h"
|
||||
|
||||
|
||||
void utils_gfx_init(){
|
||||
display_backlight_brightness(100, 1000);
|
||||
gfx_clear_grey(0x1B);
|
||||
@@ -26,6 +25,25 @@ void removepartpath(char *path, char *root){
|
||||
if (strcmp(path, root) == 0) strcpy(path, temproot);
|
||||
}
|
||||
|
||||
int dumptosd(const char *path){
|
||||
f_mkdir("sd:/tegraexplorer");
|
||||
f_mkdir("sd:/tegraexplorer/nanddump");
|
||||
FILINFO fno;
|
||||
int res = 0;
|
||||
f_stat(path, &fno);
|
||||
char pathname[PATHSIZE];
|
||||
char foldername[75];
|
||||
strcpy(pathname, path);
|
||||
removepartpath(pathname, "emmc:");
|
||||
strcpy(foldername, strrchr(pathname, '/'));
|
||||
if (strcmp(foldername, "/") == 0) strcpy(foldername, "/root");
|
||||
sprintf(pathname, "%s%s", "sd:/tegraexplorer/nanddump", foldername);
|
||||
f_mkdir(pathname);
|
||||
sprintf(pathname, "%s%s%s%s", "sd:/tegraexplorer/nanddump", foldername, "/", fno.fname);
|
||||
res = copy(path, pathname);
|
||||
return res;
|
||||
}
|
||||
|
||||
void addpartpath(char *path, char *add, char *root){
|
||||
if (strcmp(path, root) != 0) strcat(path, "/");
|
||||
strcat(path, add);
|
||||
@@ -153,7 +171,6 @@ int copy(const char *src, const char *dst){
|
||||
f_unlink(dst);
|
||||
}
|
||||
|
||||
|
||||
free(buff);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user