// Decompiled with JetBrains decompiler
// Type: .
// Assembly: Idm, Version=6.5.8.1, Culture=neutral, PublicKeyToken=null
// MVID: 8A2CC06E-B699-4A98-98EE-08831FC9C995
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Backdoor.Win32.DarkKomet.gwon-35b4a84324681a1000c14cf114b6f94ada34eb6c6ca38b9a4584b31e742aece3.exe

using \u007F\u0004;
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Cryptography;

namespace \u0012
{
  internal sealed class \u0011 : IDisposable
  {
    private readonly Type \u0001;
    private readonly object \u0002;

    public \u0011()
    {
      Assembly assembly1;
      try
      {
        try
        {
          assembly1 = Assembly.Load("System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e");
          this.\u0001 = assembly1.GetType("System.Security.Cryptography.AesManaged");
        }
        catch (FileNotFoundException ex)
        {
          assembly1 = Assembly.Load("mscorlib");
          this.\u0001 = assembly1.GetType("System.Security.Cryptography.RijndaelManaged");
        }
        this.\u0002 = Activator.CreateInstance(this.\u0001);
      }
      catch (Exception ex)
      {
        Assembly assembly2 = assembly1;
        \u0089\u0004.\u0019\u0005(ex, (object) assembly2, (object) this);
        throw;
      }
    }

    public ICryptoTransform \u0007\u0002([In] byte[] obj0, [In] byte[] obj1, [In] bool obj2)
    {
      object[] objArray1;
      MethodInfo method;
      try
      {
        MethodInfo setMethod1 = this.\u0001.GetProperty("Key").GetSetMethod();
        object obj3 = this.\u0002;
        objArray1 = new object[1]{ (object) obj0 };
        object[] parameters1 = objArray1;
        setMethod1.Invoke(obj3, parameters1);
        MethodInfo setMethod2 = this.\u0001.GetProperty("IV").GetSetMethod();
        object obj4 = this.\u0002;
        objArray1 = new object[1]{ (object) obj1 };
        object[] parameters2 = objArray1;
        setMethod2.Invoke(obj4, parameters2);
        method = this.\u0001.GetMethod(obj2 ? "CreateDecryptor" : "CreateEncryptor", new Type[0]);
        return (ICryptoTransform) method.Invoke(this.\u0002, new object[0]);
      }
      catch (Exception ex)
      {
        MethodInfo methodInfo = method;
        object[] objArray2 = objArray1;
        byte[] numArray1 = obj0;
        byte[] numArray2 = obj1;
        // ISSUE: variable of a boxed type
        __Boxed<bool> local = (ValueType) obj2;
        \u0089\u0004.\u001D\u0005(ex, (object) methodInfo, (object) objArray2, (object) this, (object) numArray1, (object) numArray2, (object) local);
        throw;
      }
    }

    public void \u0008\u0002()
    {
      try
      {
        this.\u0001.GetMethod("Clear").Invoke(this.\u0002, new object[0]);
      }
      catch (Exception ex)
      {
        \u0089\u0004.\u0018\u0005(ex, (object) this);
        throw;
      }
    }

    public void Dispose()
    {
      try
      {
        this.\u0008\u0002();
      }
      catch (Exception ex)
      {
        \u0089\u0004.\u0018\u0005(ex, (object) this);
        throw;
      }
    }
  }
}
