mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Block crappy "._" files from getting recognized as filetype
This commit is contained in:
parent
64407f1604
commit
ef9ba1a5a5
@ -18,10 +18,15 @@ u64 IdentifyFileType(const char* path) {
|
||||
char* fname = strrchr(path, '/');
|
||||
char* ext = (fname) ? strrchr(++fname, '.') : NULL;
|
||||
u32 id = 0;
|
||||
|
||||
|
||||
// block crappy "._" files from getting recognized as filetype
|
||||
if (strncmp(fname, "._", 2)) return 0;
|
||||
|
||||
if (ext) ext++;
|
||||
if (FileGetData(path, header, 0x200, 0) < min(0x200, fsize)) return 0;
|
||||
|
||||
if (!fsize) return 0;
|
||||
|
||||
if (fsize >= 0x200) {
|
||||
if (ValidateNandNcsdHeader((NandNcsdHeader*) data) == 0) {
|
||||
return (fsize >= GetNandNcsdMinSizeSectors((NandNcsdHeader*) data) * 0x200) ?
|
||||
|
Loading…
x
Reference in New Issue
Block a user