Beispiel #1
0
            public override bool ReadIndex()
            {
                int count = LittleEndian.ToInt32(m_header, 4);

                if (!IsSaneCount(count))
                {
                    return(false);
                }
                int offset_count = LittleEndian.ToInt32(m_header, 8);

                m_index = new byte[0x20 * count];
                var offsets = new byte[4 * offset_count];

                m_base_offset += 0x10;
                if (m_index.Length != ReadEncrypted(m_view, m_dec, m_base_offset, m_index, 0, m_index.Length))
                {
                    return(false);
                }
                m_base_offset += m_index.Length;
                if (offsets.Length != ReadEncrypted(m_view, m_dec, m_base_offset, offsets, 0, offsets.Length))
                {
                    return(false);
                }
                m_offset_table = new uint[offset_count];
                Buffer.BlockCopy(offsets, 0, m_offset_table, 0, offsets.Length);

                m_base_offset += offsets.Length;
                m_base_offset  = m_scheme.GetAlignedOffset(m_base_offset);

                m_dir.Capacity = offset_count;
                ReadDir("", 0, 1);
                return(m_dir.Count > 0);
            }