Ejemplo n.º 1
0
        public unsafe uint GetVersion()
        {
            ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *reader = (ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)this.m_Reader;

            if (*(byte *)reader == (byte)0)
            {
                \u003CModule\u003E.abort();
            }
            int num1 = *(int *)((IntPtr)reader + 4);

            GC.KeepAlive((object)this);
            int num2 = 8;

            return((uint)*(int *)(num1 + num2));
        }
Ejemplo n.º 2
0
        public unsafe ulong GetId()
        {
            ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *reader = (ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)this.m_Reader;

            if (*(byte *)reader == (byte)0)
            {
                \u003CModule\u003E.abort();
            }
            int num = *(int *)((IntPtr)reader + 4);

            GC.KeepAlive((object)this);
            return((ulong)*(long *)num);
        }
Ejemplo n.º 3
0
        public unsafe string GetType()
        {
            ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *reader = (ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)this.m_Reader;

            if (*(byte *)reader == (byte)0)
            {
                \u003CModule\u003E.abort();
            }
            string str = NintendoContentMetaReader.ConvertMetaType((ContentMetaType) * (byte *)(*(int *)((IntPtr)reader + 4) + 12));

            GC.KeepAlive((object)this);
            return(str);
        }
Ejemplo n.º 4
0
        public unsafe NintendoExtendedHeader GetExtendedHeader()
        {
            PackagedContentMetaReader *reader = this.m_Reader;
            ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *packagedContentInfoPtr = (ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)reader;

            if (*(byte *)packagedContentInfoPtr == (byte)0)
            {
                \u003CModule\u003E.abort();
            }
            switch (*(byte *)(*(int *)((IntPtr)packagedContentInfoPtr + 4) + 12))
            {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
                GC.KeepAlive((object)this);
                return((NintendoExtendedHeader)null);

            case 128:
                ApplicationMetaExtendedHeader *   metaExtendedHeaderPtr1    = (ApplicationMetaExtendedHeader *)(*(int *)((IntPtr)reader + 4) + 32);
                NintendoApplicationExtendedHeader applicationExtendedHeader = new NintendoApplicationExtendedHeader((ulong)*(long *)metaExtendedHeaderPtr1, (uint)*(int *)((IntPtr)metaExtendedHeaderPtr1 + 8));
                GC.KeepAlive((object)this);
                return((NintendoExtendedHeader)applicationExtendedHeader);

            case 129:
                PatchMetaExtendedHeader *   metaExtendedHeaderPtr2 = (PatchMetaExtendedHeader *)(*(int *)((IntPtr)reader + 4) + 32);
                NintendoPatchExtendedHeader patchExtendedHeader    = new NintendoPatchExtendedHeader((ulong)*(long *)metaExtendedHeaderPtr2, (uint)*(int *)((IntPtr)metaExtendedHeaderPtr2 + 8));
                GC.KeepAlive((object)this);
                return((NintendoExtendedHeader)patchExtendedHeader);

            case 130:
                AddOnContentMetaExtendedHeader *   metaExtendedHeaderPtr3 = (AddOnContentMetaExtendedHeader *)(*(int *)((IntPtr)reader + 4) + 32);
                NintendoAddOnContentExtendedHeader contentExtendedHeader  = new NintendoAddOnContentExtendedHeader((ulong)*(long *)metaExtendedHeaderPtr3, (uint)*(int *)((IntPtr)metaExtendedHeaderPtr3 + 8), (string)null);
                GC.KeepAlive((object)this);
                return((NintendoExtendedHeader)contentExtendedHeader);

            default:
                throw new ArgumentException(string.Format("Unknown content meta type."));
            }
        }
