Пример #1
0
        public override ArcFile TryOpen(ArcView file)
        {
            uint data_offset = file.View.ReadUInt32(4);
            int  dir_count   = file.View.ReadInt32(8);
            int  count       = file.View.ReadInt32(0xC);

            if (data_offset <= 0x14 || data_offset >= file.MaxOffset)
            {
                return(null);
            }
            if (!IsSaneCount(dir_count) || !IsSaneCount(count))
            {
                return(null);
            }
            var reader = new Pak0Reader(file, data_offset, dir_count, count);
            var dir    = reader.ReadIndex();

            return(null != dir ? new ArcFile(file, this, dir) : null);
        }
Пример #2
0
 public override ArcFile TryOpen(ArcView file)
 {
     uint data_offset   = file.View.ReadUInt32 (4);
     int  dir_count     = file.View.ReadInt32 (8);
     int  count         = file.View.ReadInt32 (0xC);
     if (data_offset <= 0x14 || data_offset >= file.MaxOffset)
         return null;
     if (!IsSaneCount (dir_count) || !IsSaneCount (count))
         return null;
     var reader = new Pak0Reader (file, data_offset, dir_count, count);
     var dir = reader.ReadIndex();
     return null != dir ? new ArcFile (file, this, dir) : null;
 }