Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Process Protection, stop process from being stopped

Hey HF this is a simple method to stop your process from being stopped by any program. It works by finding out the processes .exe then checking if the process is running every two seconds. If the process is not running it starts the process up again. I am also working on Registry and file protection and will post them in the morning. This is by no way a finished product and is still very buggy. Any Ideas on how to improve it would be great 👍. Anyway the code is here:
Code
Imports System.ComponentModel

Module Module1
    Dim t() As Process

    Sub Find_exe(ByVal process_name As String)
      'finds the location of the executable
      For Each p As Process In Process.GetProcessesByName(process_name)
      Dim file As String
      Try
            file = p.Modules(0).FileName
      Catch ex As Win32Exception
            file = "n/a"
      End Try
      IsItRunning(file, process_name)
      Next
    End Sub

    Private Sub IsItRunning(ByVal file As String, ByVal process_name As String)
      While True
      t = Process.GetProcessesByName(process_name)
      If t.Count > 0 Then
            ' Process is running
            System.Threading.Thread.Sleep("2000")
      Else
            Process.Start(file)
            ' Process is not running
      End If
      End While
    End Sub
End Module
Usage:
Code
Find_exe("your_process_name")
If you get "file not found" errors just replace all the find_exe stuff with "Dim file = "your file directory""
Thanks for reading this
regards
Razor Sharp
(Oct 6, 2014 04:11 PM)Razor Sharp Wrote:  Hey HF this is a simple method to stop your process from being


crap, hit enter by accident :/ will post thread in 5 min

Um okay, I'll edit my post in 5 min.
(Oct 7, 2014 08:34 AM)BlacksmithSec Wrote:  This is a bad approach - timed checks wont work and are inefficient
Still a nice share but thought i'd throw in my penny worth
thanks for the reply, just wondering what would you use instead of time checks?
Thanks man this will be good for a crypter one day


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by MrPoBotOct 8, 2019 08:59 AM 5 476 Oct 8, 2019 08:59 AM
Last Post: MavenGradle
[C#] by xAmka1488Apr 1, 2019 12:44 AM 5 419 Apr 1, 2019 12:44 AM
Last Post: Antlion
[C#] by gigajewMar 4, 2019 08:44 AM 15 1,611 Mar 4, 2019 08:44 AM
Last Post: Aristocles