Jump to content

anti virus

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1
golden eye

golden eye

    Newbie

  • Members
  • Pip
  • 4 posts
well i have completed my C language course
now want to write a very very simple anti virus code
what should be my approach?
thanks in advance


#2
Phoenixz

Phoenixz

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 256 posts
Is it really possible to do a "simple" anti-virus code, I suppose you'd need a big list of viruses, where they install too, what their file name is, then read from this list, scan directory if it exists, delete.... doesn't sound so simple really..
Posted Image

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Do you know how to monitor processes and file access yet? If not, you will have a hard time doing anything real time. In that case, you are limited to scanning files for database matches.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
golden eye

golden eye

    Newbie

  • Members
  • Pip
  • 4 posts
thanks to all
i think scannig a directory is best suited for me:sad:
but in that case please let me know how to do that using C?
thanks in advance

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
It will depend somewhat on the operating system you are using, as well as the libraries you have available. You need to get a list of all the files in a folder, and then open them and read their contents, checking for certain strings of characters. Are you familiar with file access in C?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
golden eye

golden eye

    Newbie

  • Members
  • Pip
  • 4 posts
yup.. me familiar with file access in C
"You need to get a list of all the files in a folder, and then open them and read their contents, checking for certain strings of characters." how!i m distressed:crying:

#7
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
C does not have the concept of a folder. You will need to learn the Windows API to get the list of files in a given folder.

Once you have a list of files, you can open each one. You will have to use string manipulation routines to (attempt to) locate virus substrings within the string.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#8
golden eye

golden eye

    Newbie

  • Members
  • Pip
  • 4 posts
thanks for your advice
i need some more suggestions about Windows API :o

#9
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
windows API C directory - Google Search
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog