home *** CD-ROM | disk | FTP | other *** search
/ Shareware 1 2 the Maxx / sw_1.zip / sw_1 / VIRUS / VIRLIST1.ZIP / VIRLIST.H < prev    next >
Text File  |  1992-04-30  |  3KB  |  86 lines

  1. /************************************************
  2.  * Virlist Header File with program definitions *
  3.  * Required with VIRLIST.C V1.0 source code.    */
  4.  ************************************************/
  5.  
  6. char buffer[1024]; /* input buffer */
  7.  
  8. #define bool unsigned char
  9.  
  10. /* include complete directory for location of text file */
  11. #define VIRLIST_FILE "virlist.txt"
  12.  
  13. /* program option flags */
  14.  
  15. bool boot, data, format, links, ops, program;
  16. bool variable;
  17. bool flags[10] = {0,0,0,0,0,0,0,0,0,0};
  18.  
  19.  
  20. /* Record storing virus list entry */
  21.  
  22. struct virEntry
  23. {
  24.     char name[27];        /* Virus name */
  25.     char disinfector[10];    /* Disinfecting program */
  26.     bool codes[10];     /* Characteristic codes */
  27.     long size;        /* Size of virus if appropriate */
  28.  
  29.     /* Damage codes */
  30.     bool boot,        /* Corrupts or overwrites the boot sector */
  31.          data,        /* Corrupts data files */
  32.          format,        /* Formats or overwrites all/part of disk */
  33.          links,             /* Directly or indirectly corrupts file linkage */
  34.          ops,        /* Affects system run-time operation */
  35.          program;        /* Corrupts program or overlay files */
  36. } virus;
  37.  
  38.  
  39. #define MSG_NUM 18    /* Number of messages */
  40.  
  41. char *messages [MSG_NUM] = {
  42.     "-------------------------------------------------------------------------",
  43.     "B - Corrupts or overwrites the boot sector",
  44.     "C - Corrupts program or overlay files",
  45.     "D - Corrupts data files",
  46.     "F - Formats or overwrites all/part of disk",
  47.     "L - Directly or indirectly corrupts file linkage",
  48.     "O - Affects system run-time operation",
  49.     "P - Infects Fixed Disk Partition Table (MBR)",
  50.     "V - Variable sized file infections",
  51.  
  52.     "1 - Virus Uses STEALTH Techniques",
  53.     "2 - Virus Uses Self-Encryption",
  54.     "3 - Virus Installs Self in Memory",
  55.     "4 - Infects COMMAND.COM",
  56.     "5 - Infects COM files",
  57.     "6 - Infects EXE Files",
  58.     "7 - Infects Overlay Files",
  59.     "8 - Infects Floppy Diskette Boot",
  60.     "9 - Infects Fixed Disk Boot Sector"
  61. };
  62.  
  63.  
  64. /* Function prototypes */
  65.  
  66. void CheckArgs(), Help(), Legend(), SkipHeader(), PrintRecord();
  67. int GetRecord();
  68.  
  69.  
  70. /* Initialization Macros for CheckArgs() */
  71.  
  72. #define SetField(FIELD, MSG_N)    FIELD = 1;\
  73.                 printf("\t%s\n", messages[MSG_N]); break
  74.  
  75. #define SetFlag(FIELD, MSG_N)   flags[FIELD-1] = 1;\
  76.                 printf("\t%s\n", messages[MSG_N]); break
  77.  
  78.  
  79. /* Macros for GetRecord function */
  80.  
  81. #define Copy(FIELD, LEN)    strncpy(virus.FIELD, buf, LEN);\
  82.                 virus.FIELD[LEN] = 0
  83.  
  84. #define Damage(FIELD)        if (FIELD) match++;\
  85.                 virus.FIELD = 1; break
  86.