Exemple #1
0
            // Token: 0x060016E2 RID: 5858 RVA: 0x000769A0 File Offset: 0x00074BA0
            public int GetSymbol(ChromV265450.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);
                }
            }
Exemple #2
0
            // Token: 0x060016DA RID: 5850 RVA: 0x00076560 File Offset: 0x00074760
            public int CopyStored(ChromV265450.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);
            }
Exemple #3
0
            // Token: 0x060016E4 RID: 5860 RVA: 0x00076A94 File Offset: 0x00074C94
            public bool Decode(ChromV265450.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[ChromV265450.SimpleZip.InflaterDynHeader.BL_ORDER[this.ptr]] = (byte)num;
                        this.ptr++;
                    }
                    this.blTree = new ChromV265450.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 = ChromV265450.SimpleZip.InflaterDynHeader.repBits[this.repSymbol];
                    int num4 = A_1.PeekBits(num3);
                    if (num4 < 0)
                    {
                        return(false);
                    }
                    A_1.DropBits(num3);
                    num4 += ChromV265450.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);
            }