Beispiel #1
0
        public unsafe NintendoContentMetaReader(byte[] buffer)
        {
            this.m_Size = (uint)buffer.Length;
            // ISSUE: explicit constructor call
            base.\u002Ector();
            NintendoContentMetaReader contentMetaReader = this;

            contentMetaReader.m_Buffer = (sbyte *)\u003CModule\u003E.new\u005B\u005D(contentMetaReader.m_Size);
            fixed(byte *numPtr = &buffer[0])
            {
                // ISSUE: cast to a reference type
                // ISSUE: cpblk instruction
                __memcpy((IntPtr)this.m_Buffer, (byte *)numPtr, (int)this.m_Size);
                PackagedContentMetaReader *contentMetaReaderPtr1 = (PackagedContentMetaReader *)\u003CModule\u003E.@new(12U);
                PackagedContentMetaReader *contentMetaReaderPtr2;

                if ((IntPtr)contentMetaReaderPtr1 != IntPtr.Zero)
                {
                    uint  size    = this.m_Size;
                    void *buffer1 = (void *)this.m_Buffer;
                    *(sbyte *)contentMetaReaderPtr1             = (sbyte)1;
                    *(int *)((IntPtr)contentMetaReaderPtr1 + 4) = (int)buffer1;
                    *(int *)((IntPtr)contentMetaReaderPtr1 + 8) = (int)size;
                    contentMetaReaderPtr2 = contentMetaReaderPtr1;
                }
                else
                {
                    contentMetaReaderPtr2 = (PackagedContentMetaReader *)0;
                }
                this.m_Reader = contentMetaReaderPtr2;
                GC.KeepAlive((object)this);
            }
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }