Making it as real as possible....

Coordinator
Sep 20, 2009 at 1:40 PM
Edited Sep 20, 2009 at 1:59 PM

Hi all! I want to ask some questions, for developing my AV. Let's disscus a little bit:

1) When i'm directed to Form2(after scanning my computer) i want to appear in the "informations listbox" to appear a text:Your computer is at major risk!!!
 Anti-Virus suggests you clean the spotted viruses! when viruses are listed in the listbox, and the text: Your computer is clean! when there are no viruses detected. Please tell me what to do, and also paste the code in.

2) On the form 3 (Registration) i want a code for: When the button register is clicked without a code in the three textboxes, a message: You didn't entered a code! will appear.

3) In the form 1, i want the ProgressBar to evoluate in step with the scanning, so it will be in real-time wit the scan. It won't be a 3 seconds timer, and the bars will also evoluate in step with the scanning.

    In Form2, i want the same thing, but in step with the Clean button(the time will depend with the number of threats to be deleted!!!). Hope it's not hard.

4) In the form 2 i heave a Total Viruses listbox. There i want the program to list the number of threats detected, only the number(it'll will look at the Major Viruses Found listbox, near it, and count down how many items are listed in there, and then list them on Total Viruses listbox). It must be possible.

5) In Form2, when i click Button "Clean" and viruses are not shown in listnox1(there are no viruses detected) a message will appear: ?You have'nt got viruses for cleaning".

 

This are the 5 things i want to do, for finalizing my AV. Please and Please reply to this, and answer the all 5 questions :D.

Sep 21, 2009 at 2:57 AM

I am having a look as we speak, I am also seeing how to make it more "efficiant" but we will work through the above points first.

Ill post back with my findings.

 

 

Sep 21, 2009 at 5:25 AM
Edited Sep 21, 2009 at 5:43 AM

Here is the start of form 2.  I have done points 1 and 4.  I changed it abit - depending on what was scanned, will display the number found in listbox 2, along the lines of "Viruses 0" or "Spyware 0" etc.

Point 5, I changed it so if there are no viruses found, then the clean button is disabled and a message is displayed using a label - but that can be changed to how you want it if you want.  let me know.  Have a look at the code below.

Form2 Code.

 

Public Class Form2
''' <summary>
''' FORM2.
''' Listbox1 = Lists found Files and Directories.
''' Listbox2 = Lists details about what is found.
''' lblMessage = Label to display Viruses Found or not found. Text is red if found, green if nothing found.
''' Button1 = Clean viruses.
''' ProgressBar1 = Progress of Cleaning. TO DO.
''' VirusCount = Will be used for ProgressBar1.
''' </summary>
''' <remarks></remarks>
Dim VirusCount As Integer = 0
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Make sure listboxes are cleared before anything is added.
ListBox1.Items.Clear()
ListBox2.Items.Clear()

' How many total items found, used for progress bar.
VirusCount = Form1.FoundFiles.Count + Form1.FoundDirs.Count

' Get list of any items from Arrays "FoundFiles" and "FoundDirs"
If Form1.FoundDirs.Count Or Form1.FoundFiles.Count > 0 Then
For i = 0 To Form1.FoundDirs.Count - 1
ListBox1.Items.Add(Form1.FoundDirs(i))
Next

For i = 0 To Form1.FoundFiles.Count - 1
ListBox1.Items.Add(Form1.FoundFiles(i))
Next

' Enable "Clean" button if there are any virses, otherwise leave disabled and show appropiate mesage.
lblMessage.ForeColor = Color.Red
lblMessage.Text = "Your computer is a major risk, Anti-Virus suggests you clean the spotted viruses"
Button1.Enabled = True
Else
lblMessage.ForeColor = Color.Green
lblMessage.Text = "No viruses found. Your computer is clean."
Button1.Enabled = False
End If

' Add to Listbox 2, depending on what form1.combobox selection.
Select Case Form1.ComboBox1.SelectedIndex
Case 0 ' Viruses.
ListBox2.Items.Add("Viruses Found " & Form1.VirusesFound)
Case 1 ' Spyware.
ListBox2.Items.Add("Spyware Found " & Form1.SpywareFound)
Case 2 ' Adware.
ListBox2.Items.Add("Adware Found " & Form1.AdwareFound)
End Select
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Clean Button.
Try
' Delete Directories.
For i = 0 To Form1.FoundDirs.Count - 1
IO.Directory.Delete(Form1.FoundDirs(i))
Next

