// Decompiled with JetBrains decompiler
// Type: .
// Assembly: !, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: AD88AA27-A10E-48A5-83FB-D8F29C49A3B3
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Trojan.MSIL.Crypt.hnoh-10455cb5cfd07978bd68fafedebf0c7ecc4003a27c482d11dfa7e861dd4823b9.exe

using System;
using System.IO;

namespace \u0001\u0003
{
  public class \u0004\u0002
  {
    private byte[] \u0004\u0008;
    private uint \u0003\u001E;
    private uint \u0004\u0009;
    private uint \u0004;
    private Stream \u0004\u0001;

    public void \u0002\u0010(uint windowSize)
    {
      if ((int) this.\u0004\u0009 != (int) windowSize)
        this.\u0004\u0008 = new byte[(IntPtr) windowSize];
      this.\u0004\u0009 = windowSize;
      this.\u0003\u001E = 0U;
      this.\u0004 = 0U;
    }

    public void \u0001\u001B(Stream stream, bool solid)
    {
      this.\u0002\u0017();
      this.\u0004\u0001 = stream;
      if (solid)
        return;
      this.\u0004 = 0U;
      this.\u0003\u001E = 0U;
    }

    public void \u0001\u001B(Stream stream) => this.\u0001\u001B(stream, false);

    public void \u0002\u0017()
    {
      this.\u0004\u0005();
      this.\u0004\u0001 = (Stream) null;
    }

    public void \u0004\u0005()
    {
      uint count = this.\u0003\u001E - this.\u0004;
      if (count == 0U)
        return;
      this.\u0004\u0001.Write(this.\u0004\u0008, (int) this.\u0004, (int) count);
      if (this.\u0003\u001E >= this.\u0004\u0009)
        this.\u0003\u001E = 0U;
      this.\u0004 = this.\u0003\u001E;
    }

    public void \u0004\u0004(uint distance, uint len)
    {
      uint num = (uint) ((int) this.\u0003\u001E - (int) distance - 1);
      if (num >= this.\u0004\u0009)
        num += this.\u0004\u0009;
      for (; len > 0U; --len)
      {
        if (num >= this.\u0004\u0009)
          num = 0U;
        this.\u0004\u0008[(IntPtr) this.\u0003\u001E++] = this.\u0004\u0008[(IntPtr) num++];
        if (this.\u0003\u001E >= this.\u0004\u0009)
          this.\u0004\u0005();
      }
    }

    public void \u0004\u0007(byte b)
    {
      this.\u0004\u0008[(IntPtr) this.\u0003\u001E++] = b;
      if (this.\u0003\u001E < this.\u0004\u0009)
        return;
      this.\u0004\u0005();
    }

    public byte \u0004\u0006(uint distance)
    {
      uint index = (uint) ((int) this.\u0003\u001E - (int) distance - 1);
      if (index >= this.\u0004\u0009)
        index += this.\u0004\u0009;
      return this.\u0004\u0008[(IntPtr) index];
    }
  }
}
