// Decompiled with JetBrains decompiler
// Type: .
// Assembly: !, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 557A2E9F-07C1-4548-9113-1357BAD65653
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Trojan.MSIL.Crypt.hnss-93ea8c725747bfd67919febc6ed26643a8654b90a112977a3d914bf034f69ed8.exe

using System;
using System.IO;

namespace \u0001\u0003
{
  public class \u0003\u0012
  {
    public byte[] \u0003\u0018;
    private Stream \u0004\u0001;
    private uint \u0003\u001D;
    private bool \u0003\u001F;
    private uint \u0003\u001C;
    public uint \u0003\u0019;
    public uint \u0003\u0017;
    public uint \u0003\u001E;
    private uint \u0003\u001B;
    private uint \u0003\u001A;
    public uint \u0004;

    public void \u0003\u0014()
    {
      uint num1 = this.\u0003\u0019 + this.\u0003\u001E - this.\u0003\u001B;
      if (num1 > 0U)
        --num1;
      uint num2 = this.\u0003\u0019 + this.\u0004 - num1;
      for (uint index = 0; index < num2; ++index)
        this.\u0003\u0018[(IntPtr) index] = this.\u0003\u0018[(IntPtr) (num1 + index)];
      this.\u0003\u0019 -= num1;
    }

    public virtual void \u0003\u0015()
    {
      if (this.\u0003\u001F)
        return;
      while (true)
      {
        do
        {
          int count = -(int) this.\u0003\u0019 + (int) this.\u0003\u0017 - (int) this.\u0004;
          if (count == 0)
            return;
          int num = this.\u0004\u0001.Read(this.\u0003\u0018, (int) this.\u0003\u0019 + (int) this.\u0004, count);
          if (num == 0)
          {
            this.\u0003\u001D = this.\u0004;
            if (this.\u0003\u0019 + this.\u0003\u001D > this.\u0003\u001C)
              this.\u0003\u001D = this.\u0003\u001C - this.\u0003\u0019;
            this.\u0003\u001F = true;
            return;
          }
          this.\u0004 += (uint) num;
        }
        while (this.\u0004 < this.\u0003\u001E + this.\u0003\u001A);
        this.\u0003\u001D = this.\u0004 - this.\u0003\u001A;
      }
    }

    private void \u0003\u0013() => this.\u0003\u0018 = (byte[]) null;

    public void \u0002\u0010(uint keepSizeBefore, uint keepSizeAfter, uint keepSizeReserv)
    {
      this.\u0003\u001B = keepSizeBefore;
      this.\u0003\u001A = keepSizeAfter;
      uint num = keepSizeBefore + keepSizeAfter + keepSizeReserv;
      if (this.\u0003\u0018 == null || (int) this.\u0003\u0017 != (int) num)
      {
        this.\u0003\u0013();
        this.\u0003\u0017 = num;
        this.\u0003\u0018 = new byte[(IntPtr) this.\u0003\u0017];
      }
      this.\u0003\u001C = this.\u0003\u0017 - keepSizeAfter;
    }

    public void \u0002\u0019(Stream stream) => this.\u0004\u0001 = stream;

    public void \u0002\u0017() => this.\u0004\u0001 = (Stream) null;

    public void \u0001\u001B()
    {
      this.\u0003\u0019 = 0U;
      this.\u0003\u001E = 0U;
      this.\u0004 = 0U;
      this.\u0003\u001F = false;
      this.\u0003\u0015();
    }

    public void \u0002\u0015()
    {
      ++this.\u0003\u001E;
      if (this.\u0003\u001E <= this.\u0003\u001D)
        return;
      if (this.\u0003\u0019 + this.\u0003\u001E > this.\u0003\u001C)
        this.\u0003\u0014();
      this.\u0003\u0015();
    }

    public byte \u0002\u0011(int index) => this.\u0003\u0018[(long) (this.\u0003\u0019 + this.\u0003\u001E) + (long) index];

    public uint \u0002\u0013(int index, uint distance, uint limit)
    {
      if (this.\u0003\u001F && (long) this.\u0003\u001E + (long) index + (long) limit > (long) this.\u0004)
        limit = this.\u0004 - (uint) ((ulong) this.\u0003\u001E + (ulong) index);
      ++distance;
      uint num1 = (uint) ((int) this.\u0003\u0019 + (int) this.\u0003\u001E + index);
      uint num2 = 0;
      while (num2 < limit && (int) this.\u0003\u0018[(IntPtr) (num1 + num2)] == (int) this.\u0003\u0018[(IntPtr) (num1 + num2 - distance)])
        ++num2;
      return num2;
    }

    public uint \u0002\u0014() => this.\u0004 - this.\u0003\u001E;

    public void \u0003\u0016(int subValue)
    {
      this.\u0003\u0019 += (uint) subValue;
      this.\u0003\u001D -= (uint) subValue;
      this.\u0003\u001E -= (uint) subValue;
      this.\u0004 -= (uint) subValue;
    }
  }
}