For i = 0 To Form1.FoundFiles.Count - 1
IO.File.Delete(Form1.FoundFiles(i))
Next
' Files and Directories have been deleted.
MessageBox.Show("Your computer has been Cleaned", "Successs", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
' Any errors, like cant delete a file - show here.
MessageBox.Show(ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
End Class

 

 

I have not got the ProgressBar going as yet.

Let me know if Im on the right track, what needs to be changed etc.

 I have added my prject files to the sourcecode section to download and try.

Sep 21, 2009 at 12:46 PM
Edited Sep 21, 2009 at 12:50 PM

Been a bit busy.  Worked on form1 code. 

Updated Form1 Code.  Progress Bar steps for each File/Directory Searched, Organised Code, Enable/Disable various buttons depending on what is being done, Message to user if "Clean Viruses" button is clicked if a scan has not been done or there are no viruses to clean, if virus is found "Clean virus" button will hide form1 and show form2, when form2 is closed form1 will show.

I have uploaded the new revision to the sourcecode.  I havnt included a Registration Form/Code - have yet to get that far.

Here is form1's code.  I call this the "Dirty" version, to see if anything is or not working.

Region "Declare Arrays for Found Files and Found Dirs"
    Public FoundFiles As New ArrayList
    Public FoundDirs As New ArrayList
#End Region

#Region "Declaration of Arrays for Folders and Files"
    ' Worms/Tojans Files.
    Dim Worms_Files() As String = {"c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe", "c:\avtest.txt"}
    ' Worms/Tojans Directories - Full Path.
    Dim Worms_Dirs() As String = {"c:\Program Files\aolx", "c:\Program Files\BTV", "c:\avtest"}

    ' Spyware Files.
    Dim Spyware_Files() As String = {"C:\Program Files\AdStatComm.dll", "C:\Program Files\0er8k4va\0er8k4va.exe", _
                                     "C:\WINDOWS\System32\Mkfxut.exe", "C:\WINDOWS\system32\pkdacs.exe", _
                                     "C:\WINDOWS\System32\ywrqku.exe", "C:\windows\system32\msnavc32.exe", _
                                     "C:\Program Files\AutoUpdate\AutoUpdate.exe", "C:\WINDOWS\System32\vwix32.exe", _
                                     "C:\WINDOWS\System32\winntcreate.exe", "C:\WINDOWS\System32\sysmonnt.exe", _
                                     "C:\WINDOWS\System32\winhcek32.exe", "C:\WINDOWS\System32\qlykdnb.dll", _
                                     "C:\WINDOWS\System32\rypgvtoimrl.exe", "C:\WINDOWS\System32\spwgoc.exe", _
                                     "C:\windows\system32\msnavc32.exe", "C:\WINDOWS\System32\sysmonnt", _
                                     "C:\Program Files\hpdll\hpdll.exe", "C:\WINDOWS\System32\w?wexec.exe", _
                                     "C:\WINDOWS\isrvs\ffisearch.exe", "c:\Program Files\Autosearch.dll", _
                                     "c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe"}
    'Spyware Directories - Full Path.
    Dim Spyware_Dirs() As String = {"c:\Program Files\180 SearchAssistant", "c:\Program Files\2Search", "c:\Program Files\5whgue21", _
                                    "c:\Program Files\aolx", "c:\Program Files\ACM", "c:\Program Files\Browser Pal", _
                                    "c:\Program Files\Activity Keylogger", "c:\Program Files\Activity Logger", _
                                    "c:\Program Files\Actual Spy", "c:\Program Files\AdvSearch", "c:\Program Files\AppsTraka", _
                                    "c:\Program Files\Ardamax Keylogger", "c:\Program Files\Auto Keylogger", _
                                    "c:\Program Files\BazookaBar", "c:\Program Files\Blackbox7", "c:\Program Files\Blackbox7", _
                                    "c:\Program Files\BTV"}
    ' Adware Files.
    Dim Adware_Files() As String = {"c:\Program Files\AdStatComm.dll", "C:\Program Files\0er8k4va\0er8k4va.exe", _
                                    " C:\WINDOWS\System32\Mkfxut.exe", " C:\WINDOWS\system32\pkdacs.exe", _
                                    "C:\WINDOWS\System32\ywrqku.exe", " C:\windows\system32\msnavc32.exe", _
                                    "C:\Program Files\AutoUpdate\AutoUpdate.exe", " C:\WINDOWS\System32\winntcreate.exe", _
                                    "C:\WINDOWS\System32\vwix32.exe", " C:\WINDOWS\System32\sysmonnt.exe", _
                                    "C:\WINDOWS\System32\winhcek32.exe", " C:\WINDOWS\System32\qlykdnb.dll", _
                                    "C:\WINDOWS\System32\rypgvtoimrl.exe", " C:\WINDOWS\System32\spwgoc.exe ", _
                                    "C:\windows\system32\msnavc32.exe", " C:\WINDOWS\System32\sysmonnt", _
                                    "C:\Program Files\hpdll\hpdll.exe ", " C:\WINDOWS\System32\w?wexec.exe", _
                                    "C:\WINDOWS\isrvs\ffisearch.exe", "c:\Program Files\Autosearch.dll"}
    'Adware Directories - Full Path.
    Dim Adware_Dirs() As String = {"c:\Program Files\180 SearchAssistant", "c:\Program Files\2Search", "c:\Program Files\5whgue21", _
                                   "c:\Program Files\aolx", "c:\Program Files\ACM", "c:\Program Files\Browser Pal", _
                                   "c:\Program Files\Activity Keylogger", "c:\Program Files\Activity Logger", _
                                   "c:\Program Files\Actual Spy", "c:\Program Files\AdvSearch", "c:\Program Files\AppsTraka", _
                                   "c:\Program Files\Ardamax Keylogger", "c:\Program Files\Auto Keylogger", _
                                   "c:\Program Files\BazookaBar", "c:\Program Files\Blackbox7", "c:\Program Files\Blackbox7", _
                                   "c:\Program Files\BTV"}

#End Region

#Region "Other Declarations"
    ' Holds the count to how many of each is found.  Used for form 2.
    Public VirusesFound As Integer = 0
    Public SpywareFound As Integer = 0
    Public AdwareFound As Integer = 0
    Dim FileDirCount As Integer = 0
    Dim FileCount As Integer = 0
#End Region

#Region "When Program Loads"
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Select first option on program start.
        ComboBox1.SelectedIndex = 0
    End Sub
#End Region

#Region "Scan Button"
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Clear FoundFiles and FoundDirs Arrays for each time Scan button is clicked.
        FoundDirs.Clear()
        FoundFiles.Clear()
        ' Reset FileDirCount and FileCount to 0.
        FileDirCount = 0
        FileCount = 0
        ' Reset Progress Bar Value.
        ProgressBar1.Value = 0
        ' Set ProgressBar1 Maximum.
        Select Case ComboBox1.SelectedIndex
            Case 0
                ProgressBar1.Maximum = Worms_Dirs.Length + Worms_Files.Length
            Case 1
                ProgressBar1.Maximum = Spyware_Dirs.Length + Spyware_Files.Length
            Case 2
                ProgressBar1.Maximum = Adware_Dirs.Length + Adware_Files.Length
        End Select

        'Start Timer.
        Timer1.Enabled = True
        label3.Text = "Scan Started"
        'Enable STOP SCAN button, Disable SCAN and CLEAN VIRUSES button.
        Button1.Enabled = False
        Button2.Enabled = False
        Button3.Enabled = True
    End Sub
#End Region

#Region "Registration, Yet to do"
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        ' Registration Form.
        'Form3.Show()
    End Sub
#End Region

#Region "Clean Viruses Button"
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If FoundDirs.Count Or FoundFiles.Count = 0 Then
            MessageBox.Show("There are either no viruses found or you have not scanned., ", "Uh-Oh", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Else
            Me.Hide()
            Form2.Show()
        End If
    End Sub
#End Region

#Region "The Main Method, File and Directory Search, ProgressBar etc"
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ' Loop through each file/dir on each tick of the timer.  Currently set to 500, any lower the message box appears before Bar has finished.
        Select Case ComboBox1.SelectedIndex
            Case 0
                If FileCount < Worms_Files.GetUpperBound(0) Then
                    If IO.File.Exists(Worms_Files(FileCount)) Then
                        FoundFiles.Add(Worms_Files(FileCount))
                        VirusesFound += 1
                    End If
                End If
                If FileDirCount < Worms_Dirs.GetUpperBound(0) Then
                    If IO.Directory.Exists(Worms_Dirs(FileDirCount)) Then
                        FoundDirs.Add(Worms_Dirs(FileDirCount))
                        VirusesFound += 1
                    End If
                End If

            Case 1
                If FileCount < Spyware_Files.GetUpperBound(0) Then
                    If IO.File.Exists(Spyware_Files(FileCount)) Then
                        FoundFiles.Add(Spyware_Files(FileCount))
                        VirusesFound += 1
                    End If
                End If
                If FileDirCount < Spyware_Dirs.GetUpperBound(0) Then
                    If IO.Directory.Exists(Spyware_Dirs(FileDirCount)) Then
                        FoundDirs.Add(Spyware_Dirs(FileDirCount))
                        VirusesFound += 1
                    End If
                End If

            Case 2
                If FileCount < Adware_Files.GetUpperBound(0) Then
                    If IO.File.Exists(Adware_Files(FileCount)) Then
                        FoundFiles.Add(Adware_Files(FileCount))
                        VirusesFound += 1
                    End If
                End If
                If FileDirCount < Adware_Dirs.GetUpperBound(0) Then
                    If IO.Directory.Exists(Adware_Dirs(FileDirCount)) Then
                        FoundDirs.Add(Adware_Dirs(FileDirCount))
                        VirusesFound += 1
                    End If
                End If
        End Select

        ' Has the ProgressBar value reached its maximum?  if so stop timer and show message, otherwise keep going.
        If ProgressBar1.Value = ProgressBar1.Maximum Then
            Timer1.Enabled = False
            label3.Text = "Scan Completed"
            MessageBox.Show("Your computer has been scanned!  Click the Clean Viruses Button, and we'll show you the results!", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Button1.Enabled = True
            Button2.Enabled = True
            Button3.Enabled = False
        Else
            FileDirCount += 1
            ProgressBar1.Value += 1
        End If
    End Sub
#End Region

#Region "Stop Scan Button"
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Timer1.Enabled = False
        label3.Text = "Scan Stopped"
        ProgressBar1.Value = 0
        Button1.Enabled = True
        Button2.Enabled = True
        Button3.Enabled = False
    End Sub
#End Region

Any comments Boss? Its your project :)

Coordinator
Sep 21, 2009 at 12:59 PM

Sorry to say this, Camarade, but for  the Form2 code pasted, VB found many errors :( . NP, it's not your fault. I've changed them, hope i've changed them well.

1) lblMessage.Text changed to Label3.Text

Reason:

lblMesagge is not declared.

2) Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub     DELETED

Reason:

I haven't got a Button2 in Form 2

3) And

' Add to Listbox 2, depending on what form1.combobox selection.
        Select Case Form1.ComboBox1.SelectedIndex
            Case 0 ' Scan for Virus(s).
                ListBox2.Items.Add("Viruses Found " & Form1.VirusesFound)
            Case 1 ' Scan for SpyWare.
                ListBox2.Items.Add("Spyware Found " & Form1.SpywareFound)
            Case 2 ' Scan for AdWare.
                ListBox2.Items.Add("Adware Found " & Form1.AdwareFound)
        End Select
    End Sub

I didn't know what to do here, because i didn't know what it means :D :))

Errors: 'VirusesFound' is not a member of 'Security_Pilot_Anti_Virus.Form1'

           'SpywareFound' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    47    Security Pilot Anti-Virus'

           'AdwareFound' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    49    Security Pilot Anti-Virus'

I'll analize the fresh Form1 code post imediately.

Waiting for a reply.

Greetings from the "Boss", LoL.

Coordinator
Sep 21, 2009 at 1:09 PM

Oh, My GUSH. 36 Errors in Form1 Code:

Region "Declare Arrays for Found Files and Found Dirs"
Public FoundFiles As New ArrayList
Public FoundDirs As New ArrayList
#End Region

#Region "Declaration of Arrays for Folders and Files"
' Worms/Tojans Files.
Dim Worms_Files() As String = {"c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe", "c:\avtest.txt"}
' Worms/Tojans Directories - Full Path.
Dim Worms_Dirs() As String = {"c:\Program Files\aolx", "c:\Program Files\BTV", "c:\avtest"}

' Spyware Files.
Dim Spyware_Files() As String = {"C:\Program Files\AdStatComm.dll", "C:\Program Files\0er8k4va\0er8k4va.exe", _
                                 "C:\WINDOWS\System32\Mkfxut.exe", "C:\WINDOWS\system32\pkdacs.exe", _
                                 "C:\WINDOWS\System32\ywrqku.exe", "C:\windows\system32\msnavc32.exe", _
                                 "C:\Program Files\AutoUpdate\AutoUpdate.exe", "C:\WINDOWS\System32\vwix32.exe", _
                                 "C:\WINDOWS\System32\winntcreate.exe", "C:\WINDOWS\System32\sysmonnt.exe", _
                                 "C:\WINDOWS\System32\winhcek32.exe", "C:\WINDOWS\System32\qlykdnb.dll", _
                                 "C:\WINDOWS\System32\rypgvtoimrl.exe", "C:\WINDOWS\System32\spwgoc.exe", _
                                 "C:\windows\system32\msnavc32.exe", "C:\WINDOWS\System32\sysmonnt", _
                                 "C:\Program Files\hpdll\hpdll.exe", "C:\WINDOWS\System32\w?wexec.exe", _
                                 "C:\WINDOWS\isrvs\ffisearch.exe", "c:\Program Files\Autosearch.dll", _
                                 "c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe"}
'Spyware Directories - Full Path.
Dim Spyware_Dirs() As String = {"c:\Program Files\180 SearchAssistant", "c:\Program Files\2Search", "c:\Program Files\5whgue21", _
                                "c:\Program Files\aolx", "c:\Program Files\ACM", "c:\Program Files\Browser Pal", _
                                "c:\Program Files\Activity Keylogger", "c:\Program Files\Activity Logger", _
                                "c:\Program Files\Actual Spy", "c:\Program Files\AdvSearch", "c:\Program Files\AppsTraka", _
                                "c:\Program Files\Ardamax Keylogger", "c:\Program Files\Auto Keylogger", _
                                "c:\Program Files\BazookaBar", "c:\Program Files\Blackbox7", "c:\Program Files\Blackbox7", _
                                "c:\Program Files\BTV"}
' Adware Files.
Dim Adware_Files() As String = {"c:\Program Files\AdStatComm.dll", "C:\Program Files\0er8k4va\0er8k4va.exe", _
                                " C:\WINDOWS\System32\Mkfxut.exe", " C:\WINDOWS\system32\pkdacs.exe", _
                                "C:\WINDOWS\System32\ywrqku.exe", " C:\windows\system32\msnavc32.exe", _
                                "C:\Program Files\AutoUpdate\AutoUpdate.exe", " C:\WINDOWS\System32\winntcreate.exe", _
                                "C:\WINDOWS\System32\vwix32.exe", " C:\WINDOWS\System32\sysmonnt.exe", _
                                "C:\WINDOWS\System32\winhcek32.exe", " C:\WINDOWS\System32\qlykdnb.dll", _
                                "C:\WINDOWS\System32\rypgvtoimrl.exe", " C:\WINDOWS\System32\spwgoc.exe ", _
                                "C:\windows\system32\msnavc32.exe", " C:\WINDOWS\System32\sysmonnt", _
                                "C:\Program Files\hpdll\hpdll.exe ", " C:\WINDOWS\System32\w?wexec.exe", _
                                "C:\WINDOWS\isrvs\ffisearch.exe", "c:\Program Files\Autosearch.dll"}
