示例#1
0
            // Token: 0x060002E4 RID: 740 RVA: 0x00028E94 File Offset: 0x00027094
            public int GetSymbol(SimpleZip.StreamManipulator streamManipulator_0)
            {
                int num;

                if ((num = streamManipulator_0.PeekBits(9)) >= 0)
                {
                    int num2;
                    if ((num2 = (int)this.tree[num]) >= 0)
                    {
                        streamManipulator_0.DropBits(num2 & 15);
                        return(num2 >> 4);
                    }
                    int num3 = -(num2 >> 4);
                    int int_ = num2 & 15;
                    if ((num = streamManipulator_0.PeekBits(int_)) >= 0)
                    {
                        num2 = (int)this.tree[num3 | num >> 9];
                        streamManipulator_0.DropBits(num2 & 15);
                        return(num2 >> 4);
                    }
                    int availableBits = streamManipulator_0.AvailableBits;
                    num  = streamManipulator_0.PeekBits(availableBits);
                    num2 = (int)this.tree[num3 | num >> 9];
                    if ((num2 & 15) <= availableBits)
                    {
                        streamManipulator_0.DropBits(num2 & 15);
                        return(num2 >> 4);
                    }
                    return(-1);
                }
                else
                {
                    int availableBits2 = streamManipulator_0.AvailableBits;
                    num = streamManipulator_0.PeekBits(availableBits2);
                    int num2 = (int)this.tree[num];
                    if (num2 >= 0 && (num2 & 15) <= availableBits2)
                    {
                        streamManipulator_0.DropBits(num2 & 15);
                        return(num2 >> 4);
                    }
                    return(-1);
                }
            }
示例#2
0
            // Token: 0x060016BA RID: 5818 RVA: 0x00075494 File Offset: 0x00073694
            public int GetSymbol(SimpleZip.StreamManipulator A_1)
            {
                int num;

                if ((num = A_1.PeekBits(9)) >= 0)
                {
                    int num2;
                    if ((num2 = (int)this.tree[num]) >= 0)
                    {
                        A_1.DropBits(num2 & 15);
                        return(num2 >> 4);
                    }
                    int num3 = -(num2 >> 4);
                    int num4 = num2 & 15;
                    if ((num = A_1.PeekBits(num4)) >= 0)
                    {
                        num2 = (int)this.tree[num3 | num >> 9];
                        A_1.DropBits(num2 & 15);
                        return(num2 >> 4);
                    }
                    int availableBits = A_1.get_AvailableBits();
                    num  = A_1.PeekBits(availableBits);
                    num2 = (int)this.tree[num3 | num >> 9];
                    if ((num2 & 15) <= availableBits)
                    {
                        A_1.DropBits(num2 & 15);
                        return(num2 >> 4);
                    }
                    return(-1);
                }
                else
                {
                    int availableBits2 = A_1.get_AvailableBits();
                    num = A_1.PeekBits(availableBits2);
                    int num2 = (int)this.tree[num];
                    if (num2 >= 0 && (num2 & 15) <= availableBits2)
                    {
                        A_1.DropBits(num2 & 15);
                        return(num2 >> 4);
                    }
                    return(-1);
                }
            }
示例#3
0
            // Token: 0x060002DC RID: 732 RVA: 0x00028AE0 File Offset: 0x00026CE0
            public int CopyStored(SimpleZip.StreamManipulator streamManipulator_0, int int_0)
            {
                int_0 = Math.Min(Math.Min(int_0, 32768 - this.windowFilled), streamManipulator_0.AvailableBytes);
                int num = 32768 - this.windowEnd;
                int num2;

                if (int_0 > num)
                {
                    num2 = streamManipulator_0.CopyBytes(this.window, this.windowEnd, num);
                    if (num2 == num)
                    {
                        num2 += streamManipulator_0.CopyBytes(this.window, 0, int_0 - num);
                    }
                }
                else
                {
                    num2 = streamManipulator_0.CopyBytes(this.window, this.windowEnd, int_0);
                }
                this.windowEnd     = (this.windowEnd + num2 & 32767);
                this.windowFilled += num2;
                return(num2);
            }
