Пример #1
0
        public override void Read(PkgBinaryReader reader)
        {
            valueOffsetType = reader.ReadOffsetType();


            if (valueOffsetType.Type == 128)
            {
                long pos = reader.BaseStream.Position;
                reader.Seek(valueOffsetType.Offset, SeekOrigin.Begin);

                string chunkType = reader.ReadString(4);
                switch (chunkType)
                {
                case "!idi":
                    complexValueData = new PkgObject(ParentFile);
                    complexValueData.Read(reader);
                    break;

                case "!ili":
                    complexValueData = new PkgArray(ParentFile);
                    complexValueData.Read(reader);
                    break;

                case "!iar":
                    complexValueData = new PkgDataArrayReference(ParentFile);
                    complexValueData.Read(reader);
                    break;

                case "!vca":
                    complexValueData = new PkgDataArray(ParentFile);
                    complexValueData.Read(reader);
                    break;

                case "!sbi":
                    complexValueData = PkgData.Create(ParentFile, "stri");
                    complexValueData.Read(reader);
                    break;

                case "!vbi":
                    complexValueData = PkgData.Create(reader, ParentFile);
                    complexValueData.Read(reader);
                    break;

                default:
                    throw new Exception("Chunk type not supported! " + chunkType);
                }

                reader.Seek((int)pos, SeekOrigin.Begin);
            }
        }
Пример #2
0
        public override void Read(PkgBinaryReader reader)
        {
            var elemVerData = reader.ReadOffsetType();
            var numElements = elemVerData.Offset;

            Version = elemVerData.Type;

            for (var i = 0; i < numElements; ++i)
            {
                PkgPairBase val;
                if (Version == 0)
                {
                    val = new PkgPair(ParentFile);
                }
                else
                {
                    val = new PkgPairV1(ParentFile);
                }

                Elements.Add(val);
                val.Read(reader);
            }
        }
Пример #3
0
 public override void Read(PkgBinaryReader reader)
 {
     NameOffsetType = reader.ReadOffsetType();
     base.Read(reader);
     Unknown = reader.ReadUInt32();
 }
Пример #4
0
 public override void Read(PkgBinaryReader reader)
 {
     nameOffsetType = reader.ReadOffsetType();
     base.Read(reader);
 }