Create the basic structure to create your own antivirus. They will be used as the software to create a virus database and scanner. First, declare the necessary structure. The first is the structure of the signature. The following is the record structure that integrates signature and name. Include a function to allocate memory for the name of the virus. Place both structures in the header file.
Write a class designed to work with files anti-virus database. You will need to do several classes: the base class file class file read class and add the record. Declare these classes in the file CAVBFile.h. Place the implementation classes in the file AVBFile.cpp. Plug in the header file. You also need to add checking for the existence of the file. Then implement functions intended to be written to the file.
Implement the following algorithm: if the file is opened and it is not found, then a new file is created, it will be written to the header. If the file exists, it will check the signature and reading the number of records. Add to this the addRecord function that will accept a reference to a record structure as a parameter. Move record to end of file. After that you need to do is increase the record count.
Write a program to create the database of the antivirus program. Use as its parameters the path to the file of the virus database, as well as a change in the sequence file of the virus and its name. Use the pass arguments to A format[Value], where A represents the corresponding key value is the value. Write the following algorithm of actions: to open a file the malware, navigate to offset, calculate the hash and add the entry to the database. Put the code in a file avrec.cpp.
Write code scanner that will check the file for damage. Place the database file in the same folder with the database and name it avbase.avb. Use the following algorithm to create anti-virus scanner: to upload a file to database, get the list of files, check file.