Esempio n. 1
0
            // Token: 0x06000346 RID: 838 RVA: 0x0002C80C File Offset: 0x0002AA0C
            public int GetSymbol(ChromV266351.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);
                }
            }
Esempio n. 2
0
            // Token: 0x06000348 RID: 840 RVA: 0x0002C8E4 File Offset: 0x0002AAE4
            public bool Decode(ChromV266351.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[ChromV266351.SimpleZip.InflaterDynHeader.BL_ORDER[this.ptr]] = (byte)num2;
                        this.ptr++;
                    }
                    this.blTree = new ChromV266351.SimpleZip.InflaterHuffmanTree(this.blLens);
                    this.blLens = null;
                    this.ptr    = 0;
                    this.mode   = 4;
                    goto IL_E4;
IL_2A:
                    int int_ = ChromV266351.SimpleZip.InflaterDynHeader.repBits[this.repSymbol];
                    int num3 = streamManipulator_0.PeekBits(int_);
                    if (num3 < 0)
                    {
                        return(false);
                    }
                    streamManipulator_0.DropBits(int_);
                    num3 += ChromV266351.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);
            }