Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Writing a basic virus scanner

Writing a basic virus scanner

Scheduled Pinned Locked Moved C#
questionxmlhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deviao
    wrote on last edited by
    #1

    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,

    C 1 Reply Last reply
    0
    • D deviao

      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,

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      File.ReadAllBytes will read the file as a byte array.

      Christian Graus Driven to the arms of OSX by Vista.

      M 1 Reply Last reply
      0
      • C Christian Graus

        File.ReadAllBytes will read the file as a byte array.

        Christian Graus Driven to the arms of OSX by Vista.

        M Offline
        M Offline
        Mark Churchill
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups