Пример #1
0
 // Token: 0x060007AC RID: 1964 RVA: 0x00034868 File Offset: 0x00032A68
 public int Inflate(Class_201 flush)
 {
     if (this.istate == null)
     {
         throw new Class_205("No Inflate State!");
     }
     return(this.istate.Inflate(flush));
 }
Пример #2
0
 // Token: 0x060007B5 RID: 1973 RVA: 0x00034998 File Offset: 0x00032B98
 public int Deflate(Class_201 flush)
 {
     if (this.dstate == null)
     {
         throw new Class_205("No Deflate State!");
     }
     return(this.dstate.Deflate(flush));
 }
Пример #3
0
        // Token: 0x06000747 RID: 1863 RVA: 0x000314B4 File Offset: 0x0002F6B4
        internal int Inflate(Class_201 flush)
        {
            if (this._codec.InputBuffer == null)
            {
                throw new Class_205("InputBuffer is null. ");
            }
            int num  = 0;
            int num2 = -5;

            for (;;)
            {
                switch (this.mode)
                {
                case Class_196.InflateManagerMode.METHOD:
                    if (this._codec.AvailableBytesIn == 0)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this._codec.AvailableBytesIn--;
                    this._codec.TotalBytesIn += 1L;
                    if (((this.method = (int)this._codec.InputBuffer[this._codec.NextIn++]) & 15) != 8)
                    {
                        this.mode           = Class_196.InflateManagerMode.BAD;
                        this._codec.Message = string.Format("unknown compression method (0x{0:X2})", this.method);
                        this.marker         = 5;
                        continue;
                    }
                    if ((this.method >> 4) + 8 > this.wbits)
                    {
                        this.mode           = Class_196.InflateManagerMode.BAD;
                        this._codec.Message = string.Format("invalid window size ({0})", (this.method >> 4) + 8);
                        this.marker         = 5;
                        continue;
                    }
                    this.mode = Class_196.InflateManagerMode.FLAG;
                    continue;

                case Class_196.InflateManagerMode.FLAG:
                {
                    if (this._codec.AvailableBytesIn == 0)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this._codec.AvailableBytesIn--;
                    this._codec.TotalBytesIn += 1L;
                    int num3 = (int)(this._codec.InputBuffer[this._codec.NextIn++] & byte.MaxValue);
                    if (((this.method << 8) + num3) % 31 != 0)
                    {
                        this.mode           = Class_196.InflateManagerMode.BAD;
                        this._codec.Message = "incorrect header check";
                        this.marker         = 5;
                        continue;
                    }
                    this.mode = (((num3 & 32) == 0) ? Class_196.InflateManagerMode.BLOCKS : Class_196.InflateManagerMode.DICT4);
                    continue;
                }

                case Class_196.InflateManagerMode.DICT4:
                    if (this._codec.AvailableBytesIn == 0)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this._codec.AvailableBytesIn--;
                    this._codec.TotalBytesIn += 1L;
                    this.expectedCheck        = (uint)((long)((long)this._codec.InputBuffer[this._codec.NextIn++] << 24) & (long)((ulong)-16777216));
                    this.mode = Class_196.InflateManagerMode.DICT3;
                    continue;

                case Class_196.InflateManagerMode.DICT3:
                    if (this._codec.AvailableBytesIn == 0)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this._codec.AvailableBytesIn--;
                    this._codec.TotalBytesIn += 1L;
                    this.expectedCheck       += (uint)((int)this._codec.InputBuffer[this._codec.NextIn++] << 16 & 16711680);
                    this.mode = Class_196.InflateManagerMode.DICT2;
                    continue;

                case Class_196.InflateManagerMode.DICT2:
                    if (this._codec.AvailableBytesIn == 0)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this._codec.AvailableBytesIn--;
                    this._codec.TotalBytesIn += 1L;
                    this.expectedCheck       += (uint)((int)this._codec.InputBuffer[this._codec.NextIn++] << 8 & 65280);
                    this.mode = Class_196.InflateManagerMode.DICT1;
                    continue;

                case Class_196.InflateManagerMode.DICT1:
                    goto IL_3A0;

                case Class_196.InflateManagerMode.DICT0:
                    goto IL_42C;

                case Class_196.InflateManagerMode.BLOCKS:
                    num2 = this.blocks.Process(num2);
                    if (num2 == -3)
                    {
                        this.mode   = Class_196.InflateManagerMode.BAD;
                        this.marker = 0;
                        continue;
                    }
                    if (num2 == 0)
                    {
                        num2 = num;
                    }
                    if (num2 != 1)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this.computedCheck = this.blocks.Reset();
                    if (!this.HandleRfc1950HeaderBytes)
                    {
                        goto Block_16;
                    }
                    this.mode = Class_196.InflateManagerMode.CHECK4;
                    continue;

                case Class_196.InflateManagerMode.CHECK4:
                    if (this._codec.AvailableBytesIn == 0)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this._codec.AvailableBytesIn--;
                    this._codec.TotalBytesIn += 1L;
                    this.expectedCheck        = (uint)((long)((long)this._codec.InputBuffer[this._codec.NextIn++] << 24) & (long)((ulong)-16777216));
                    this.mode = Class_196.InflateManagerMode.CHECK3;
                    continue;

                case Class_196.InflateManagerMode.CHECK3:
                    if (this._codec.AvailableBytesIn == 0)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this._codec.AvailableBytesIn--;
                    this._codec.TotalBytesIn += 1L;
                    this.expectedCheck       += (uint)((int)this._codec.InputBuffer[this._codec.NextIn++] << 16 & 16711680);
                    this.mode = Class_196.InflateManagerMode.CHECK2;
                    continue;

                case Class_196.InflateManagerMode.CHECK2:
                    if (this._codec.AvailableBytesIn == 0)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this._codec.AvailableBytesIn--;
                    this._codec.TotalBytesIn += 1L;
                    this.expectedCheck       += (uint)((int)this._codec.InputBuffer[this._codec.NextIn++] << 8 & 65280);
                    this.mode = Class_196.InflateManagerMode.CHECK1;
                    continue;

                case Class_196.InflateManagerMode.CHECK1:
                    if (this._codec.AvailableBytesIn == 0)
                    {
                        return(num2);
                    }
                    num2 = num;
                    this._codec.AvailableBytesIn--;
                    this._codec.TotalBytesIn += 1L;
                    this.expectedCheck       += (uint)(this._codec.InputBuffer[this._codec.NextIn++] & byte.MaxValue);
                    if (this.computedCheck != this.expectedCheck)
                    {
                        this.mode           = Class_196.InflateManagerMode.BAD;
                        this._codec.Message = "incorrect data check";
                        this.marker         = 5;
                        continue;
                    }
                    goto IL_6E4;

                case Class_196.InflateManagerMode.DONE:
                    return(1);

                case Class_196.InflateManagerMode.BAD:
                    goto IL_6F0;
                }
                break;
            }
            throw new Class_205("Stream error.");
IL_3A0:
            if (this._codec.AvailableBytesIn == 0)
            {
                return(num2);
            }
            this._codec.AvailableBytesIn--;
            this._codec.TotalBytesIn += 1L;
            this.expectedCheck       += (uint)(this._codec.InputBuffer[this._codec.NextIn++] & byte.MaxValue);
            this._codec._Adler32      = this.expectedCheck;
            this.mode = Class_196.InflateManagerMode.DICT0;
            return(2);

IL_42C:
            this.mode           = Class_196.InflateManagerMode.BAD;
            this._codec.Message = "need dictionary";
            this.marker         = 0;
            return(-2);

Block_16:
            this.mode = Class_196.InflateManagerMode.DONE;
            return(1);

IL_6E4:
            this.mode = Class_196.InflateManagerMode.DONE;
            return(1);

IL_6F0:
            throw new Class_205(string.Format("Bad state ({0})", this._codec.Message));
        }