Unordered List

Thursday, April 19, 2012

Create Your Own Anti-Virus Program

Ever wanted to create your own anti-virus program? Follow this tutorial and you will got your own anti-virus in a few minutes.
Visual basic 2008 express edition needed!

First, let’s start a new project and put a listbox and a button on your form. Insert the following code in the click event of your button:

—–

Private

If My.Computer.FileSystem.DirectoryExists(”c:Program Files180search Assistant”) Then ListBox1.Items.Add(”Adware.180Search”)

—–

‘ This will add the item ‘Adware.180search to the listbox if c:Program files180search Assistant exists. If you want to search for a file you will have to do this:

—–

If My.Computer.FileSystem.FileExists(”c:Program Files180search Assistantsomething”) Then ListBox1.Items.Add(”Adware.180Search”)

‘ So if you want to search for a directory you have to use DirectoryExists, and if you want to search for a file you have to use FileExists.

Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Congratulations! You created an anti-virus that scans for files or folders. If you want to have an anti-virus that scans for processes, you will have to use this code: (Remember to type the process with uppercase characters!)

—–

strFoundProcess =

Dim AllProcessDim ProcessDim strFoundProcessFalse

AllProcess = GetObject(

“winmgmts:”)

strFoundProcess =

For Each Process In AllProcess.InstancesOf(”Win32_process”) If (InStr(UCase(Process.Name), “THEPROCESS.EXE“) = 1) Then ListBox1.Items.Add(”THENAMEOFTHEVIRUS“) True Exit For End If Next If strFoundProcess = False Then End If

AllProcess =

Nothing

—–

strFoundProcess =

False

AllProcess = GetObject(

“winmgmts:”)

If (InStr(UCase(Process.Name), “THEPROCESS.EXE“) = 1) Then

ListBox1.Items.Add(

strFoundProcess =

THENAMEOFTHEVIRUS“)True Exit For End If Next If strFoundProcess = False Then End If

AllProcess =

Nothing

For Each Process In AllProcess.InstancesOf(”Win32_process”)

You only need to that once! After you did that once, you can use this code:

False

AllProcess = GetObject(

“winmgmts:”)

‘create object For Each Process In AllProcess.InstancesOf(”Win32_process”)

‘Get all the processes running in your PC If (InStr(UCase(Process.Name), “AUPDATE.EXE”) = 1) Then

‘Made all uppercase to remove ambiguity. Replace TASKMGR.EXE with your application name in CAPS.

ListBox1.Items.Add(

“Spyware.W32.123bar”

)

strFoundProcess =

TrueExit

ForEnd

If

NextIf strFoundProcess = False

ThenEnd

If

AllProcess =

Nothing

Congrats! You completed this tutorial and know how to create your own anti-virus!

strFoundProcess =

 

 

----------------------------------------------------------------------------------------------------------




0 comments:

Post a Comment