示例#1
0
文件: ArcFPK.cs 项目: Casidi/GARbro
 public override Stream OpenEntry(ArcFile arc, Entry entry)
 {
     var input = arc.File.CreateStream (entry.Offset, entry.Size);
     if (entry.Size <= 8)
         return input;
     var sign = FormatCatalog.ReadSignature (input);
     if (0x32434c5a != sign) // 'ZLC2'
     {
         input.Position = 0;
         return input;
     }
     using (input)
     using (var reader = new Zlc2Reader (input, (int)entry.Size))
     {
         reader.Unpack();
         return new MemoryStream (reader.Data);
     }
 }
示例#2
0
文件: ArcFPK.cs 项目: zxc120/GARbro
        public override Stream OpenEntry(ArcFile arc, Entry entry)
        {
            var input = arc.File.CreateStream(entry.Offset, entry.Size);

            if (entry.Size <= 8)
            {
                return(input);
            }
            var sign = input.Signature;

            if (0x32434c5a != sign) // 'ZLC2'
            {
                return(input);
            }

            using (input)
                using (var reader = new Zlc2Reader(input, (int)entry.Size))
                {
                    reader.Unpack();
                    return(new BinMemoryStream(reader.Data, entry.Name));
                }
        }
示例#3
0
        public override Stream OpenEntry(ArcFile arc, Entry entry)
        {
            var input = arc.File.CreateStream(entry.Offset, entry.Size);

            if (entry.Size <= 8)
            {
                return(input);
            }
            var sign = FormatCatalog.ReadSignature(input);

            if (0x32434c5a != sign) // 'ZLC2'
            {
                input.Position = 0;
                return(input);
            }
            using (input)
                using (var reader = new Zlc2Reader(input, (int)entry.Size))
                {
                    reader.Unpack();
                    return(new MemoryStream(reader.Data));
                }
        }