How to make a real virus scanner

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
9 posts Page 1 of 1
Contributors
User avatar
shor6284
Just Registered
Just Registered
Posts: 7
Joined: Sun Feb 27, 2011 10:57 pm

How to make a real virus scanner
shor6284
today i will show you how to make an %100 real anti-virus with HASH CODES

U need 2 TextBox
2 button
1st button = open
2nd button = scan

1st TextBox will be program's hash
2nd textbox will be virus hashes

Code: Select all
Imports System
Imports System.IO.FileStream
Imports System.Security.Cryptography
Imports System.Text
Imports System.IO 

and button1(open button) codes:

Code: Select all
Dim dialog As New OpenFileDialog
        dialog.CheckFileExists = True
        dialog.CheckPathExists = True
        dialog.ShowDialog()

        Dim provider As New MD5CryptoServiceProvider
        Dim inputStream As New FileStream(dialog.FileName, FileMode.Open, FileAccess.Read, FileShare.Read, &H2000)
        provider.ComputeHash(inputStream)
        Dim hash As Byte() = provider.Hash
        Dim builder As New StringBuilder
        Dim num As Byte
        For Each num In hash
            builder.Append(String.Format("{0:X2}", num))
        Next
        Me.TextBox1.Text = builder.ToString


and scan button codes:

Code: Select all
If TextBox2.Text.Contains(TextBox1.Text) Then
            MsgBox("Virus Found")
        Else
            MsgBox("Safe File")
        End If
http://codeforums.freeforums.org/
MANSQN
VIP - Donator
VIP - Donator
Posts: 159
Joined: Sat Sep 17, 2011 11:33 pm

Re: How to make a real virus scanner
MANSQN
nice. but how does this catch viruses?
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: How to make a real virus scanner
mandai
This is supposed to use MD5 to catch viruses, but the smart ones will be able to bypass this.
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

mandai wrote:
This is supposed to use MD5 to catch viruses, but the smart ones will be able to bypass this.
Mandai wrote a program which changes its own MD5 hash so it is not a really good virus scanner.
Practice makes perfect!

VIP since: 6-10-2011
User avatar
Proprogrammer
VIP - Donator
VIP - Donator
Posts: 415
Joined: Sun Oct 03, 2010 11:14 pm

To make a really good virus scanner you will need to make a program that can decompile .net + C# apps then look through the code for maleware coding, which is what real antivirus's do + hashes of course. And For C++ they look at the api's and what the application calls into, but of course if a virus is made in C++ it is harder to detect.
------------------------------------------------------------------------------
Proprogrammer, not just a Programmer.
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: How to make a real virus scanner
Axel
+ Check what it sends to the internet with a sniffer which I know is pretty damn hard to make
http://vagex.com/?ref=25000
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: How to make a real virus scanner
mandai
If you start checking the internet connection then that would be more of a firewall.
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: How to make a real virus scanner
Axel
What antivirus doesn't have that feature ?
http://vagex.com/?ref=25000
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Axel is right. All AV's nowadays have it...
Practice makes perfect!

VIP since: 6-10-2011
9 posts Page 1 of 1
Return to “Tutorials”