public ByteData PullData(long offset, int size)
        {
            ISource source = this.m_contentMetaBase.GetSource();
            NintendoContentMetaReader  contentMetaReader = new NintendoContentMetaReader(source.PullData(0L, (int)source.Size).Buffer.Array);
            List <NintendoContentInfo> contentInfoList   = contentMetaReader.GetContentInfoList();

            for (int index = 0; index < contentInfoList.Count; ++index)
            {
                NintendoContentInfo nintendoContentInfo = contentInfoList[index];
                this.m_model.ContentList[index].SetIdBytes(nintendoContentInfo.Id);
                this.m_model.ContentList[index].SetHashBytes(nintendoContentInfo.Hash);
            }
            this.m_model.SetDigestBytes(contentMetaReader.GetDigest());
            ByteData byteData = this.m_MetaHashSource.PullData(0L, NintendoContentMeta.GetContentInfoHashSize());

            this.m_MetaModel.SetIdBytes(byteData.Buffer.Array);
            this.m_MetaModel.SetHashBytes(byteData.Buffer.Array);
            byte[] bytes = this.GetBytes();
            return(new MemorySource(bytes, 0, bytes.Length).PullData(offset, size));
        }
Пример #2
0
        private static ContentMetaDescriptor ExtractContentMetaDescriptor(byte[] buffer, ContentMetaModel model, List <NintendoContentInfo> contentInfoList)
        {
            NintendoContentMetaReader contentMetaReader = new NintendoContentMetaReader(buffer);
            NintendoExtendedHeader    extendedHeader    = contentMetaReader.GetExtendedHeader();

            if (contentMetaReader.GetType() == "AddOnContent")
            {
                (extendedHeader as NintendoAddOnContentExtendedHeader).Tag = (model as AddOnContentContentMetaModel).Tag;
            }
            return(new ContentMetaDescriptor(contentMetaReader.GetType(), contentMetaReader.GetId(), contentMetaReader.GetVersion(), contentMetaReader.GetAttributes(), contentMetaReader.GetApplicationId(), contentMetaReader.GetRequiredDownloadSystemVersion(), contentInfoList, contentMetaReader.GetContentMetaInfoList(), extendedHeader, contentMetaReader.GetDigest()));
        }