'Adware Directories - Full Path.
Dim Adware_Dirs() As String = {"c:\Program Files\180 SearchAssistant", "c:\Program Files\2Search", "c:\Program Files\5whgue21", _
                               "c:\Program Files\aolx", "c:\Program Files\ACM", "c:\Program Files\Browser Pal", _
                               "c:\Program Files\Activity Keylogger", "c:\Program Files\Activity Logger", _
                               "c:\Program Files\Actual Spy", "c:\Program Files\AdvSearch", "c:\Program Files\AppsTraka", _
                               "c:\Program Files\Ardamax Keylogger", "c:\Program Files\Auto Keylogger", _
                               "c:\Program Files\BazookaBar", "c:\Program Files\Blackbox7", "c:\Program Files\Blackbox7", _
                               "c:\Program Files\BTV"}

#End Region

#Region "Other Declarations"
' Holds the count to how many of each is found.  Used for form 2.
Public VirusesFound As Integer = 0
Public SpywareFound As Integer = 0
Public AdwareFound As Integer = 0
Dim FileDirCount As Integer = 0
Dim FileCount As Integer = 0
#End Region

#Region "When Program Loads"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ' Select first option on program start.
    ComboBox1.SelectedIndex = 0
End Sub
#End Region

#Region "Scan Button"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ' Clear FoundFiles and FoundDirs Arrays for each time Scan button is clicked.
    FoundDirs.Clear()
    FoundFiles.Clear()
    ' Reset FileDirCount and FileCount to 0.
    FileDirCount = 0
    FileCount = 0
    ' Reset Progress Bar Value.
    ProgressBar1.Value = 0
    ' Set ProgressBar1 Maximum.
    Select Case ComboBox1.SelectedIndex
        Case 0
            ProgressBar1.Maximum = Worms_Dirs.Length + Worms_Files.Length
        Case 1
            ProgressBar1.Maximum = Spyware_Dirs.Length + Spyware_Files.Length
        Case 2
            ProgressBar1.Maximum = Adware_Dirs.Length + Adware_Files.Length
    End Select

    'Start Timer.
    Timer1.Enabled = True
    label3.Text = "Scan Started"
    'Enable STOP SCAN button, Disable SCAN and CLEAN VIRUSES button.
    Button1.Enabled = False
    Button2.Enabled = False
    Button3.Enabled = True
End Sub
#End Region

#Region "Registration, Yet to do"
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
    ' Registration Form.
    'Form3.Show()
End Sub
#End Region

#Region "Clean Viruses Button"
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    If FoundDirs.Count Or FoundFiles.Count = 0 Then
        MessageBox.Show("There are either no viruses found or you have not scanned., ", "Uh-Oh", MessageBoxButtons.OK, MessageBoxIcon.Information)
    Else
        Me.Hide()
        Form2.Show()
    End If
End Sub
#End Region

