What's new

.NET Making a simple Antivirus program

Snowy

Snowy

Let it snow
Hidden Devils
Messages
2,605
Solutions
2
Reaction score
917
Points
790
Sin$
0
Hey, I'm making a simple antivirus program.
Currently it scans "C\Program Files" for certain files and directories that are programmed into the program (checks if they exist), if they exist, it gives the option for removal. If non-existent, it tells you you're clean. However, I would like to expand it and have it so that it checks EVERY file on the selected drive's MD5 checksum for known virus checksums. I can't quite figure out how to do it yet though :frown: and google didn't help this time.
So any help would be greatly appreciated :biggrin: .

Capture.png

If you need to browse the source just tell me.

Thanks
Versatile Ear
 
Space

Space

PlayStation 4 ✔
Messages
2,784
Reaction score
1,697
Points
665
Sin$
0
Could you Pm me the code or post it here i think i know the issue.
 
Snowy

Snowy

Let it snow
Hidden Devils
Messages
2,605
Solutions
2
Reaction score
917
Points
790
Sin$
0
Could you Pm me the code or post it here i think i know the issue.
There's not an issue (as such). I just need help actually implementing sn MD5 checksum scanner. If you still need to source I'll PM you it in the moring (GMT) as I'm on my iPad right now
 
Space

Space

PlayStation 4 ✔
Messages
2,784
Reaction score
1,697
Points
665
Sin$
0
There's not an issue (as such). I just need help actually implementing sn MD5 checksum scanner. If you still need to source I'll PM you it in the moring (GMT) as I'm on my iPad right now
Yea if you could do that buddy i will gladly help you tomorrow :wink:
 
Cakes

Cakes

お前はもう死んでいる
VIP
Retired
Mythical Veteran Platinum Record End of the Year 2017
Messages
20,705
Reaction score
20,272
Points
3,870
Sin$
-7
I wouldn't advise you to make an antivirus program in .NET. Especially if you plan to use it in an actual computer environment. Not really that it wouldn't be 'effective', just that it would be extremely easy to bypass that application and infect the computer it's protecting.

Edit: Anyway, for you to do what you're asking in the OP. It would generally be resolved by creating a loop that iterates through all the directories and all files inside of a folder. In this case, you would use the drive you're scanning as the folder; ie: 'c:\'.

Edit 2: Something like this could be done:
C:
foreach (string f in Directory.EnumerateFiles(path, "*.*", SearchOption.AllDirectories))
{
   Console.WriteLine(f);
}
 
Snowy

Snowy

Let it snow
Hidden Devils
Messages
2,605
Solutions
2
Reaction score
917
Points
790
Sin$
0
I wouldn't advise you to make an antivirus program in .NET. Especially if you plan to use it in an actual computer environment. Not really that it wouldn't be 'effective', just that it would be extremely easy to bypass that application and infect the computer it's protecting.

Edit: Anyway, for you to do what you're asking in the OP. It would generally be resolved by creating a loop that iterates through all the directories and all files inside of a folder. In this case, you would use the drive you're scanning as the folder; ie: 'c:\'.

Edit 2: Something like this could be done:
C:
foreach (string f in Directory.EnumerateFiles(path, "*.*", SearchOption.AllDirectories))
{
   Console.WriteLine(f);
}
Sorry, for some reason I didn't get this alert. And, I have no idea how I would add that to my code.
And, I'm not looking to make something to replace the likes of Norton or Kaspersky, I was just looking to create something small which is why I did it in vb.net, however, I suppose I could redo it in C#.net but, it would still be a .net language.

Right. Here's my code, the first folder is an existing MD5 scanner, it is NOT my code. I added it in to see if you guys could understand it. The second folder however, is my code.
[Click here to view this link]
scan 
Forgot to add this: Space Space
 
Snowy

Snowy

Let it snow
Hidden Devils
Messages
2,605
Solutions
2
Reaction score
917
Points
790
Sin$
0
Top Bottom
Login
Register