+ Reply to Thread
Results 1 to 4 of 4

Thread: Creating Anti Virus software

  1. #1
    skyfe is offline VB.NET Forum Newbie skyfe is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jan 2009
    Age
    16
    Posts
    14
    Reputation
    21

    Default Creating Anti Virus software

    Hi,

    Was wondering how to create Anti virus Software, using Visual Basic .NET. The part I'm interested into is how to scan a file on malware; how can this be done with Visual Basic .NET? Could anyone explain me what codes, functions, to use, and maybe give a little example? (for example to detect a specific easy to detect virus infection)

    Thanks in advanced,

    Skyfe.

  2. #2
    Invisionsoft's Avatar
    Invisionsoft is offline VB.NET Forum Enthusiast Invisionsoft is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Apr 2007
    Location
    United Kingdom
    Age
    16
    Posts
    64
    Reputation
    50

    Default

    Have a giant array of structures storing all "bad files" and the paths they can appear in (use CSV storage). Then loop through all files and if they match, delete them.

    I have no idea how you would "scan" a file for a malware infection. Way out of my league

  3. #3
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Age
    37
    Posts
    10,843
    Reputation
    1443

    Default

    Start with this or similar articles about general knowledge: What is a virus signature? Are they still used?
    Internet searches and Wiki searches is also recommended.

    About code you should start with FileStream class to read bytes from files.

    Here is a very basic algorithm that searches for a virus signature in a file:
    Code:
    Function detect() As Boolean
        Dim file() As Byte = {1, 2, 3, 4, 5, 6, 7, 8, 9} 'sample file
        Dim virus() As Byte = {4, 5, 6} 'sample signature
    
        For ix As Integer = 0 To file.Length - virus.Length
            If file(ix) = virus(0) Then 'found first byte in signature, check rest
                For vx As Integer = 1 To virus.Length - 1
                    If file(ix + vx) <> virus(vx) Then
                        Exit For
                    ElseIf vx = virus.Length - 1 Then
                        Return True 'virus found
                    End If
                Next
            End If
        Next
        Return False 'virus not found
    End Function

  4. #4
    skyfe is offline VB.NET Forum Newbie skyfe is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jan 2009
    Age
    16
    Posts
    14
    Reputation
    21

    Default

    Hi,

    Thanks a lot, I'll have a further look into it because as for now the code looks rather complicated to me already (whiel it's a basic example as you said), so will have a look at that link about virus signatures.
    Last edited by JohnH; 01-17-2009 at 7:01 AM. Reason: new topic, split to new thread

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts