Пример #1
0
        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());
        }
Пример #2
0
        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());
        }