示例#4
0
            // Token: 0x060016B2 RID: 5810 RVA: 0x00075054 File Offset: 0x00073254
            public int CopyStored(SimpleZip.StreamManipulator A_1, int A_2)
            {
                A_2 = Math.Min(Math.Min(A_2, 32768 - this.windowFilled), A_1.get_AvailableBytes());
                int num = 32768 - this.windowEnd;
                int num2;

                if (A_2 > num)
                {
                    num2 = A_1.CopyBytes(this.window, this.windowEnd, num);
                    if (num2 == num)
                    {
                        num2 += A_1.CopyBytes(this.window, 0, A_2 - num);
                    }
                }
                else
                {
                    num2 = A_1.CopyBytes(this.window, this.windowEnd, A_2);
                }
                this.windowEnd     = (this.windowEnd + num2 & 32767);
                this.windowFilled += num2;
                return(num2);
            }
示例#5
0
            // Token: 0x060002E6 RID: 742 RVA: 0x00028F6C File Offset: 0x0002716C
            public bool Decode(SimpleZip.StreamManipulator streamManipulator_0)
            {
                for (;;)
                {
                    switch (this.mode)
                    {
                    case 0:
                        this.lnum = streamManipulator_0.PeekBits(5);
                        if (this.lnum >= 0)
                        {
                            this.lnum += 257;
                            streamManipulator_0.DropBits(5);
                            this.mode = 1;
                            goto IL_1E0;
                        }
                        return(false);

                    case 1:
                        goto IL_1E0;

                    case 2:
                        goto IL_192;

                    case 3:
                        goto IL_159;

                    case 4:
                        break;

                    case 5:
                        goto IL_2A;

                    default:
                        continue;
                    }
IL_E4:
                    int symbol;
                    while (((symbol = this.blTree.GetSymbol(streamManipulator_0)) & -16) == 0)
                    {
                        byte[] array = this.litdistLens;
                        int    num   = this.ptr;
                        this.ptr   = num + 1;
                        array[num] = (this.lastLen = (byte)symbol);
                        if (this.ptr == this.num)
                        {
                            return(true);
                        }
                    }
                    if (symbol >= 0)
                    {
                        if (symbol >= 17)
                        {
                            this.lastLen = 0;
                        }
                        this.repSymbol = symbol - 16;
                        this.mode      = 5;
                        goto IL_2A;
                    }
                    return(false);

IL_159:
                    while (this.ptr < this.blnum)
                    {
                        int num2 = streamManipulator_0.PeekBits(3);
                        if (num2 < 0)
                        {
                            return(false);
                        }
                        streamManipulator_0.DropBits(3);
                        this.blLens[SimpleZip.InflaterDynHeader.BL_ORDER[this.ptr]] = (byte)num2;
                        this.ptr++;
                    }
                    this.blTree = new SimpleZip.InflaterHuffmanTree(this.blLens);
                    this.blLens = null;
                    this.ptr    = 0;
                    this.mode   = 4;
                    goto IL_E4;
IL_2A:
                    int int_ = SimpleZip.InflaterDynHeader.repBits[this.repSymbol];
                    int num3 = streamManipulator_0.PeekBits(int_);
                    if (num3 < 0)
                    {
                        return(false);
                    }
                    streamManipulator_0.DropBits(int_);
                    num3 += SimpleZip.InflaterDynHeader.repMin[this.repSymbol];
                    while (num3-- > 0)
                    {
                        byte[] array2 = this.litdistLens;
                        int    num    = this.ptr;
                        this.ptr    = num + 1;
                        array2[num] = this.lastLen;
                    }
                    if (this.ptr == this.num)
                    {
                        break;
                    }
                    this.mode = 4;
                    continue;
IL_192:
                    this.blnum = streamManipulator_0.PeekBits(4);
                    if (this.blnum >= 0)
                    {
                        this.blnum += 4;
                        streamManipulator_0.DropBits(4);
                        this.blLens = new byte[19];
                        this.ptr    = 0;
                        this.mode   = 3;
                        goto IL_159;
                    }
                    return(false);

IL_1E0:
                    this.dnum = streamManipulator_0.PeekBits(5);
                    if (this.dnum >= 0)
                    {
                        this.dnum++;
                        streamManipulator_0.DropBits(5);
                        this.num         = this.lnum + this.dnum;
                        this.litdistLens = new byte[this.num];
                        this.mode        = 2;
                        goto IL_192;
                    }
                    return(false);
                }
                return(true);
            }
