Writing a basic virus scanner
-
Hi there and thanks for reading. :-D I am currently writing a basic virus scanner but i have hit a problem. I know that a virus will have a signature (a unique order of binary 0's and 1's) that represents how the virus is written. The exact same piece of code will always have the same binary signature. However, how can i convert a file into its binary format ready to be scanned?:confused: My current idea is to keep virus signatures in an xml file, then scan files in a folder for the signatures stored in the xml file. I am trung to keep it as simple as possible as i have been asked for a basic virus scanner. This project is still in its early stages so i may be approaching this completly wrong, if so, pointers would be appreciated. :) Regards,
-
Hi there and thanks for reading. :-D I am currently writing a basic virus scanner but i have hit a problem. I know that a virus will have a signature (a unique order of binary 0's and 1's) that represents how the virus is written. The exact same piece of code will always have the same binary signature. However, how can i convert a file into its binary format ready to be scanned?:confused: My current idea is to keep virus signatures in an xml file, then scan files in a folder for the signatures stored in the xml file. I am trung to keep it as simple as possible as i have been asked for a basic virus scanner. This project is still in its early stages so i may be approaching this completly wrong, if so, pointers would be appreciated. :) Regards,
File.ReadAllBytes will read the file as a byte array.
Christian Graus Driven to the arms of OSX by Vista.
-
File.ReadAllBytes will read the file as a byte array.
Christian Graus Driven to the arms of OSX by Vista.
Then just add foreach in signatures, byte[].Contains, and MessageBox.Show. I *knew* those guys at norton were overcharging! ;)
Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
Entanglar: .Net game engine featuring automatic networking and powerful HLSL gfx binding.