コード例 #1
0
ファイル: ArcPCF.cs プロジェクト: zxc120/GARbro
        public List <Entry> Read()
        {
            long data_size    = m_file.View.ReadInt64(0x10);
            long index_offset = m_file.View.ReadInt64(0x28);

            if (data_size >= m_file.MaxOffset || index_offset >= m_file.MaxOffset)
            {
                return(null);
            }
            uint index_size = m_file.View.ReadUInt32(0x30);
            uint flags      = m_file.View.ReadUInt32(0x38);
            var  key        = m_file.View.ReadBytes(0x58, 8);

            m_base_offset = m_file.MaxOffset - data_size;
            foreach (var scheme in KnownSchemes)
            {
                m_dir.Clear();
                try
                {
                    using (var stream = m_file.CreateStream(m_base_offset + index_offset, index_size))
                        using (var index = scheme.TransformStream(stream, key, flags))
                        {
                            if (ReadIndex(index))
                            {
                                this.Scheme = scheme;
                                return(m_dir);
                            }
                        }
                }
                catch { /* invalid scheme, retry */ }
            }
            return(null);
        }
コード例 #2
0
ファイル: ArcPCF.cs プロジェクト: zxc120/GARbro
 public PcfArchive(ArcView arc, ArchiveFormat impl, ICollection <Entry> dir, PrimelScheme scheme)
     : base(arc, impl, dir)
 {
     Scheme = scheme;
 }