[Tutorial] How To Make A Real Anti-Virus (File 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.
18 posts Page 1 of 2
User avatar
NecroPhis
VIP - Donator
VIP - Donator
Posts: 345
Joined: Sun Aug 08, 2010 1:14 pm

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
1st add this codes to top of Form1
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
Image
User avatar
upperdrag
Excellent Poster
Excellent Poster
Posts: 321
Joined: Fri Mar 12, 2010 12:05 pm

leeching someone's stuff and not saying their name is somewhat of a illegal , i have seen this somewhere in mpgh,
User avatar
NecroPhis
VIP - Donator
VIP - Donator
Posts: 345
Joined: Sun Aug 08, 2010 1:14 pm

yeah aLcohoL_95 posted it
its me -.-
and u can look to him signature

or just pm him :arrow: :mrgreen:
Image
User avatar
upperdrag
Excellent Poster
Excellent Poster
Posts: 321
Joined: Fri Mar 12, 2010 12:05 pm

You O.o oic, my mistake, sorry
User avatar
NecroPhis
VIP - Donator
VIP - Donator
Posts: 345
Joined: Sun Aug 08, 2010 1:14 pm

np hope u liked my tutorial cooll;
Image
User avatar
NiBiCTm
VIP - Donator
VIP - Donator
Posts: 51
Joined: Thu Oct 01, 2009 7:30 pm

.. well cool. but it dosent works 100%?.. i downloaded a virus (for testing).. my bullguard detected it, but this one didnt.. but cool
Free, Safe & Professional software at: http://www.teamnibic.com
Code: Select all
   Try
            RichTextBox1.SelectAll() 'this will make all text in Richtextbox1 marked
            Richtextbox1.selectedtext = "Visit my website ;)"
        Catch ex As Exception
        End Try
[/size]
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

NiBiCTm wrote:
.. well cool. but it dosent works 100%?.. i downloaded a virus (for testing).. my bullguard detected it, but this one didnt.. but cool
Yes, it does work 100%, but you'll need to add hashes.
You're crazy!
I'm not crazy, my mother had me tested. ~Sheldon Cooper
User avatar
flashsight
New Member
New Member
Posts: 19
Joined: Fri Jun 18, 2010 7:42 am

Just telling you that you cannot use the code:
Code: Select all
 If TextBox2.Text.Contains(TextBox1.Text)
You should replace the code with:
Code: Select all
If TextBox1.Text = TextBox2.text
User avatar
NecroPhis
VIP - Donator
VIP - Donator
Posts: 345
Joined: Sun Aug 08, 2010 1:14 pm

no now look
TextBox1 has a Lot of Hash Codes
so we cant use your code
we must use "contains" for that
Image
User avatar
tedhead2
Excellent Poster
Excellent Poster
Posts: 338
Joined: Sun Jan 03, 2010 8:36 am

How can i make this search maybe a whole folder?
Image
18 posts Page 1 of 2
Return to “Tutorials”