Beispiel #1
0
        public void Deserialize(BitReader reader)
        {
            magicNumber = reader.ReadUInt32();
            version     = reader.ReadUInt16();
            reserved    = reader.ReadUInt16();
            macOsX      = Encoding.ASCII.GetString(reader.ReadBytes(16));
            numEntries  = reader.ReadUInt16();

            for (int i = 0; i < entries.Length; i++)
            {
                entries[i] = new Entry(reader);
            }
        }
Beispiel #2
0
        public void Deserialize(BitReader reader)
        {
            valueOffset = reader.ReadUInt32();
            valueLen    = reader.ReadUInt32();
            unknown     = reader.ReadUInt16();
            _nameLen    = reader.ReadByte();
            name        = Encoding.ASCII.GetString(reader.ReadBytes(_nameLen));
            padding     = reader.Pad();
            int position = reader.GetPosition();

            reader.SetPosition((int)valueOffset);

            string valueType = Encoding.ASCII.GetString(reader.ReadBytes(6));

            switch (valueType)
            {
            case "bplist":
                value = new BinaryPropertyList(reader);
                break;

            default:
                Console.WriteLine($"Unsupported attribute value type : '{valueType}'");
                break;
            }

            reader.SetPosition(position);
        }