#Region "The Main Method, File and Directory Search, ProgressBar etc"
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    ' Loop through each file/dir on each tick of the timer.  Currently set to 500, any lower the message box appears before Bar has finished.
    Select Case ComboBox1.SelectedIndex
        Case 0
            If FileCount < Worms_Files.GetUpperBound(0) Then
                If IO.File.Exists(Worms_Files(FileCount)) Then
                    FoundFiles.Add(Worms_Files(FileCount))
                    VirusesFound += 1
                End If
            End If
            If FileDirCount < Worms_Dirs.GetUpperBound(0) Then
                If IO.Directory.Exists(Worms_Dirs(FileDirCount)) Then
                    FoundDirs.Add(Worms_Dirs(FileDirCount))
                    VirusesFound += 1
                End If
            End If

        Case 1
            If FileCount < Spyware_Files.GetUpperBound(0) Then
                If IO.File.Exists(Spyware_Files(FileCount)) Then
                    FoundFiles.Add(Spyware_Files(FileCount))
                    VirusesFound += 1
                End If
            End If
            If FileDirCount < Spyware_Dirs.GetUpperBound(0) Then
                If IO.Directory.Exists(Spyware_Dirs(FileDirCount)) Then
                    FoundDirs.Add(Spyware_Dirs(FileDirCount))
                    VirusesFound += 1
                End If
            End If

        Case 2
            If FileCount < Adware_Files.GetUpperBound(0) Then
                If IO.File.Exists(Adware_Files(FileCount)) Then
                    FoundFiles.Add(Adware_Files(FileCount))
                    VirusesFound += 1
                End If
            End If
            If FileDirCount < Adware_Dirs.GetUpperBound(0) Then
                If IO.Directory.Exists(Adware_Dirs(FileDirCount)) Then
                    FoundDirs.Add(Adware_Dirs(FileDirCount))
                    VirusesFound += 1
                End If
            End If
    End Select

    ' Has the ProgressBar value reached its maximum?  if so stop timer and show message, otherwise keep going.
    If ProgressBar1.Value = ProgressBar1.Maximum Then
        Timer1.Enabled = False
        label3.Text = "Scan Completed"
        MessageBox.Show("Your computer has been scanned!  Click the Clean Viruses Button, and we'll show you the results!", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Button1.Enabled = True
        Button2.Enabled = True
        Button3.Enabled = False
    Else
        FileDirCount += 1
        ProgressBar1.Value += 1
    End If
End Sub
#End Region

#Region "Stop Scan Button"
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Timer1.Enabled = False
    label3.Text = "Scan Stopped"
    ProgressBar1.Value = 0
    Button1.Enabled = True
    Button2.Enabled = True
    Button3.Enabled = False
End Sub
#End Region

Errors:

'#End Region' must be preceded by a matching '#Region'.    4    Security Pilot Anti-Virus
'AdwareFound' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    49    Security Pilot Anti-Virus
'FoundDirs' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    20    Security Pilot Anti-Virus
'FoundDirs' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    23    Security Pilot Anti-Virus
'FoundDirs' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    24    Security Pilot Anti-Virus
'FoundDirs' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    25    Security Pilot Anti-Virus
'FoundDirs' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    57    Security Pilot Anti-Virus
'FoundDirs' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    58    Security Pilot Anti-Virus
'FoundFiles' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    20    Security Pilot Anti-Virus
'FoundFiles' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    23    Security Pilot Anti-Virus
'FoundFiles' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    28    Security Pilot Anti-Virus
'FoundFiles' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    29    Security Pilot Anti-Virus
'FoundFiles' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    61    Security Pilot Anti-Virus
'FoundFiles' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    62    Security Pilot Anti-Virus
'SpywareFound' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    47    Security Pilot Anti-Virus
'VirusesFound' is not a member of 'Security_Pilot_Anti_Virus.Form1'.    45    Security Pilot Anti-Virus
Declaration expected.    1    Security Pilot Anti-Virus
Statement is not valid in a namespace.    2    Security Pilot Anti-Virus
Statement is not valid in a namespace.    3    Security Pilot Anti-Virus
Statement is not valid in a namespace.    8    Security Pilot Anti-Virus
Statement is not valid in a namespace.    10    Security Pilot Anti-Virus
Statement is not valid in a namespace.    13    Security Pilot Anti-Virus
Statement is not valid in a namespace.    25    Security Pilot Anti-Virus
Statement is not valid in a namespace.    33    Security Pilot Anti-Virus
Statement is not valid in a namespace.    44    Security Pilot Anti-Virus
Statement is not valid in a namespace.    56    Security Pilot Anti-Virus
Statement is not valid in a namespace.    57    Security Pilot Anti-Virus
Statement is not valid in a namespace.    58    Security Pilot Anti-Virus
Statement is not valid in a namespace.    59    Security Pilot Anti-Virus
Statement is not valid in a namespace.    60    Security Pilot Anti-Virus
Statement is not valid in a namespace.    64    Security Pilot Anti-Virus
Statement is not valid in a namespace.    71    Security Pilot Anti-Virus
Statement is not valid in a namespace.    101    Security Pilot Anti-Virus
Statement is not valid in a namespace.    108    Security Pilot Anti-Virus
Statement is not valid in a namespace.    119    Security Pilot Anti-Virus
Statement is not valid in a namespace.    181    Security Pilot Anti-Virus

When i saw this, i thaught that i better not modify anything, and let you revision a little bit the code.  I got a lot of statement is not valid in a namespace, but also lots of non-members of a form.

Please take a more clear look at the code.

For relaxing, i reccomend a cup of coffee(believe me, it really makes you happy and relaxed!).

Have fun with programming, and also try to clue why after scanning, the program always closes.

Message from Da "Boss".

 

 

Sep 21, 2009 at 1:46 PM
Edited Sep 21, 2009 at 1:49 PM

Did you paste the code in between Public Class Form1 and End Class

Try this code, I have included the above tags.

Public Class Form1
#Region "Declare Arrays for Found Files and Found Dirs"
    Public FoundFiles As New ArrayList
    Public FoundDirs As New ArrayList
#End Region

#Region "Declaration of Arrays for Folders and Files"
    ' Worms/Tojans Files.
    Dim Worms_Files() As String = {"c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe", "c:\avtest.txt"}
    ' Worms/Tojans Directories - Full Path.
    Dim Worms_Dirs() As String = {"c:\Program Files\aolx", "c:\Program Files\BTV", "c:\avtest"}

    ' Spyware Files.
    Dim Spyware_Files() As String = {"C:\Program Files\AdStatComm.dll", "C:\Program Files\0er8k4va\0er8k4va.exe", _
                                     "C:\WINDOWS\System32\Mkfxut.exe", "C:\WINDOWS\system32\pkdacs.exe", _
                                     "C:\WINDOWS\System32\ywrqku.exe", "C:\windows\system32\msnavc32.exe", _
                                     "C:\Program Files\AutoUpdate\AutoUpdate.exe", "C:\WINDOWS\System32\vwix32.exe", _
                                     "C:\WINDOWS\System32\winntcreate.exe", "C:\WINDOWS\System32\sysmonnt.exe", _
                                     "C:\WINDOWS\System32\winhcek32.exe", "C:\WINDOWS\System32\qlykdnb.dll", _
                                     "C:\WINDOWS\System32\rypgvtoimrl.exe", "C:\WINDOWS\System32\spwgoc.exe", _
                                     "C:\windows\system32\msnavc32.exe", "C:\WINDOWS\System32\sysmonnt", _
                                     "C:\Program Files\hpdll\hpdll.exe", "C:\WINDOWS\System32\w?wexec.exe", _
                                     "C:\WINDOWS\isrvs\ffisearch.exe", "c:\Program Files\Autosearch.dll", _
                                     "c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe"}
    'Spyware Directories - Full Path.
    Dim Spyware_Dirs() As String = {"c:\Program Files\180 SearchAssistant", "c:\Program Files\2Search", "c:\Program Files\5whgue21", _
                                    "c:\Program Files\aolx", "c:\Program Files\ACM", "c:\Program Files\Browser Pal", _
                                    "c:\Program Files\Activity Keylogger", "c:\Program Files\Activity Logger", _
                                    "c:\Program Files\Actual Spy", "c:\Program Files\AdvSearch", "c:\Program Files\AppsTraka", _
                                    "c:\Program Files\Ardamax Keylogger", "c:\Program Files\Auto Keylogger", _
                                    "c:\Program Files\BazookaBar", "c:\Program Files\Blackbox7", "c:\Program Files\Blackbox7", _
                                    "c:\Program Files\BTV"}
    ' Adware Files.
    Dim Adware_Files() As String = {"c:\Program Files\AdStatComm.dll", "C:\Program Files\0er8k4va\0er8k4va.exe", _
                                    " C:\WINDOWS\System32\Mkfxut.exe", " C:\WINDOWS\system32\pkdacs.exe", _
                                    "C:\WINDOWS\System32\ywrqku.exe", " C:\windows\system32\msnavc32.exe", _
                                    "C:\Program Files\AutoUpdate\AutoUpdate.exe", " C:\WINDOWS\System32\winntcreate.exe", _
                                    "C:\WINDOWS\System32\vwix32.exe", " C:\WINDOWS\System32\sysmonnt.exe", _
                                    "C:\WINDOWS\System32\winhcek32.exe", " C:\WINDOWS\System32\qlykdnb.dll", _
                                    "C:\WINDOWS\System32\rypgvtoimrl.exe", " C:\WINDOWS\System32\spwgoc.exe ", _
                                    "C:\windows\system32\msnavc32.exe", " C:\WINDOWS\System32\sysmonnt", _
                                    "C:\Program Files\hpdll\hpdll.exe ", " C:\WINDOWS\System32\w?wexec.exe", _
                                    "C:\WINDOWS\isrvs\ffisearch.exe", "c:\Program Files\Autosearch.dll"}
    'Adware Directories - Full Path.
    Dim Adware_Dirs() As String = {"c:\Program Files\180 SearchAssistant", "c:\Program Files\2Search", "c:\Program Files\5whgue21", _
                                   "c:\Program Files\aolx", "c:\Program Files\ACM", "c:\Program Files\Browser Pal", _
                                   "c:\Program Files\Activity Keylogger", "c:\Program Files\Activity Logger", _
                                   "c:\Program Files\Actual Spy", "c:\Program Files\AdvSearch", "c:\Program Files\AppsTraka", _
                                   "c:\Program Files\Ardamax Keylogger", "c:\Program Files\Auto Keylogger", _
                                   "c:\Program Files\BazookaBar", "c:\Program Files\Blackbox7", "c:\Program Files\Blackbox7", _
                                   "c:\Program Files\BTV"}

#End Region

#Region "Other Declarations"
    ' Holds the count to how many of each is found.  Used for form 2.
    Public VirusesFound As Integer = 0
    Public SpywareFound As Integer = 0
    Public AdwareFound As Integer = 0
    Dim FileDirCount As Integer = 0
    Dim FileCount As Integer = 0
#End Region

#Region "When Program Loads"
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Select first option on program start.
        ComboBox1.SelectedIndex = 0
    End Sub
#End Region

#Region "Scan Button"
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Clear FoundFiles and FoundDirs Arrays for each time Scan button is clicked.
        FoundDirs.Clear()
        FoundFiles.Clear()
        ' Reset FileDirCount and FileCount to 0.
        FileDirCount = 0
        FileCount = 0
        ' Reset Progress Bar Value.
        ProgressBar1.Value = 0
        ' Set ProgressBar1 Maximum.
        Select Case ComboBox1.SelectedIndex
            Case 0
                ProgressBar1.Maximum = Worms_Dirs.Length + Worms_Files.Length
            Case 1
                ProgressBar1.Maximum = Spyware_Dirs.Length + Spyware_Files.Length
            Case 2
                ProgressBar1.Maximum = Adware_Dirs.Length + Adware_Files.Length
        End Select

        'Start Timer.
        Timer1.Enabled = True
        label3.Text = "Scan Started"
        'Enable STOP SCAN button, Disable SCAN and CLEAN VIRUSES button.
        Button1.Enabled = False
        Button2.Enabled = False
        Button3.Enabled = True
    End Sub
#End Region

#Region "Registration, Yet to do"
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        ' Registration Form.
        'Form3.Show()
    End Sub
#End Region

#Region "Clean Viruses Button"
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If FoundDirs.Count Or FoundFiles.Count = 0 Then
            MessageBox.Show("There are either no viruses found or you have not scanned., ", "Uh-Oh", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Else
            Me.Hide()
            Form2.Show()
        End If
    End Sub
#End Region

#Region "The Main Method, File and Directory Search, ProgressBar etc"
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ' Loop through each file/dir on each tick of the timer.  Currently set to 500, any lower the message box appears before Bar has finished.
        Select Case ComboBox1.SelectedIndex
            Case 0
                If FileCount < Worms_Files.GetUpperBound(0) Then
                    If IO.File.Exists(Worms_Files(FileCount)) Then
                        FoundFiles.Add(Worms_Files(FileCount))
                        VirusesFound += 1
                    End If
                End If
                If FileDirCount < Worms_Dirs.GetUpperBound(0) Then
                    If IO.Directory.Exists(Worms_Dirs(FileDirCount)) Then
                        FoundDirs.Add(Worms_Dirs(FileDirCount))
                        VirusesFound += 1
                    End If
                End If

            Case 1
                If FileCount < Spyware_Files.GetUpperBound(0) Then
                    If IO.File.Exists(Spyware_Files(FileCount)) Then
                        FoundFiles.Add(Spyware_Files(FileCount))
                        VirusesFound += 1
                    End If
                End If
                If FileDirCount < Spyware_Dirs.GetUpperBound(0) Then
                    If IO.Directory.Exists(Spyware_Dirs(FileDirCount)) Then
                        FoundDirs.Add(Spyware_Dirs(FileDirCount))
                        VirusesFound += 1
                    End If
                End If

            Case 2
                If FileCount < Adware_Files.GetUpperBound(0) Then
                    If IO.File.Exists(Adware_Files(FileCount)) Then
                        FoundFiles.Add(Adware_Files(FileCount))
                        VirusesFound += 1
                    End If
                End If
                If FileDirCount < Adware_Dirs.GetUpperBound(0) Then
                    If IO.Directory.Exists(Adware_Dirs(FileDirCount)) Then
                        FoundDirs.Add(Adware_Dirs(FileDirCount))
                        VirusesFound += 1
                    End If
                End If
        End Select

        ' Has the ProgressBar value reached its maximum?  if so stop timer and show message, otherwise keep going.
        If ProgressBar1.Value = ProgressBar1.Maximum Then
            Timer1.Enabled = False
            label3.Text = "Scan Completed"
            MessageBox.Show("Your computer has been scanned!  Click the Clean Viruses Button, and we'll show you the results!", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Button1.Enabled = True
            Button2.Enabled = True
            Button3.Enabled = False
        Else
            FileDirCount += 1
            ProgressBar1.Value += 1
        End If
    End Sub
#End Region

#Region "Stop Scan Button"
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Timer1.Enabled = False
        label3.Text = "Scan Stopped"
        ProgressBar1.Value = 0
        Button1.Enabled = True
        Button2.Enabled = True
        Button3.Enabled = False
    End Sub
#End Region

End Class

Coordinator
Sep 21, 2009 at 1:53 PM

Yes, this worked, THNX a lot, you rule!

Take a look at the Form2 Code, too!

 

Sep 21, 2009 at 2:25 PM
Edited Sep 21, 2009 at 2:30 PM

YAY for form1.  Now for Form2.

1) Changing the label is fine - If you find the text dosnt fit - you may have to resise the label.  The size I made the label was 293 , 78.

2) Thats ok to delete it, since you havnt got it and because

3) You dont have to do anything there.  I just didnt comment it right.  Basically depending on what was selected to scan on form1, will determin what is added to listbox 2.

