Work around DiscUtil's quirks

This commit is contained in:
Alex Barney 2019-03-12 17:02:16 -05:00
parent d157619ad5
commit 85a3b56902
2 changed files with 4 additions and 3 deletions

View file

@ -35,8 +35,8 @@ namespace LibHac.Nand
if (!CanReturnEntry(isDir, Mode)) continue;
DirectoryEntryType type = isDir ? DirectoryEntryType.File : DirectoryEntryType.Directory;
long length = isDir ? 0 : ((DiscFileInfo)entry).Length;
DirectoryEntryType type = isDir ? DirectoryEntryType.Directory : DirectoryEntryType.File;
long length = isDir ? 0 : entry.FileSystem.GetFileLength(entry.FullName);
yield return new DirectoryEntry(entry.Name, FullPath + '/' + entry.Name, type, length)
{

View file

@ -18,7 +18,7 @@ namespace NandReader
Console.WriteLine("Usage: NandReader raw_nand_dump_file");
return;
}
GetTitleKeys(args[0]);
ReadSwitchFs(args[0]);
}
private static void GetTitleKeys(string nandFile)
@ -51,6 +51,7 @@ namespace NandReader
var nand = new Nand(stream, keyset);
FatFileSystemProvider user = nand.OpenSystemPartition();
SwitchFs sdfs = SwitchFs.OpenNandPartition(keyset, user);
;
}
}