Ejemplo n.º 5
0
        public unsafe List <NintendoContentMetaInfo> GetContentMetaInfoList()
        {
            List <NintendoContentMetaInfo> nintendoContentMetaInfoList = new List <NintendoContentMetaInfo>();
            int index = 0;
            PackagedContentMetaReader *reader = this.m_Reader;
            ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *packagedContentInfoPtr = (ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)reader;

            if (*(byte *)packagedContentInfoPtr != (byte)0)
            {
                while (index < (int)*(ushort *)(*(int *)((IntPtr)packagedContentInfoPtr + 4) + 18))
                {
                    ContentMetaInfo *       contentMetaInfo         = \u003CModule\u003E.nn\u002Encm\u002EContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E\u002EGetContentMetaInfo((ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)reader, index);
                    NintendoContentMetaInfo nintendoContentMetaInfo = new NintendoContentMetaInfo(NintendoContentMetaReader.ConvertMetaType((ContentMetaType) * (byte *)((IntPtr)contentMetaInfo + 12)), (ulong)*(long *)contentMetaInfo, (uint)*(int *)((IntPtr)contentMetaInfo + 8), *(byte *)((IntPtr)contentMetaInfo + 13));
                    nintendoContentMetaInfoList.Add(nintendoContentMetaInfo);
                    ++index;
                    reader = this.m_Reader;
                    packagedContentInfoPtr = (ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)reader;
                    if (*(byte *)packagedContentInfoPtr == (byte)0)
                    {
                        goto label_3;
                    }
                }
                goto label_4;
            }
label_3:
            \u003CModule\u003E.abort();
label_4:
            GC.KeepAlive((object)this);
            return(nintendoContentMetaInfoList);
        }
Ejemplo n.º 6
0
        public unsafe List <NintendoContentInfo> GetContentInfoList()
        {
            List <NintendoContentInfo> nintendoContentInfoList = new List <NintendoContentInfo>();
            int index = 0;
            PackagedContentMetaReader *reader = this.m_Reader;
            ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *packagedContentInfoPtr = (ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)reader;

            if (*(byte *)packagedContentInfoPtr != (byte)0)
            {
                while (index < (int)*(ushort *)(*(int *)((IntPtr)packagedContentInfoPtr + 4) + 16))
                {
                    PackagedContentInfo *contentInfo = \u003CModule\u003E.nn\u002Encm\u002EContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E\u002EGetContentInfo((ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)reader, index);
                    byte[] id = new byte[16];
                    fixed(byte *numPtr1 = &id[0])
                    {
                        // ISSUE: cast to a reference type
                        // ISSUE: cpblk instruction
                        __memcpy((byte *)numPtr1, (IntPtr)contentInfo + 32, 16);
                        byte[] hash = new byte[32];
                        fixed(byte *numPtr2 = &hash[0])
                        {
                            // ISSUE: cast to a reference type
                            // ISSUE: cpblk instruction
                            __memcpy((byte *)numPtr2, (IntPtr)contentInfo, 32);
                            ContentInfo *       contentInfoPtr      = (ContentInfo *)((IntPtr)contentInfo + 32);
                            long                size                = (long)*(ushort *)((IntPtr)contentInfoPtr + 20) * 4294967296L + (long)(uint)*(int *)((IntPtr)contentInfoPtr + 16);
                            NintendoContentInfo nintendoContentInfo = new NintendoContentInfo(NintendoContentMetaReader.ConvertType((ContentType) * (byte *)((IntPtr)contentInfo + 54)), id, size, hash);

                            nintendoContentInfoList.Add(nintendoContentInfo);
                            ++index;
                            reader = this.m_Reader;
                            packagedContentInfoPtr = (ContentMetaAccessorBase\u003Cnn\u003A\u003Ancm\u003A\u003APackagedContentMetaHeader\u002Cnn\u003A\u003Ancm\u003A\u003APackagedContentInfo\u003E *)reader;
                            if (*(byte *)packagedContentInfoPtr == (byte)0)
                            {
                                goto label_3;
                            }
                        }
                    }
                }
                goto label_4;
            }
label_3:
            \u003CModule\u003E.abort();
label_4:
            GC.KeepAlive((object)this);
            return(nintendoContentInfoList);
        }