home *** CD-ROM | disk | FTP | other *** search
- /* chkIRq.rexx - Checks all executablefiles in a directory, including
- subdirectories. for the IRQ virus, using KV from VirusX
- Ron Shaw Wed Dec 6 18:07:37 1989
-
- NOW THIS IS Just the Dirtree.rexx function with added items to
- check for the IRQ virus.
- execio : is a executable that uses the PIP: (pipe device)
- alarm : is a PD program that makes audible sounds, it can be jrbeep,
- addbeep,play8svx (sound) or anything else you elect to warn you
- that kv found a virus.
-
- I find this method of checking for file viruses better the just running Kv
- since running Kv on numerous files, you have to keep your eyes on the
- screen. With this method you just give it a directory.
-
- When the program ends it will give you a count of the number of executable
- files it checked for the virus, total files and number of subdirectories
-
- To USE :
- With Wshell ChkIRq (dir name) <show, or any one character not to show the
- file names > without Wshell, Rx, ChkIRq, etc.
-
- */
-
-
- arg root sil /* if 2nd arg is anything it will not display
- file names, only directories */
-
- if right(root,1) ~= ':' then
- root = root || '/'
- if root = '/' then root = ''
-
- /*-- Added this so we could quiet the display of dir and file names --*/
- if length(sil) > 0 then sil = 0
- else sil = 1
- fcount = 0 /* # of files */
- dcount = 0 /* # of directories */
-
-
- exec_files = 0 /* added for display of executable files (KV virus checker) */
-
- call dotree(root)
- say ' '
- say 'sub directories['dcount'] files['fcount']'
- say 'KV Checked 'exec_files' executable files '
- exit
-
- dotree: procedure expose fcount root dcount sil exec_files
- parse arg x
- contents = showdir(x);
- do i = 1 to words(contents)
- temp = x || word(contents,i)
-
- select
- when word(statef(temp),1) = 'FILE' then do
- call do_file temp
- fcount = fcount + 1 /* increment the # of files found */
- end
-
- /* if its a directory then do next level, here is reclusivness! */
- when word(statef(temp),1) = 'DIR' then do
- say temp '(DIR)'
- dcount = dcount +1
- call dotree(temp || '/')
- end
- otherwise signal about_it
- end
- end
- return 0
-
- do_file: /* this is where we do what we want with the file */
- arg fyl
-
- if compare(sil,'1') == 0 then say fyl /* display file name if asked for */
-
- /* lets check the file for IRQ & XENO viruses */
- ""'kv 'fyl' | execio from 2 for 1 var str' /* get second line Kv writes
- to the screen */
- /* check for non-executable file. Could do differently */
- if compare(word(str,3),'not') == 0 then return 0
-
- if compare(word(str,3),'OK') > 0 then signal abort_page
- else exec_files = exec_files +1
- return 0
-
- abort_page: /* if we find a virus on the file then jump here */
-
- do i = 1 to 3
- say 'Virus Found in ' cur_file
- /* alarm PD program for sounding off -- here disabled */
- end
- exit(20)
-
- about_it: /* error determining file type */
- say 'Error: File' temp 'is neither DIR nor FILE.'
- exit(20)
-