|
-
Jun 5th, 2010, 12:02 PM
#1
Thread Starter
New Member
-
Jun 5th, 2010, 12:11 PM
#2
Re: VB newbie here.. Anyone willing to offer some help???
Hi and welcome to the forum.
You are correct that you misplaced the thread, but dont worry about it, mods will move it to the .Net section.
Regarding your question, see if this helps http://msdn.microsoft.com/en-us/libr...y4(VS.71).aspx
-
Jun 5th, 2010, 12:37 PM
#3
Thread Starter
New Member
Re: VB newbie here.. Anyone willing to offer some help???
haha thx that looks useful
-
Jun 5th, 2010, 01:29 PM
#4
Re: VB newbie here.. Anyone willing to offer some help???
Moved. And BTW please watch the language.
-
Jun 5th, 2010, 01:42 PM
#5
Re: VB newbie here.. Anyone willing to offer some help???
Out of curiosity, do you actually have any virus strings yet?
You can read a file bit by bit using a FileStream and BinaryReader:
Code:
Dim virus_string() As Byte = {} 'Whatever the virus string is
Using fs As New IO.FileStream("location of file to scan", IO.FileMode.Open, IO.FileAccess.Read)
Using br As New IO.BinaryReader(fs)
Dim found As Boolean = False
Do
Dim position As Integer = br.BaseStream.Position
Dim matchindex As Integer = 0
Dim b As Byte
Do
b = br.ReadByte()
matchindex += 1
If matchindex = virus_string.Length Then
'Found a virus!!!
found = True
Exit Do
End If
Loop While virus_string(matchindex-1) = b
Loop Until found OrElse br.BaseStream.Position = br.BaseStream.Length
If found Then
MessageBox.Show("FOUND A VIRUS!")
End If
br.Close()
End Using
End Using
Just do that for every virus string you have.
-
Jun 5th, 2010, 02:33 PM
#6
Thread Starter
New Member
Re: VB newbie here.. Anyone willing to offer some help???
Thank you very much
-
Jun 5th, 2010, 02:36 PM
#7
Thread Starter
New Member
Re: VB newbie here.. Anyone willing to offer some help???
 Originally Posted by MartinLiss
Moved. And btw please watch the language.
Thx. [Edited by MartinLiss]
Last edited by MartinLiss; Jun 5th, 2010 at 03:18 PM.
-
Jun 5th, 2010, 02:37 PM
#8
Thread Starter
New Member
Re: VB newbie here.. Anyone willing to offer some help???
 Originally Posted by minitech
Out of curiosity, do you actually have any virus strings yet?
You can read a file bit by bit using a FileStream and BinaryReader:
Code:
Dim virus_string() As Byte = {} 'Whatever the virus string is
Using fs As New IO.FileStream("location of file to scan", IO.FileMode.Open, IO.FileAccess.Read)
Using br As New IO.BinaryReader(fs)
Dim found As Boolean = False
Do
Dim position As Integer = br.BaseStream.Position
Dim matchindex As Integer = 0
Dim b As Byte
Do
b = br.ReadByte()
matchindex += 1
If matchindex = virus_string.Length Then
'Found a virus!!!
found = True
Exit Do
End If
Loop While virus_string(matchindex-1) = b
Loop Until found OrElse br.BaseStream.Position = br.BaseStream.Length
If found Then
MessageBox.Show("FOUND A VIRUS!")
End If
br.Close()
End Using
End Using
Just do that for every virus string you have.
Yes yes... i need to start putting my virus strings in that.
-
Jun 6th, 2010, 01:04 PM
#9
Thread Starter
New Member
Re: VB newbie here.. Anyone willing to offer some help???
 Originally Posted by LeonOar
Thx. [Edited by MartinLiss]
OK WHAT THE HECK WAS CENSORED THAT TIME???? I DON'T EVEN REMEBER PUTTING ANYMORE THEN THX IN THAT!
I am beginning to take this admin stuff the wrong way...
-
Jun 7th, 2010, 02:47 PM
#10
Re: VB newbie here.. Anyone willing to offer some help???
Do you still have a problem with it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|