4) Those errors should go away now as form1 is now working.

 

Form2 Updated Code with your changes.  I havnt done the progress bar for form2 yet.

Public Class Form2
    ''' <summary>
    ''' FORM2.
    ''' Listbox1 = Lists found Files and Directories.
    ''' Listbox2 = Lists details about what is found.
    ''' lblMessage = Label to display Viruses Found or not found.  Text is red if found, green if nothing found.
    ''' Button1 = Clean viruses.
    ''' ProgressBar1 = Progress of Cleaning. TO DO.
    ''' VirusCount = Will be used for ProgressBar1.
    ''' </summary>
    ''' <remarks></remarks>
    Dim VirusCount As Integer = 0

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Make sure listboxes are cleared before anything is added.
        ListBox1.Items.Clear()
        ListBox2.Items.Clear()

        ' How many total items found, used for progress bar.
        VirusCount = Form1.FoundFiles.Count + Form1.FoundDirs.Count

        ' Get list of any items from Arrays "FoundFiles" and "FoundDirs"
        If Form1.FoundDirs.Count Or Form1.FoundFiles.Count > 0 Then
            For i = 0 To Form1.FoundDirs.Count - 1
                ListBox1.Items.Add(Form1.FoundDirs(i))
            Next

            For i = 0 To Form1.FoundFiles.Count - 1
                ListBox1.Items.Add(Form1.FoundFiles(i))
            Next

            ' Enable "Clean" button if there are any virses, otherwise leave disabled and show appropiate mesage.
            Label3.ForeColor = Color.Red
            Label3.Text = "Your computer is a major risk, Anti-Virus suggests you clean the spotted viruses"
            Button1.Enabled = True
        Else
            Label3.ForeColor = Color.Green
            Label3.Text = "No viruses found. Your computer is clean."
            Button1.Enabled = False
        End If

        ' Add to Listbox 2, depending on what form1.combobox selection.
        Select Case Form1.ComboBox1.SelectedIndex
            Case 0 ' Viruses.
                ListBox2.Items.Add("Viruses Found " & Form1.VirusesFound)
            Case 1 ' Spyware.
                ListBox2.Items.Add("Spyware Found " & Form1.SpywareFound)
            Case 2 ' Adware.
                ListBox2.Items.Add("Adware Found " & Form1.AdwareFound)
        End Select
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Clean Button.
        Try
            ' Delete Directories.
            For i = 0 To Form1.FoundDirs.Count - 1
                IO.Directory.Delete(Form1.FoundDirs(i))
            Next

            For i = 0 To Form1.FoundFiles.Count - 1
                IO.File.Delete(Form1.FoundFiles(i))
            Next
            ' Files and Directories have been deleted.
            MessageBox.Show("Your computer has been Cleaned", "Successs", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Catch ex As Exception
            ' Any errors, like cant delete a file - show here.
            MessageBox.Show(ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Private Sub Form2_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
        Form1.Show()
    End Sub
End Class
Coordinator
Sep 22, 2009 at 11:02 AM
Edited Sep 22, 2009 at 11:03 AM

The code for Form1 is not Good. The first problem is that when the scan finishes, i'm not redirected to the Form2, instead i recieve a message: "There are either noit viruses found...". Maybe you wrong understanded what i wanted. I don't what a message like that, i want to be redirected to the Form2, and there in the label3, to appear a message wich depends on the Scan detects.

So, I scan my computer in Form1, then i recieve a message that my comp. was been scanned, and i must check the clean viruses page(Form2). I click the Clean Viruses Button, than i'm redirected to Form2, in the 2 listboxes i must have all i need(Viruses detected and total number) and in the Label3, It must appear message to say that my computer has no viruses, or if viruses appear in the first listbox, then to suggest me to clean them, because my comp. is at risk.

This should happen, in the 2 forms.

AND THE BIGGEST PROBLEM:

THE SCAN DOESN"T WORK GOOD. It made directories with names like one in the code, in Program Files, and the Scan doesn't detect them. So, please recheck the Form1 Code, cause it doesn't work as it should.

Form DA 'Boss".

How it's the weather in New Zealand?

Form1Code(doesn't work good):

 

Public Class Form1
#Region "Declare Arrays for Found Files and Found Dirs"
    Public FoundFiles As New ArrayList
    Public FoundDirs As New ArrayList
#End Region

#Region "Declaration of Arrays for Folders and Files"
    ' Worms/Tojans Files.
    Dim Worms_Files() As String = {"c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe", "c:\avtest.txt"}
    ' Worms/Tojans Directories - Full Path.
    Dim Worms_Dirs() As String = {"c:\Program Files\aolx", "c:\Program Files\BTV", "c:\avtest"}

    ' Spyware Files.
    Dim Spyware_Files() As String = {"C:\Program Files\AdStatComm.dll", "C:\Program Files\0er8k4va\0er8k4va.exe", _
                                     "C:\WINDOWS\System32\Mkfxut.exe", "C:\WINDOWS\system32\pkdacs.exe", _
                                     "C:\WINDOWS\System32\ywrqku.exe", "C:\windows\system32\msnavc32.exe", _
                                     "C:\Program Files\AutoUpdate\AutoUpdate.exe", "C:\WINDOWS\System32\vwix32.exe", _
                                     "C:\WINDOWS\System32\winntcreate.exe", "C:\WINDOWS\System32\sysmonnt.exe", _
                                     "C:\WINDOWS\System32\winhcek32.exe", "C:\WINDOWS\System32\qlykdnb.dll", _
                                     "C:\WINDOWS\System32\rypgvtoimrl.exe", "C:\WINDOWS\System32\spwgoc.exe", _
                                     "C:\windows\system32\msnavc32.exe", "C:\WINDOWS\System32\sysmonnt", _
                                     "C:\Program Files\hpdll\hpdll.exe", "C:\WINDOWS\System32\w?wexec.exe", _
                                     "C:\WINDOWS\isrvs\ffisearch.exe", "c:\Program Files\Autosearch.dll", _
                                     "c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe"}
    'Spyware Directories - Full Path.
    Dim Spyware_Dirs() As String = {"c:\Program Files\180 SearchAssistant", "c:\Program Files\2Search", "c:\Program Files\5whgue21", _
                                    "c:\Program Files\aolx", "c:\Program Files\ACM", "c:\Program Files\Browser Pal", _
                                    "c:\Program Files\Activity Keylogger", "c:\Program Files\Activity Logger", _
                                    "c:\Program Files\Actual Spy", "c:\Program Files\AdvSearch", "c:\Program Files\AppsTraka", _
                                    "c:\Program Files\Ardamax Keylogger", "c:\Program Files\Auto Keylogger", _
                                    "c:\Program Files\BazookaBar", "c:\Program Files\Blackbox7", "c:\Program Files\Blackbox7", _
                                    "c:\Program Files\BTV"}
    ' Adware Files.
    Dim Adware_Files() As String = {"c:\Program Files\AdStatComm.dll", "C:\Program Files\0er8k4va\0er8k4va.exe", _
                                    " C:\WINDOWS\System32\Mkfxut.exe", " C:\WINDOWS\system32\pkdacs.exe", _
                                    "C:\WINDOWS\System32\ywrqku.exe", " C:\windows\system32\msnavc32.exe", _
                                    "C:\Program Files\AutoUpdate\AutoUpdate.exe", " C:\WINDOWS\System32\winntcreate.exe", _
                                    "C:\WINDOWS\System32\vwix32.exe", " C:\WINDOWS\System32\sysmonnt.exe", _
                                    "C:\WINDOWS\System32\winhcek32.exe", " C:\WINDOWS\System32\qlykdnb.dll", _
                                    "C:\WINDOWS\System32\rypgvtoimrl.exe", " C:\WINDOWS\System32\spwgoc.exe ", _
                                    "C:\windows\system32\msnavc32.exe", " C:\WINDOWS\System32\sysmonnt", _
                                    "C:\Program Files\hpdll\hpdll.exe ", " C:\WINDOWS\System32\w?wexec.exe", _
                                    "C:\WINDOWS\isrvs\ffisearch.exe", "c:\Program Files\Autosearch.dll"}
    'Adware Directories - Full Path.
    Dim Adware_Dirs() As String = {"c:\Program Files\180 SearchAssistant", "c:\Program Files\2Search", "c:\Program Files\5whgue21", _
                                   "c:\Program Files\aolx", "c:\Program Files\ACM", "c:\Program Files\Browser Pal", _
                                   "c:\Program Files\Activity Keylogger", "c:\Program Files\Activity Logger", _
                                   "c:\Program Files\Actual Spy", "c:\Program Files\AdvSearch", "c:\Program Files\AppsTraka", _
                                   "c:\Program Files\Ardamax Keylogger", "c:\Program Files\Auto Keylogger", _
                                   "c:\Program Files\BazookaBar", "c:\Program Files\Blackbox7", "c:\Program Files\Blackbox7", _
                                   "c:\Program Files\BTV"}

#End Region

#Region "Other Declarations"
    ' Holds the count to how many of each is found.  Used for form 2.
    Public VirusesFound As Integer = 0
    Public SpywareFound As Integer = 0
    Public AdwareFound As Integer = 0
    Dim FileDirCount As Integer = 0
    Dim FileCount As Integer = 0
#End Region

#Region "When Program Loads"
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Select first option on program start.
        ComboBox1.SelectedIndex = 0
    End Sub
#End Region

#Region "Scan Button"
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Clear FoundFiles and FoundDirs Arrays for each time Scan button is clicked.
        FoundDirs.Clear()
        FoundFiles.Clear()
        ' Reset FileDirCount and FileCount to 0.
        FileDirCount = 0
        FileCount = 0
        ' Reset Progress Bar Value.
        ProgressBar1.Value = 0
        ' Set ProgressBar1 Maximum.
        Select Case ComboBox1.SelectedIndex
            Case 0
                ProgressBar1.Maximum = Worms_Dirs.Length + Worms_Files.Length
            Case 1
                ProgressBar1.Maximum = Spyware_Dirs.Length + Spyware_Files.Length
            Case 2
                ProgressBar1.Maximum = Adware_Dirs.Length + Adware_Files.Length
        End Select

        'Start Timer.
        Timer1.Enabled = True
        label3.Text = "Scan Started"
        'Enable STOP SCAN button, Disable SCAN and CLEAN VIRUSES button.
        Button1.Enabled = False
        Button2.Enabled = False
        Button3.Enabled = True
    End Sub
#End Region

#Region "Registration, Yet to do"
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        ' Registration Form.
        'Form3.Show()
    End Sub
#End Region

#Region "Clean Viruses Button"
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If FoundDirs.Count Or FoundFiles.Count = 0 Then
            MessageBox.Show("There are either no viruses found or you have not scanned., ", "Uh-Oh", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Else
            Me.Hide()
            Form2.Show()
        End If
    End Sub
#End Region

#Region "The Main Method, File and Directory Search, ProgressBar etc"
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ' Loop through each file/dir on each tick of the timer.  Currently set to 500, any lower the message box appears before Bar has finished.
        Select Case ComboBox1.SelectedIndex
            Case 0
                If FileCount < Worms_Files.GetUpperBound(0) Then
                    If IO.File.Exists(Worms_Files(FileCount)) Then
                        FoundFiles.Add(Worms_Files(FileCount))
                        VirusesFound += 1
                    End If
                End If
                If FileDirCount < Worms_Dirs.GetUpperBound(0) Then
                    If IO.Directory.Exists(Worms_Dirs(FileDirCount)) Then
                        FoundDirs.Add(Worms_Dirs(FileDirCount))
                        VirusesFound += 1
                    End If
                End If

            Case 1
                If FileCount < Spyware_Files.GetUpperBound(0) Then
                    If IO.File.Exists(Spyware_Files(FileCount)) Then
                        FoundFiles.Add(Spyware_Files(FileCount))
                        VirusesFound += 1
                    End If
                End If
                If FileDirCount < Spyware_Dirs.GetUpperBound(0) Then
                    If IO.Directory.Exists(Spyware_Dirs(FileDirCount)) Then
                        FoundDirs.Add(Spyware_Dirs(FileDirCount))
                        VirusesFound += 1
                    End If
                End If

            Case 2
                If FileCount < Adware_Files.GetUpperBound(0) Then
                    If IO.File.Exists(Adware_Files(FileCount)) Then
                        FoundFiles.Add(Adware_Files(FileCount))
                        VirusesFound += 1
                    End If
                End If
                If FileDirCount < Adware_Dirs.GetUpperBound(0) Then
                    If IO.Directory.Exists(Adware_Dirs(FileDirCount)) Then
                        FoundDirs.Add(Adware_Dirs(FileDirCount))
                        VirusesFound += 1
                    End If
                End If
        End Select

        ' Has the ProgressBar value reached its maximum?  if so stop timer and show message, otherwise keep going.
        If ProgressBar1.Value = ProgressBar1.Maximum Then
            Timer1.Enabled = False
            label3.Text = "Scan Completed"
            MessageBox.Show("Your computer has been scanned!  Click the Clean Viruses Button, and we'll show you the results!", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Button1.Enabled = True
            Button2.Enabled = True
            Button3.Enabled = False
        Else
            FileDirCount += 1
            ProgressBar1.Value += 1
        End If
    End Sub
#End Region

#Region "Stop Scan Button"
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Timer1.Enabled = False
        label3.Text = "Scan Stopped"
        ProgressBar1.Value = 0
        Button1.Enabled = True
        Button2.Enabled = True
        Button3.Enabled = False
    End Sub
#End Region

End Class

 

Sep 27, 2009 at 7:14 AM

Hmmm the scan works on my end, but Ill double check that and see what would be causing it not to pick up folders and files, and ill also change the message thing too.

 

Weather is not so good, pretty much been raining for the week, only decent day was today.

Coordinator
Sep 27, 2009 at 11:47 AM

Sorry to hear this :( , the weather here is nice. I've been waiting for some reply,cause from nearly 7 days i didn't hear anyting:D. Hope you'll get the code work.

Your doing Good Job!

Greetings from the "Boss".

Nov 4, 2009 at 6:48 AM

I would most certainly love to be a part of this project. I have been hoping and waiting for someone to create a full fledged anti virus, or even a decent cleaner, in VB. I am new to VB and have been out of the development game for a couple years, since I joined the military. However, I have recently gotten back into it. Back in the day I attempted to create a virus scanning engine in perl, my friend was developing the database. It was on the right track. But VB would be a better choice, and I'm just recently getting into the language. I hope you all are still on the development track with this project. Let me know!

Coordinator
Nov 4, 2009 at 1:06 PM

Sorry to say this but this project is closed for me.This is not how you'll do an AV. It must recognize the files by names, it must recognize them by the code they have.Sorry to saty y this but i do not risk to delete the important files for an OS with my AV.

I'm not interested anymore in this project,neither in programming.

Have a nice day all My EX-TEAM!