public IStorage OpenFullNca(bool openEncrypted) { if (openEncrypted == IsEncrypted) { return(BaseStorage); } var builder = new ConcatenationStorageBuilder(); builder.Add(OpenHeaderStorage(openEncrypted), 0); if (Header.IsNca0()) { builder.Add(OpenNca0BodyStorage(openEncrypted), 0x400); return(builder.Build()); } for (int i = 0; i < NcaHeader.SectionCount; i++) { if (Header.IsSectionEnabled(i)) { builder.Add(OpenRawStorage(i, openEncrypted), Header.GetSectionStartOffset(i)); } } return(builder.Build()); }
public IStorage OpenDecryptedNca() { var builder = new ConcatenationStorageBuilder(); builder.Add(OpenDecryptedHeaderStorage(), 0); for (int i = 0; i < NcaHeader.SectionCount; i++) { if (Header.IsSectionEnabled(i)) { builder.Add(OpenRawStorage(i), Header.GetSectionStartOffset(i)); } } return(builder.Build()); }