示例#1
0
文件: Class956.cs 项目: 15831944/WW
        public static Stream smethod_0(Stream compressedStream, long decompressedSize)
        {
            MemoryStream memoryStream = new MemoryStream(new byte[decompressedSize]);

            Class956.smethod_2(compressedStream, (Stream)memoryStream);
            memoryStream.Position = 0L;
            return((Stream)memoryStream);
        }
示例#2
0
文件: Class956.cs 项目: 15831944/WW
        public static void smethod_2(Stream inputStream, Stream decompressedStream)
        {
            int opcode1 = (int)(byte)inputStream.ReadByte();

            if ((opcode1 & 240) == 0)
            {
                opcode1 = (int)Class956.smethod_3(Class956.smethod_4(opcode1, inputStream) + 3, inputStream, decompressedStream);
            }
            while (opcode1 != 17)
            {
                int offset = 0;
                int num1   = 0;
                if (opcode1 >= 16 && opcode1 < 64)
                {
                    if (opcode1 < 32)
                    {
                        num1    = Class956.smethod_5(opcode1, 7, inputStream);
                        offset  = (opcode1 & 8) << 11;
                        opcode1 = Class956.smethod_6(ref offset, 16384, inputStream);
                    }
                    else if (opcode1 >= 32)
                    {
                        num1    = Class956.smethod_5(opcode1, 31, inputStream);
                        opcode1 = Class956.smethod_6(ref offset, 1, inputStream);
                    }
                }
                else
                {
                    int num2 = (int)(byte)inputStream.ReadByte();
                    offset = (opcode1 >> 2 & 3 | num2 << 2) + 1;
                    num1   = (opcode1 >> 4) - 1;
                }
                long position = decompressedStream.Position;
                for (long index = (long)num1 + position; position < index; ++position)
                {
                    decompressedStream.Position = position - (long)offset;
                    byte num2 = (byte)decompressedStream.ReadByte();
                    decompressedStream.Position = position;
                    decompressedStream.WriteByte(num2);
                }
                int litLength = opcode1 & 3;
                if (litLength == 0)
                {
                    opcode1 = (int)(byte)inputStream.ReadByte();
                    if ((opcode1 & 240) == 0)
                    {
                        litLength = Class956.smethod_4(opcode1, inputStream) + 3;
                    }
                }
                if (litLength != 0)
                {
                    opcode1 = (int)Class956.smethod_3(litLength, inputStream, decompressedStream);
                }
            }
            inputStream.ReadByte();
            inputStream.ReadByte();
        }