示例#6
0
            // Token: 0x060016BC RID: 5820 RVA: 0x00075588 File Offset: 0x00073788
            public bool Decode(SimpleZip.StreamManipulator A_1)
            {
                for (;;)
                {
                    switch (this.mode)
                    {
                    case 0:
                        this.lnum = A_1.PeekBits(5);
                        if (this.lnum < 0)
                        {
                            return(false);
                        }
                        this.lnum += 257;
                        A_1.DropBits(5);
                        this.mode = 1;
                        goto IL_62;

                    case 1:
                        goto IL_62;

                    case 2:
                        goto IL_BD;

                    case 3:
                        break;

                    case 4:
                        goto IL_1B9;

                    case 5:
                        goto IL_1F5;

                    default:
                        continue;
                    }
IL_148:
                    while (this.ptr < this.blnum)
                    {
                        int num = A_1.PeekBits(3);
                        if (num < 0)
                        {
                            return(false);
                        }
                        A_1.DropBits(3);
                        this.blLens[SimpleZip.InflaterDynHeader.BL_ORDER[this.ptr]] = (byte)num;
                        this.ptr++;
                    }
                    this.blTree = new SimpleZip.InflaterHuffmanTree(this.blLens);
                    this.blLens = null;
                    this.ptr    = 0;
                    this.mode   = 4;
IL_1B9:
                    int symbol;
                    while (((symbol = this.blTree.GetSymbol(A_1)) & -16) == 0)
                    {
                        byte[] array = this.litdistLens;
                        int    num2  = this.ptr;
                        this.ptr    = num2 + 1;
                        array[num2] = (this.lastLen = (byte)symbol);
                        if (this.ptr == this.num)
                        {
                            return(true);
                        }
                    }
                    if (symbol < 0)
                    {
                        return(false);
                    }
                    if (symbol >= 17)
                    {
                        this.lastLen = 0;
                    }
                    this.repSymbol = symbol - 16;
                    this.mode      = 5;
IL_1F5:
                    int num3 = SimpleZip.InflaterDynHeader.repBits[this.repSymbol];
                    int num4 = A_1.PeekBits(num3);
                    if (num4 < 0)
                    {
                        return(false);
                    }
                    A_1.DropBits(num3);
                    num4 += SimpleZip.InflaterDynHeader.repMin[this.repSymbol];
                    while (num4-- > 0)
                    {
                        byte[] array2 = this.litdistLens;
                        int    num2   = this.ptr;
                        this.ptr     = num2 + 1;
                        array2[num2] = this.lastLen;
                    }
                    if (this.ptr == this.num)
                    {
                        return(true);
                    }
                    this.mode = 4;
                    continue;
IL_BD:
                    this.blnum = A_1.PeekBits(4);
                    if (this.blnum < 0)
                    {
                        return(false);
                    }
                    this.blnum += 4;
                    A_1.DropBits(4);
                    this.blLens = new byte[19];
                    this.ptr    = 0;
                    this.mode   = 3;
                    goto IL_148;
IL_62:
                    this.dnum = A_1.PeekBits(5);
                    if (this.dnum < 0)
                    {
                        return(false);
                    }
                    this.dnum++;
                    A_1.DropBits(5);
                    this.num         = this.lnum + this.dnum;
                    this.litdistLens = new byte[this.num];
                    this.mode        = 2;
                    goto IL_BD;
                }
                return(false);
            }