Allow mounting public.sav files

This commit is contained in:
d0k3 2016-12-07 14:23:01 +01:00
parent bb05242494
commit 68b81ade76

View File

@ -23,7 +23,8 @@ u32 IdentifyFileType(const char* path) {
return IMG_NAND; // NAND image
} else if (getbe16(header + 0x1FE) == 0x55AA) { // migt be FAT or MBR
if ((strncmp((char*) header + 0x36, "FAT12 ", 8) == 0) || (strncmp((char*) header + 0x36, "FAT16 ", 8) == 0) ||
(strncmp((char*) header + 0x36, "FAT ", 8) == 0) || (strncmp((char*) header + 0x52, "FAT32 ", 8) == 0)) {
(strncmp((char*) header + 0x36, "FAT ", 8) == 0) || (strncmp((char*) header + 0x52, "FAT32 ", 8) == 0) ||
((getle64(header + 0x36) == 0) && (getle16(header + 0x0B) == 0x20))) { // last one is a special case for public.sav
return IMG_FAT; // this is an actual FAT header
} else if (((getle32(header + 0x1BE + 0x8) + getle32(header + 0x1BE + 0xC)) < (fsize / 0x200)) && // check file size
(getle32(header + 0x1BE + 0x8) > 0) && (getle32(header + 0x1BE + 0xC) >= 0x800) && // check first partition sanity