mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-03 00:24:19 +01:00
*Saves flashed back to real NAND will now be unescaped the D2X cIOS way
NOTE: Wiiflow can not flash game saves back if illegal FAT characters are escaped out in a different way D2X does. Game saves extracted with Wiiflow are safe to flash back!
This commit is contained in:
parent
f3ae92cbc7
commit
40266a8909
@ -451,6 +451,32 @@ void Nand::__FATify(char *ptr, const char *str)
|
|||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Nand::__NANDify(char *str)
|
||||||
|
{
|
||||||
|
char *src = str;
|
||||||
|
char *dst = str;
|
||||||
|
char c;
|
||||||
|
|
||||||
|
while((c = *(src++)) != '\0')
|
||||||
|
{
|
||||||
|
if(c == '&')
|
||||||
|
{
|
||||||
|
if(!strncmp(src, "qt;", 3)) c = '"';
|
||||||
|
else if (!strncmp(src, "st;", 3)) c = '*';
|
||||||
|
else if (!strncmp(src, "cl;", 3)) c = ':';
|
||||||
|
else if (!strncmp(src, "lt;", 3)) c = '<';
|
||||||
|
else if (!strncmp(src, "gt;", 3)) c = '>';
|
||||||
|
else if (!strncmp(src, "qm;", 3)) c = '?';
|
||||||
|
else if (!strncmp(src, "vb;", 3)) c = '|';
|
||||||
|
|
||||||
|
if (c != '&')
|
||||||
|
src += 3;
|
||||||
|
}
|
||||||
|
*(dst++) = c;
|
||||||
|
}
|
||||||
|
*dst = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
s32 Nand::__FlashNandFile(const char *source, const char *dest)
|
s32 Nand::__FlashNandFile(const char *source, const char *dest)
|
||||||
{
|
{
|
||||||
s32 ret;
|
s32 ret;
|
||||||
@ -640,7 +666,6 @@ s32 Nand::__FlashNandFolder(const char *source, const char *dest)
|
|||||||
{
|
{
|
||||||
char nsource[MAX_FAT_PATH];
|
char nsource[MAX_FAT_PATH];
|
||||||
char ndest[ISFS_MAXPATH];
|
char ndest[ISFS_MAXPATH];
|
||||||
char tdest[ISFS_MAXPATH];
|
|
||||||
|
|
||||||
DIR *dir_iter;
|
DIR *dir_iter;
|
||||||
struct dirent *ent;
|
struct dirent *ent;
|
||||||
@ -666,10 +691,9 @@ s32 Nand::__FlashNandFolder(const char *source, const char *dest)
|
|||||||
|
|
||||||
if(ent->d_type == DT_DIR)
|
if(ent->d_type == DT_DIR)
|
||||||
{
|
{
|
||||||
//__FATify(tdest, ndest);
|
__NANDify(ndest);
|
||||||
if(!fake)
|
if(!fake)
|
||||||
{
|
{
|
||||||
//ISFS_CreateDir(tdest, 0, 3, 3, 3);
|
|
||||||
ISFS_CreateDir(ndest, 0, 3, 3, 3);
|
ISFS_CreateDir(ndest, 0, 3, 3, 3);
|
||||||
FoldersDone++;
|
FoldersDone++;
|
||||||
}
|
}
|
||||||
@ -677,8 +701,7 @@ s32 Nand::__FlashNandFolder(const char *source, const char *dest)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//__FATify(tdest, ndest);
|
__NANDify(ndest);
|
||||||
//__FlashNandFile(nsource, tdest);
|
|
||||||
__FlashNandFile(nsource, ndest);
|
__FlashNandFile(nsource, ndest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,7 @@ class Nand
|
|||||||
u32 __configsetbigarray(const char *item, void *val, u32 size);
|
u32 __configsetbigarray(const char *item, void *val, u32 size);
|
||||||
u32 __configsetsetting(const char *item, const char *val);
|
u32 __configsetsetting(const char *item, const char *val);
|
||||||
bool __FileExists(const char *path, ...);
|
bool __FileExists(const char *path, ...);
|
||||||
|
void __NANDify(char *str);
|
||||||
void __FATify(char *dst, const char *src);
|
void __FATify(char *dst, const char *src);
|
||||||
s32 __Unescaped2x(const char *path);
|
s32 __Unescaped2x(const char *path);
|
||||||
s32 __FlashNandFile(const char *source, const char *dest);
|
s32 __FlashNandFile(const char *source, const char *dest);
|
||||||
|
Loading…
Reference in New Issue
Block a user