private static void CalculateRootPartitionHeaderSize(out long rootPartitionHeaderSize) { List <string> entryNameList = new List <string>() { "update", "normal", "secure" }; rootPartitionHeaderSize = HashNameEntryPartitionFsHeaderSource <Sha256PartitionFileSystemMeta> .GetDummySize(entryNameList); ProdEncryptedXciArchive.CheckAlignmentPageSize(rootPartitionHeaderSize); }
private static void CalculateUpdatePartitionSize(out long updatePartitionHeaderSize, out long updatePartitionSize, NintendoSubmissionPackageFileSystemInfo uppInfo) { List <string> entryNameList = new List <string>(); updatePartitionHeaderSize = HashNameEntryPartitionFsHeaderSource <Sha256PartitionFileSystemMeta> .GetDummySize(entryNameList); ProdEncryptedXciArchive.CheckAlignmentPageSize(updatePartitionHeaderSize); if (uppInfo != null) { updatePartitionSize = XciInfo.UpdatePartitionLimitSize; } else { updatePartitionSize = XciInfo.EmptyUpdatePartitionSize; } }
private static void CalculatePartitionSize(out long partitionHeaderSize, out long partitionSize, NintendoSubmissionPackageFileSystemInfo nspInfo, NintendoSubmissionPackageFileSystemInfo patchInfo, bool isNormal, KeyConfiguration keyConfig) { long num = 0; List <string> entryNameList = new List <string>(); for (int index1 = 0; index1 < nspInfo.Entries.Count; ++index1) { List <Tuple <ISource, NintendoContentInfo> > contentSourceList = new List <Tuple <ISource, NintendoContentInfo> >(); NintendoSubmissionPackageFileSystemInfo.EntryInfo entry = nspInfo.Entries[index1]; for (int index2 = 0; index2 < entry.Contents.Count; ++index2) { NintendoSubmissionPackageFileSystemInfo.ContentInfo content = entry.Contents[index2]; if ((!isNormal || !(content.ContentType != "Control")) && !(content.ContentType == "Meta")) { ISource source; if (content.FsInfo != null) { source = (ISource) new NintendoContentArchiveSource(content.FsInfo as NintendoContentFileSystemInfo, keyConfig, false); } else { if (content.Source == null) { throw new NotImplementedException(); } source = content.Source; } contentSourceList.Add(Tuple.Create <ISource, NintendoContentInfo>(source, new NintendoContentInfo(content.ContentType, source.Size))); entryNameList.Add("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.nca"); num += ProdEncryptedXciArchive.RoundupPageSize(source.Size); } } entryNameList.Add("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.cnmt.nca"); NintendoContentMetaArchiveSource metaArchiveSource = new NintendoContentMetaArchiveSource(entry.ContentMetaInfo == null ? new NintendoContentMetaBase(contentSourceList, entry.MetaType, entry.MetaFilePath) : new NintendoContentMetaBase(contentSourceList, entry.ContentMetaInfo.Data, entry.ContentMetaInfo.Model, true), entry.KeyIndex, keyConfig, nspInfo.IsProdEncryption, true); num += ProdEncryptedXciArchive.RoundupPageSize(metaArchiveSource.Size); } partitionHeaderSize = HashNameEntryPartitionFsHeaderSource <Sha256PartitionFileSystemMeta> .GetDummySize(entryNameList); ProdEncryptedXciArchive.CheckAlignmentPageSize(partitionHeaderSize); partitionSize = num; }