diff --git a/src/LibHac.Nand/FatFileSystemDirectory.cs b/src/LibHac.Nand/FatFileSystemDirectory.cs index 7e5700c3..ba00a303 100644 --- a/src/LibHac.Nand/FatFileSystemDirectory.cs +++ b/src/LibHac.Nand/FatFileSystemDirectory.cs @@ -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) { diff --git a/src/NandReader/Program.cs b/src/NandReader/Program.cs index 4725e7b5..fcc49f72 100644 --- a/src/NandReader/Program.cs +++ b/src/NandReader/Program.cs @@ -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); + ; } }