From 30802627861d7bb4ab95f96a78a4c44b9204ada6 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Thu, 29 Jun 2017 01:21:21 +0200 Subject: [PATCH] Fix empty SysNAND Virtual Drive for corrupted NCSD --- source/virtual/vnand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/virtual/vnand.c b/source/virtual/vnand.c index bd09c1c..4e4caa5 100644 --- a/source/virtual/vnand.c +++ b/source/virtual/vnand.c @@ -59,7 +59,11 @@ bool ReadVNandDir(VirtualFile* vfile, VirtualDir* vdir) { // uses a generic vdir NandPartitionInfo prt_info; // set up virtual file - if (GetNandPartitionInfo(&prt_info, template->type, template->subtype, template->index, nand_src) != 0) + if (template->flags & VFLAG_NAND_SIZE) { // override for "nand.bin" + prt_info.sector = 0; + prt_info.count = GetNandSizeSectors(nand_src); + prt_info.keyslot = 0xFF; + } else if (GetNandPartitionInfo(&prt_info, template->type, template->subtype, template->index, nand_src) != 0) continue; snprintf(vfile->name, 32, "%s%s", template->name, (nand_src == VRT_XORPAD) ? ".xorpad" : ""); vfile->offset = ((u64) prt_info.sector) * 0x200;