Advertisement
xAmnesiia

deleting puush daemon

Sep 25th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. private static bool smethod_2(string string_0)
  2.         {
  3.             if (File.Exists(string_0))
  4.             {
  5.                 try
  6.                 {
  7.                     Process[] processesByName = Process.GetProcessesByName("puush.daemon.exe");
  8.                     for (int i = 0; i < processesByName.Length; i++)
  9.                     {
  10.                         Process process = processesByName[i];
  11.                         process.Kill();
  12.                     }
  13.                     Process[] processesByName2 = Process.GetProcessesByName("puush.daemon");
  14.                     for (int j = 0; j < processesByName2.Length; j++)
  15.                     {
  16.                         Process process2 = processesByName2[j];
  17.                         process2.Kill();
  18.                     }
  19.                 }
  20.                 catch
  21.                 {
  22.                 }
  23.                 int num = 20;
  24.                 bool flag = false;
  25.                 while (num-- > 0)
  26.                 {
  27.                     try
  28.                     {
  29.                         File.Delete(string_0);
  30.                         flag = true;
  31.                         break;
  32.                     }
  33.                     catch
  34.                     {
  35.                     }
  36.                     Thread.Sleep(200);
  37.                 }
  38.                 if (!flag)
  39.                 {
  40.                     try
  41.                     {
  42.                         File.Move(string_0, string_0 + "_delete");
  43.                     }
  44.                     catch
  45.                     {
  46.                     }
  47.                 }
  48.                 try
  49.                 {
  50.                     using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true))
  51.                     {
  52.                         registryKey.DeleteValue("puush daemon", true);
  53.                     }
  54.                 }
  55.                 catch (Exception)
  56.                 {
  57.                 }
  58.                 return true;
  59.             }
  60.             return false;
  61.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement