Ejemplo n.º 1
0
 // Non original, borrowed
 public byte[] DecryptBlock(BinaryStream bs, long offset, int length)
 {
     bs.ByteConverter = ByteConverter.Little;
     bs.BaseStream.Seek(offset, SeekOrigin.Begin);
     using (var decompressStream = new MemoryStream())
     {
         using (var decompressionStream = new DeflateStream(new MemoryStream(bs.ReadBytes(length)), CompressionMode.Decompress))
         {
             decompressionStream.CopyTo(decompressStream);
             return(PS2Zip.XorEncript(decompressStream.ToArray(), Volume.DataCryptKey));
         }
     }
 }