home *** CD-ROM | disk | FTP | other *** search
/ Dream 55 / Amiga_Dream_55.iso / Amiga / Antivirus / xvs33_11.lha / xvs / xvs.doc < prev    next >
Text File  |  1998-09-06  |  13KB  |  465 lines

  1. TABLE OF CONTENTS
  2.  
  3. xvs.library/xvsAllocObject
  4. xvs.library/xvsCheckBootblock
  5. xvs.library/xvsCheckFile
  6. xvs.library/xvsCheckSector
  7. xvs.library/xvsCreateVirusList
  8. xvs.library/xvsFreeObject
  9. xvs.library/xvsFreeVirusList
  10. xvs.library/xvsInstallBootblock
  11. xvs.library/xvsObjectType
  12. xvs.library/xvsRepairFile
  13. xvs.library/xvsRepairSector
  14. xvs.library/xvsSelfTest
  15. xvs.library/xvsSumBootblock
  16. xvs.library/xvsSurveyMemory
  17.  
  18. xvs.library/xvsAllocObject                         xvs.library/xvsAllocObject
  19.  
  20.    NAME
  21.     xvsAllocObject -- Allocate memory for specified object.
  22.  
  23.    SYNOPSIS
  24.     object = xvsAllocObject(objecttype)
  25.       D0          -48           D0
  26.  
  27.     APTR xvsAllocObject(ULONG);
  28.  
  29.    FUNCTION
  30.     Allocates a memory block and required resources for the specified
  31.     object. Never do this in any other way for compatibility with
  32.     library updates.
  33.  
  34.     Objecttype can be one of these:
  35.     XVSOBJ_BOOTINFO    - allocate a xvsBootInfo structure.
  36.     XVSOBJ_FILEINFO    - allocate a xvsFileInfo structure.
  37.     XVSOBJ_MEMORYINFO  - allocate a xvsMemoryInfo structure.
  38.     XVSOBJ_SECTORINFO  - allocate a xvsSectorInfo structure.
  39.  
  40.    INPUTS
  41.     objecttype - One of the XVSOBJ_#? values.
  42.  
  43.    RESULT
  44.     object - Pointer to the object or NULL if there occured an error.
  45.  
  46.    SEE ALSO
  47.     xvsFreeObject()
  48.  
  49. xvs.library/xvsCheckBootblock                   xvs.library/xvsCheckBootblock
  50.  
  51.    NAME
  52.     xvsCheckBootblock -- Check bootblock contents for viruses.
  53.  
  54.    SYNOPSIS
  55.     result = xvsCheckBootblock(bootinfo)
  56.       D0            -66           A0
  57.  
  58.     ULONG xvsCheckBootblock(struct xvsBootInfo *);
  59.  
  60.    FUNCTION
  61.     Checks if a bootblock contains viruses and informs about the
  62.     dostype, checksum and type of the bootblock.
  63.  
  64.     xvsbi_Bootblock must be initialized with a pointer to a 1024 bytes
  65.     bootblock.
  66.  
  67.     The bootblock will be first checked for the dostype. If it's not
  68.     a DOS bootblock, you'll receive XVSBT_NOTDOS as a result.
  69.     Otherwise xvsbi_DosType will receive the type of filesystem the
  70.     disk is using (eg. DOS/0 -> xvsbi_DosType = 0).
  71.     The xvsbi_ChkSumFlag field will be TRUE if the bootblock checksum
  72.     is correct (ie. bootable), otherwise it's FALSE.
  73.  
  74.     Now the bootblock will be checked for standard bootblocks and
  75.     viruses. You'll receive XVSBT_STANDARD13, XVSBT_STANDARD20 or
  76.     XVSBT_VIRUS in that case.
  77.  
  78.     If all the tests were negative, XVSBT_UNKNOWN is returned. Note
  79.     that XVSBT_UNINSTALLED will never be returned by this function,
  80.     it is only used by xvsInstallBootblock(). You can consider an
  81.     unknown bootblock with xvsbi_ChkSumFlag set to FALSE as uninstalled.
  82.  
  83.     In all cases, you'll receive the result in xvsbi_BootType too
  84.     and a describing ascii text in xvsbi_Name.
  85.  
  86.    INPUTS
  87.     bootinfo - Pointer to initialized xvsBootInfo structure.
  88.  
  89.    RESULT
  90.     result   - One of the XVSBT_#? values.
  91.  
  92. xvs.library/xvsCheckFile                             xvs.library/xvsCheckFile
  93.  
  94.    NAME
  95.     xvsCheckFile -- Check file contents for viruses.
  96.  
  97.    SYNOPSIS
  98.     result = xvsCheckFile(fileinfo)
  99.       D0         -96         A0
  100.  
  101.     ULONG xvsCheckFile(struct xvsFileInfo *);
  102.  
  103.    FUNCTION
  104.     Checks any file (executable/data) for virus infection and informs
  105.     about the type of file.
  106.  
  107.     xvsfi_File must be supplied with a pointer to the buffer holding
  108.     the file, xvsfi_FileLen must receive the length of the file.
  109.  
  110.     The file will be first checked if it's executable. If not, it's
  111.     a data file and will be scanned for data viruses (eg. scripts,
  112.     bootblocks). If nothing is found, the result is XVSFT_DATAFILE,
  113.     otherwise you'll receive XVSFT_DATAVIRUS. Such files can only be
  114.     deleted.
  115.  
  116.     Executable files are tested for link- and fileviruses. The result
  117.     for linkviruses is XVSFT_LINKVIRUS, you can repair these files with
  118.     a call to xvsRepairFile(). Fileviruses return XVSFT_FILEVIRUS and
  119.     the file can only be deleted completely.
  120.  
  121.     In all cases, you'll receive the result in xvsfi_FileType too
  122.     and a describing ascii text in xvsfi_Name.
  123.  
  124.     After calling this function, always test xvsfi_ModifiedFlag. If
  125.     this is TRUE, the recognition code modified your file buffer and
  126.     it's no longer safe to write it back to disk, execute it etc.
  127.     Some viruses require a lot of decrypt work for recognition and
  128.     it's not possible to detect them without, that's why I had to
  129.     add this flag.
  130.  
  131.    INPUTS
  132.     fileinfo - Pointer to initialized xvsFileInfo structure.
  133.  
  134.    RESULT
  135.     result   - One of the XVSFT_#? values.
  136.  
  137.    SEE ALSO
  138.     xvsRepairFile()
  139.  
  140. xvs.library/xvsCheckSector                         xvs.library/xvsCheckSector
  141.  
  142.    NAME
  143.     xvsCheckSector -- Check disk sector contents for virus modifications.
  144.  
  145.    SYNOPSIS
  146.     result = xvsCheckSector(sectorinfo)
  147.       D0          -84           A0
  148.  
  149.     ULONG xvsCheckSector(struct xvsSectorInfo *);
  150.  
  151.    FUNCTION
  152.     Checks if a sector has been modified by viruses.
  153.  
  154.     xvssi_Sector must be initialized with a pointer to a 512 bytes
  155.     disk sector, xvssi_Key with the sector number it has on disk.
  156.  
  157.     The sector will be checked for damages or changes done by viruses.
  158.     If anything is found, XVSST_DESTROYED or XVSST_INFECTED will be
  159.     returned, otherwise you'll receive XVSST_UNKNOWN.
  160.  
  161.     In all cases, you'll receive the result in xvssi_SectorType too
  162.     and a describing ascii text in xvssi_Name.
  163.  
  164.    INPUTS
  165.     sectorinfo - Pointer to initialized xvsSectorInfo structure.
  166.  
  167.    RESULT
  168.     result     - One of the XVSST_#? values.
  169.  
  170.    SEE ALSO
  171.     xvsRepairSector()
  172.  
  173. xvs.library/xvsCreateVirusList                 xvs.library/xvsCreateVirusList
  174.  
  175.    NAME
  176.     xvsCreateVirusList -- Allocate and initialize xvsVirusList structure.
  177.  
  178.    SYNOPSIS
  179.     viruslist = xvsCreateVirusList(listtype)
  180.        D0              -36            D0
  181.  
  182.     struct xvsVirusList *xvsCreateVirusList(ULONG);
  183.  
  184.    FUNCTION
  185.     Allocates memory for a xvsVirusList structure and initializes it
  186.     with nodes of the required type.
  187.  
  188.     Listtype can be one of these:
  189.     XVSLIST_BOOTVIRUSES  - create list of bootblock viruses.
  190.     XVSLIST_FILEVIRUSES  - create list of file viruses.
  191.     XVSLIST_LINKVIRUSES  - create list of link viruses.
  192.  
  193.     The list should be used for information purposes only, eg. for a
  194.     listview gadget of gadtools.library.
  195.     xvsVirusList->LH_TYPE holds the XVSLIST_#? value,
  196.     xvsVirusList->xvsvl_Count holds the amount of nodes.
  197.     The nodes themselves hold a pointer to the virus name in the
  198.     LN_NAME field.
  199.  
  200.    INPUTS
  201.     listtype - One of the XVSLIST_#? values.
  202.  
  203.    RESULT
  204.     viruslist - Pointer to xvsVirusList or NULL if not enough memory.
  205.  
  206.    SEE ALSO
  207.     xvsFreeVirusList()
  208.  
  209. xvs.library/xvsFreeObject                           xvs.library/xvsFreeObject
  210.  
  211.    NAME
  212.     xvsFreeObject -- Release memory of object.
  213.  
  214.    SYNOPSIS
  215.     xvsFreeObject(object)
  216.          -54        A1
  217.  
  218.     void xvsFreeObject(APTR);
  219.  
  220.    FUNCTION
  221.     Deallocates the memory and releases the resources reserved via
  222.     xvsAllocObject().
  223.  
  224.    INPUTS
  225.     object - Pointer to object.
  226.  
  227.    RESULT
  228.     None.
  229.  
  230.    SEE ALSO
  231.     xvsAllocObject()
  232.  
  233. xvs.library/xvsFreeVirusList                     xvs.library/xvsFreeVirusList
  234.  
  235.    NAME
  236.     xvsFreeVirusList -- Release memory of xvsVirusList structure.
  237.  
  238.    SYNOPSIS
  239.     xvsFreeVirusList(viruslist)
  240.           -42            A1
  241.  
  242.     void xvsFreeVirusList(struct xvsVirusList *);
  243.  
  244.    FUNCTION
  245.     Deallocates the memory of a xvsVirusList structure that has been
  246.     returned as result by xvsCreateVirusList().
  247.  
  248.    INPUTS
  249.     viruslist - Pointer to a xvsVirusList structure.
  250.  
  251.    RESULT
  252.     None.
  253.  
  254.    SEE ALSO
  255.     xvsCreateVirusList()
  256.  
  257. xvs.library/xvsInstallBootblock               xvs.library/xvsInstallBootblock
  258.  
  259.    NAME
  260.     xvsInstallBootblock -- Install some standard bootblocks to buffer.
  261.  
  262.    SYNOPSIS
  263.     xvsInstallBootblock(bootblock, boottype, dostype)
  264.             -72            A0         D0        D1
  265.  
  266.     void xvsInstallBootblock(APTR, ULONG, ULONG);
  267.  
  268.    FUNCTION
  269.     Installs desired bootblock data to the buffer. The checksum will
  270.     be corrected automatically except for XVSBT_UNINSTALLED bootblocks.
  271.  
  272.     Boottype can be one of these:
  273.     XVSBT_UNINSTALLED - creates uninstalled (non-bootable) bootblock.
  274.     XVSBT_STANDARD13  - creates standard bootblock (Kickstart 1.3).
  275.     XVSBT_STANDARD20  - creates standard bootblock (Kickstart 2.0).
  276.  
  277.     Dostype specifies the filesystem the disk is using. It's just
  278.     the trailing number behind 'DOS', eg. DOS/0 -> dostype = 0.
  279.  
  280.    INPUTS
  281.     bootblock - Pointer to buffer that is 1024 bytes long.
  282.     boottype  - One of the XVSBT_#? values above.
  283.     dostype   - Any reasonable number from 0 to xx.
  284.  
  285.    RESULT
  286.     None.
  287.  
  288. xvs.library/xvsObjectType                           xvs.library/xvsObjectType
  289.  
  290.    NAME
  291.     xvsObjectType -- Determine type of object.
  292.  
  293.    SYNOPSIS
  294.     objecttype = xvsObjectType(object)
  295.         D0            -60        A1
  296.  
  297.     ULONG xvsObjectType(APTR);
  298.  
  299.    FUNCTION
  300.     Checks if object points to a XVSOBJ_#? object and returns the type
  301.     of this object if possible.
  302.  
  303.    INPUTS
  304.     object - Pointer to a possible XVSOBJ_#? object.
  305.  
  306.    RESULT
  307.     objecttype - One of the XVSOBJ_#? values or NULL if not an object.
  308.  
  309.    SEE ALSO
  310.     xvsAllocObject()
  311.  
  312. xvs.library/xvsRepairFile                           xvs.library/xvsRepairFile
  313.  
  314.    NAME
  315.     xvsRepairFile -- Repair linkvirus-infected file.
  316.  
  317.    SYNOPSIS
  318.     success = xvsRepairFile(fileinfo)
  319.       D0          -102         A0
  320.  
  321.     BOOL xvsRepairFile(struct xvsFileInfo *);
  322.  
  323.    FUNCTION
  324.     Tries to repair files that have been detected as XVSFT_LINKVIRUS
  325.     by xvsCheckFile().
  326.  
  327.     This function will first test the hunk structure of the file
  328.     to be repaired to avoid serious problems during repair action.
  329.     For recognition this was not necessary and not wanted in order
  330.     to detect viruses in corrupted files too.
  331.  
  332.     If success is TRUE, everything worked well, the virus has been
  333.     removed. You can save back the file to disk using xvsfi_Fixed
  334.     as start pointer and xvsfi_FixedLen as new file length.
  335.     Please note that these two fields don't describe a new buffer but
  336.     are only position and length information from within your own
  337.     buffer (from xvsfi_File). Don't release your buffer before saving
  338.     the fixed file.
  339.  
  340.     If success is FALSE, an error occured. You get a describing error
  341.     code from xvsfi_ErrorCode and the corresponding ascii string from
  342.     xvsfi_Name.
  343.     In case of an error it might be of interest if the buffer had
  344.     already been modified before the error occured or not. To find out,
  345.     check xvsfi_ModifiedFlag (TRUE = modified).
  346.  
  347.    INPUTS
  348.     fileinfo - Pointer to initialized xvsFileInfo structure.
  349.  
  350.    RESULT
  351.     success  - TRUE if file is repaired, FALSE if an error occured.
  352.  
  353.    SEE ALSO
  354.     xvsCheckFile()
  355.  
  356. xvs.library/xvsRepairSector                       xvs.library/xvsRepairSector
  357.  
  358.    NAME
  359.     xvsRepairSector -- Repair virus-encrypted sector.
  360.  
  361.    SYNOPSIS
  362.     success = xvsRepairSector(sectorinfo)
  363.       D0           -90            A0
  364.  
  365.     BOOL xvsRepairSector(struct xvsSectorInfo *);
  366.  
  367.    FUNCTION
  368.     Tries to repair sectors that have been detected as XVSST_INFECTED
  369.     by xvsCheckSector().
  370.  
  371.     Call this function after xvsCheckSector() returned XVSST_INFECTED
  372.     and there will never occur an error. You can then write back the
  373.     cleaned sector to disk.
  374.  
  375.    INPUTS
  376.     sectorinfo - Pointer to initialized xvsSectorInfo structure.
  377.  
  378.    RESULT
  379.     success    - TRUE if repaired, FALSE if failed.
  380.  
  381.    SEE ALSO
  382.     xvsCheckSector()
  383.  
  384. xvs.library/xvsSelfTest                               xvs.library/xvsSelfTest
  385.  
  386.    NAME
  387.     xvsSelfTest -- Test xvs.library for modifications.
  388.  
  389.    SYNOPSIS
  390.     success = xvsSelfTest()
  391.       D0         -30
  392.  
  393.     BOOL xvsSelfTest(void);
  394.  
  395.    FUNCTION
  396.     Tests the file structure of xvs.library for modifications. Call this
  397.     function whenever you first open xvs.library to verify its contents.
  398.  
  399.    INPUTS
  400.     None.
  401.  
  402.    RESULT
  403.     success - TRUE if xvs.library is ok, FALSE if anything is changed.
  404.  
  405. xvs.library/xvsSumBootblock                       xvs.library/xvsSumBootblock
  406.  
  407.    NAME
  408.     xvsSumBootblock -- Correct bootblock checksum.
  409.  
  410.    SYNOPSIS
  411.     xvsSumBootblock(bootblock, offset)
  412.           -78          A0        D0
  413.  
  414.     void xvsSumBootblock(APTR, ULONG);
  415.  
  416.    FUNCTION
  417.     Calculates the correct checksum for a bootblock and writes it to
  418.     the longword specified by offset.
  419.  
  420.     Offset must be a multiple of 4, otherwise the bootblock will not
  421.     be bootable.
  422.  
  423.    INPUTS
  424.     bootblock - Pointer to buffer holding 1024 bytes bootblock.
  425.     offset    - Offset from beginning of buffer to write checksum to.
  426.  
  427.    RESULT
  428.     None.
  429.  
  430. xvs.library/xvsSurveyMemory                       xvs.library/xvsSurveyMemory
  431.  
  432.    NAME
  433.     xvsSurveyMemory -- Check memory for viruses and remove them if any.
  434.  
  435.    SYNOPSIS
  436.     count = xvsSurveyMemory(memoryinfo)
  437.      D0           -108          A0
  438.  
  439.     ULONG xvsSurveyMemory(struct xvsMemoryInfo *);
  440.  
  441.    FUNCTION
  442.     Checks memory for any known viruses and removes them immediately.
  443.  
  444.     xvsMemoryInfo is just an information structure that holds the
  445.     results of a memory check, you don't have to initialize it with
  446.     any values first.
  447.  
  448.     xvsmi_Count holds the same value as returned by this function.
  449.     xvsmi_NameArray holds pointers to the names of the detected viruses.
  450.     There are always xvsmi_Count pointers valid, if count is zero, no
  451.     pointers are valid.
  452.  
  453.     The amount of names is limited to 5, but from my experience I can
  454.     say that this should be enough. It's very unrealistic that someone
  455.     has more than 5 active viruses running on his machine without a
  456.     complete system crash. Nevertheless, ALL viruses will be killed,
  457.     but only the first 5 will be listed if there should ever be more.
  458.  
  459.    INPUTS
  460.     memoryinfo - Pointer to xvsMemoryInfo structure.
  461.  
  462.    RESULT
  463.     count      - Amount of detected and removed viruses.
  464.  
  465.