예제 #1
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(BfshaFileLoader loader)
        {
            ushort codeLength = loader.ReadUInt16();

            loader.Seek(6);
            uint[]  codeSizes   = loader.LoadCustom(() => loader.ReadUInt32s(codeLength));
            ulong[] codeOffsets = loader.LoadCustom(() => loader.ReadUInt64s(codeLength));
            loader.Seek(8); //reserved

            SourceData = new List <byte[]>();
            for (int i = 0; i < codeLength; i++)
            {
                loader.Seek((long)codeOffsets[i], System.IO.SeekOrigin.Begin);
                SourceData.Add(loader.ReadBytes((int)codeSizes[i]));
            }
        }
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(BfshaFileLoader loader)
        {
            loader.Seek(8); //always empty
            ulong[] codeOffsets = loader.ReadUInt64s(2);
            uint[]  codeSizes   = loader.ReadUInt32s(2);
            loader.Seek(32); //padding

            BinaryData = new List <byte[]>();
            for (int i = 0; i < 2; i++) //Fixed with 2 binaries
            {
                loader.Seek((long)codeOffsets[i], System.IO.SeekOrigin.Begin);
                if (i == 0)
                {
                    BinaryData.Add(loader.ReadBytes((int)codeSizes[1]));
                }
                else
                {
                    BinaryData.Add(loader.ReadBytes((int)codeSizes[0]));
                }
            }
        }