Reread decrypted ExeFS headers (fixes #20)

This commit is contained in:
Matt Nadareski
2025-04-01 12:33:05 -04:00
parent e3a64ece96
commit 32b655b1f9

View File

@@ -325,6 +325,11 @@ namespace NDecrypt.Core
return;
}
// Reread the decrypted ExeFS header
uint exeFsHeaderOffset = cart.GetExeFSOffset(index);
input.Seek(exeFsHeaderOffset, SeekOrigin.Begin);
cart.ExeFSHeaders[index] = SabreTools.Serialization.Deserializers.N3DS.ParseExeFSHeader(input);
// Get the ExeFS header
var exeFsHeader = cart.ExeFSHeaders[index];
if (exeFsHeader?.FileHeaders == null)
@@ -333,8 +338,7 @@ namespace NDecrypt.Core
return;
}
// Get the ExeFS offset
uint exeFsHeaderOffset = cart.GetExeFSOffset(index);
// Get the ExeFS files offset
uint exeFsFilesOffset = exeFsHeaderOffset + cart.MediaUnitSize;
// Loop through and process all headers