Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Commit

Permalink
now dumps online files needed for cemu
Browse files Browse the repository at this point in the history
  • Loading branch information
emiyl committed Apr 10, 2020
1 parent fafaa15 commit 8b790f0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 30 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export OBJCOPY := $(PREFIX)objcopy
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET := ft2sd
TARGET := dumpling
BUILD := build
BUILD_DBG := $(TARGET)_dbg
SOURCES := src \
src/dynamic_libs \
src/fs \
src/system \
src/utils
DATA :=
DATA :=

INCLUDES := src

Expand Down
65 changes: 38 additions & 27 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ int Menu_Main(void)
OSScreenFlipBuffersEx(0);
OSScreenFlipBuffersEx(1);

int res = IOSUHAX_Open();
int res = IOSUHAX_Open(NULL);
if(res < 0)
{
console_printf(1, "IOSUHAX_open failed\n");
console_printf(1, "IOSUHAX_open failed - Ensure you are using MochaCFW\n");
sleep(2);
return 0;
}
Expand All @@ -207,28 +207,37 @@ int Menu_Main(void)

int initScreen = 1;

static const char* paths_output[] =
{
"account.dat",
"ccerts",
"scerts",
"Miis",
"Friends List (JP)",
"Friends List (US)",
"Friends List (EU)",
};

static const char* selection_paths[] =
{
"/dev/odd01",
"/dev/odd02",
"/dev/odd03",
"/dev/odd04",
"/dev/slccmpt01",
"/vol/system",
"/vol/storage_mlc01",
"/vol/storage_usb01",
"/vol/storage_mlc01/usr/save/system/act/",
"/vol/storage_mlc01/sys/title/0005001b/10054000/content/ccerts",
"/vol/storage_mlc01/sys/title/0005001b/10054000/content/scerts",
"/vol/storage_mlc01/sys/title/0005001b/10056000/",
"/vol/storage_mlc01/sys/title/00050030/1001500A/",
"/vol/storage_mlc01/sys/title/00050030/1001510A/",
"/vol/storage_mlc01/sys/title/00050030/1001520A/",
};

static const char* selection_paths_description[] =
{
"(disc tickets)",
"(disc update)",
"(disc content)",
"(disc content)",
"(vWii slc content)",
"(slc content)",
"(mlc content)",
"(usb01 content)",
"",
"",
"",
"",
"(JP)",
"(US)",
"(EU)",
};

int selectedItem = 0;
Expand Down Expand Up @@ -262,21 +271,22 @@ int Menu_Main(void)
OSScreenClearBufferEx(1, 0);


console_print_pos(0, 1, "-- File Tree 2 SD v0.1 by Dimok --");
console_print_pos(0, 1, "-- Dumpling v0.0.1 by emiyl --");
console_print_pos(0, 2, "Based on FT2SD by Dimok");

console_print_pos(0, 3, "Select what to dump to sd:/ft2sd and press A to start dump.");
console_print_pos(0, 4, "Hold B to cancel dump.");
console_print_pos(0, 4, "Select what to dump to SD card and press A to start dump.");
console_print_pos(0, 5, "Hold B to cancel dump.");

u32 i;
for(i = 0; i < (sizeof(selection_paths) / 4); i++)
{
if(selectedItem == (int)i)
{
console_print_pos(0, 6 + i, "--> %s %s", selection_paths[i], selection_paths_description[i]);
console_print_pos(0, 7 + i, "--> %s %s", selection_paths[i], selection_paths_description[i]);
}
else
{
console_print_pos(0, 6 + i, " %s %s", selection_paths[i], selection_paths_description[i]);
console_print_pos(0, 7 + i, " %s %s", selection_paths[i], selection_paths_description[i]);
}
}
// Flip buffers
Expand All @@ -302,8 +312,8 @@ int Menu_Main(void)

if(vpadError == 0 && ((vpad.btns_d | vpad.btns_h) & VPAD_BUTTON_A))
{
const char *dev_path = (selectedItem < 5) ? selection_paths[selectedItem] : NULL;
const char *mount_path = (selectedItem >= 5) ? selection_paths[selectedItem] : "/vol/storage_ft_content";
const char *dev_path = (selectedItem < 0) ? selection_paths[selectedItem] : NULL;
const char *mount_path = (selectedItem >= 0) ? selection_paths[selectedItem] : "/vol/storage_ft_content";

int res = mount_fs("dev", fsaFd, dev_path, mount_path);
if(res < 0)
Expand All @@ -316,7 +326,9 @@ int Menu_Main(void)
if(targetPath)
{
strcpy(targetPath, "dev:/");
DumpDir(targetPath, "sd:/ft2sd");
char sdPath[255];
snprintf(sdPath, sizeof(sdPath), "sd:/dumpling%s", selection_paths[selectedItem]);
DumpDir(targetPath, sdPath);

free(targetPath);
}
Expand Down Expand Up @@ -364,4 +376,3 @@ int Menu_Main(void)

return EXIT_SUCCESS;
}

2 changes: 1 addition & 1 deletion src/sd_dumper.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int DumpDir(char *pPath, const char * target_path)
dir = opendir(pPath);
if (dir == NULL)
{
console_printf(1, "Can't open %s\n", pPath);
console_printf(1, "Can't open %s - Ensure you selected the correct region\n", pPath);
return -1;
}

Expand Down

0 comments on commit 8b790f0

Please sign in to comment.