home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TROJAN_P / CRCSET13.ZIP / VIRUSCRC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-13  |  1.0 KB  |  54 lines

  1. /*
  2. VIRUSCRC.H
  3.  
  4. Kevin Dean
  5. Fairview Mall P.O. Box 55074
  6. 1800 Sheppard Avenue East
  7. Willowdale, Ontario
  8. CANADA    M2J 5B9
  9. CompuServe ID: 76336,3114
  10.  
  11. March 24, 1991
  12.  
  13.     This is the interface to the anti-virus CRC check in VALIDCRC.C and
  14. VIRUSDAT.C.
  15.  
  16.     This code is public domain.
  17. */
  18.  
  19.  
  20. typedef
  21.   unsigned long crc32_t;
  22.  
  23. union filecrc
  24.   {
  25.   char searchstr[8];    /* String to search for. */
  26.  
  27.   struct
  28.     {
  29.     crc32_t polynomial;    /* Polynomial for this file. */
  30.     crc32_t crc;    /* Calculated CRC for this file. */
  31.     } x;
  32.   };
  33.  
  34.  
  35. extern const union filecrc _viruscrc;
  36.  
  37.  
  38. /* CRC validation return codes. */
  39. enum
  40.   {
  41.   CRC_VALID,    /* CRC is valid. */
  42.   CRC_INVALID,    /* CRC is invalid. */
  43.   CRC_ISZERO,    /* CRC polynomial has been reset to zero. */
  44.   CRC_NOMEM,    /* No memory for data buffer. */
  45.   CRC_FILEERR    /* Program file not found. */
  46.   };
  47.  
  48.  
  49. int validatecrc(const char *progname);
  50.  
  51.  
  52. /* isvalidcrc() is declared to maintain compatibility with earlier releases. */
  53. #define isvalidcrc(progname)  (validatecrc(progname) == CRC_VALID)
  54.