Beispiel #1
0
            public bool Equals(BPListTrailer other)
            {
                if (this.SortVersion != other.SortVersion)
                {
                    return false;
                }

                if (this.OffsetIntSize != other.OffsetIntSize)
                {
                    return false;
                }

                if (this.ObjectsRefSize != other.ObjectsRefSize)
                {
                    return false;
                }

                if (this.NumObjects != other.NumObjects)
                {
                    return false;
                }

                if (this.TopObject != other.TopObject)
                {
                    return false;
                }

                if (this.OffsetTableOffset != other.OffsetTableOffset)
                {
                    return false;
                }

                return true;
            }
Beispiel #2
0
        private static BPListTrailer ParseTrailer(byte[] plistData)
        {
            const int TrailerSize = 32;
            int trailerStartOffset = plistData.Length - TrailerSize;

            int dataPosition = trailerStartOffset;
            BPListTrailer trailer = new BPListTrailer();
            trailer.UnusedFields[0] = ByteConverter.ParseByte(plistData, ref dataPosition);
            trailer.UnusedFields[1] = ByteConverter.ParseByte(plistData, ref dataPosition);
            trailer.UnusedFields[2] = ByteConverter.ParseByte(plistData, ref dataPosition);
            trailer.UnusedFields[3] = ByteConverter.ParseByte(plistData, ref dataPosition);
            trailer.UnusedFields[4] = ByteConverter.ParseByte(plistData, ref dataPosition);

            trailer.SortVersion = ByteConverter.ParseByte(plistData, ref dataPosition);
            trailer.OffsetIntSize = ByteConverter.ParseByte(plistData, ref dataPosition);
            trailer.ObjectsRefSize = ByteConverter.ParseByte(plistData, ref dataPosition);

            trailer.NumObjects = ByteConverter.ParseUInt64(plistData, ref dataPosition);
            trailer.TopObject = ByteConverter.ParseUInt64(plistData, ref dataPosition);
            trailer.OffsetTableOffset = ByteConverter.ParseUInt64(plistData, ref dataPosition);

            return trailer;
        }