parseBinary() private static method

private static parseBinary ( int objRef ) : object
objRef int
return object
コード例 #1
0
ファイル: Plist.cs プロジェクト: bandy101/MK.MobileDevice
        // Token: 0x06000122 RID: 290 RVA: 0x00007EC0 File Offset: 0x000060C0
        private static object parseBinaryDictionary(int objRef)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();
            List <int> list = new List <int>();
            int        num;
            int        count = Plist.getCount(Plist.offsetTable[objRef], out num);

            if (count < 15)
            {
                num = Plist.offsetTable[objRef] + 1;
            }
            else
            {
                num = Plist.offsetTable[objRef] + 2 + Plist.RegulateNullBytes(BitConverter.GetBytes(count), 1).Length;
            }
            for (int i = num; i < num + count * 2 * Plist.objRefSize; i += Plist.objRefSize)
            {
                byte[] array = Plist.objectTable.GetRange(i, Plist.objRefSize).ToArray();
                Array.Reverse(array);
                list.Add(BitConverter.ToInt32(Plist.RegulateNullBytes(array, 4), 0));
            }
            for (int i = 0; i < count; i++)
            {
                dictionary.Add((string)Plist.parseBinary(list[i]), Plist.parseBinary(list[i + count]));
            }
            return(dictionary);
        }
コード例 #2
0
        private static object readBinary(byte[] data)
        {
            Plist.offsetTable.Clear();
            List <byte> byteList1 = new List <byte>();

            Plist.objectTable.Clear();
            Plist.refCount          = 0;
            Plist.objRefSize        = 0;
            Plist.offsetByteSize    = 0;
            Plist.offsetTableOffset = 0L;
            List <byte> byteList2 = new List <byte>((IEnumerable <byte>)data);

            Plist.parseTrailer(byteList2.GetRange(byteList2.Count - 32, 32));
            Plist.objectTable = byteList2.GetRange(0, (int)Plist.offsetTableOffset);
            Plist.parseOffsetTable(byteList2.GetRange((int)Plist.offsetTableOffset, byteList2.Count - (int)Plist.offsetTableOffset - 32));
            return(Plist.parseBinary(0));
        }
コード例 #3
0
ファイル: Plist.cs プロジェクト: bandy101/MK.MobileDevice
        // Token: 0x0600010D RID: 269 RVA: 0x00006E90 File Offset: 0x00005090
        private static object readBinary(byte[] data)
        {
            Plist.offsetTable.Clear();
            List <byte> offsetTableBytes = new List <byte>();

            Plist.objectTable.Clear();
            Plist.refCount          = 0;
            Plist.objRefSize        = 0;
            Plist.offsetByteSize    = 0;
            Plist.offsetTableOffset = 0L;
            List <byte> list  = new List <byte>(data);
            List <byte> range = list.GetRange(list.Count - 32, 32);

            Plist.parseTrailer(range);
            Plist.objectTable = list.GetRange(0, (int)Plist.offsetTableOffset);
            offsetTableBytes  = list.GetRange((int)Plist.offsetTableOffset, list.Count - (int)Plist.offsetTableOffset - 32);
            Plist.parseOffsetTable(offsetTableBytes);
            return(Plist.parseBinary(0));
        }
コード例 #4
0
        private static object parseBinaryArray(int objRef)
        {
            List <object> objectList = new List <object>();
            List <int>    intList    = new List <int>();
            int           num1       = (int)Plist.objectTable[Plist.offsetTable[objRef]];
            int           newBytePosition;
            int           count  = Plist.getCount(Plist.offsetTable[objRef], out newBytePosition);
            int           num2   = count >= 15 ? Plist.offsetTable[objRef] + 2 + Plist.RegulateNullBytes(BitConverter.GetBytes(count), 1).Length : Plist.offsetTable[objRef] + 1;
            int           index1 = num2;

            while (index1 < num2 + count * Plist.objRefSize)
            {
                byte[] array = Plist.objectTable.GetRange(index1, Plist.objRefSize).ToArray();
                Array.Reverse((Array)array);
                intList.Add(BitConverter.ToInt32(Plist.RegulateNullBytes(array, 4), 0));
                index1 += Plist.objRefSize;
            }
            for (int index2 = 0; index2 < count; ++index2)
            {
                objectList.Add(Plist.parseBinary(intList[index2]));
            }
            return((object)objectList);
        }