This is one of my contributions to humanity, meant to stave off the virus danger brought about by twerpy little hackers. Updated 6/25/90 What this is ------------ This is version 1.01 of the "virus/validity" tester for PCBoard 14.5 If you don't know already, PCB 14.5 now includes a PCBTEST.BAT file that will let you put in any code you want to act on uploaded files. OR (optionally) you can have the user available PCBoard command TEST available to your users (uses the same PCBTEST.BAT file) so that they can test files online before downloading them. Error in first release ---------------------- The first release I did was missing a GOTO and would sometimes think files that didn't pass for some reason or another were viruses. Also, if you run on a network, don't forget to use NETSCAN instead of Viruscan. What you need ------------- You need a few things for this batch file to work. You need Pkzip, LHarc, Pkxarc, and Viruscan (or Netscan if on a network). These all need to be in your path somewhere. Try to always have the newest Viruscan available, new viruses are found constantly, and the Viruscan utility is kept up to date. How it works ------------ This little tester will find any virus that VIRUSCAN is capable of finding in a file. However if it does find one you will have to take over from there, manually answering the questions on how to deal with the virus and the file. I'll be adding some logic to automate this when I can actually find a virus to test with this routine. (this is the first time i've actually went looking for one and I can't find one anywhere, drats!) The little ENTER file I included is simply a "Y" which emulates the manual keyboard input DOS expects in order to clear the work directory. You HAVE TO HAVE THIS IN THE CURRENT DIRECTORY!, just putting in the path won't do, PCBTEST.BAT won't find it unless it's in the same directory. You can add/change/delete any part of this .BAT file however you like. In fact you will HAVE to change it, unless your system is setup identically to mine you will want to substitute your own drive and path locations. You will need about 90k or more free for this PCBTEST.BAT to operate properly, PKZIP and VIRUSCAN both take at least 90k of RAM to operate. If you want to know how much memory you have free with PCBoard loaded, look in the bottom right hand corner of the status bar at the bottom of the screen while you or someone is logged onto the board, you will see two numbers with "K" appended to the end, the top one is how much memory you have free. If it isn't around 90K or more you might not be able to use this PCBTEST.BAT file. Multinodes ---------- There isn't anything node specific about this batch file, modify it once to your system and then put a copy in each \PCB subdirectory, don't forget to to put the ENTER file in each \PCB subdirectory along with each copy of PCBTEST.BAT. Testing with other compressors (Pak/Zoo/Arce/SeaArc etc.) --------------------------------------------------------- It's simple to add other compression standards to this batch file to test validity and for viruses in those compressed files. Just follow this outline to adding new compression testing modules to PCBTEST.BAT. 1 2 3 4 5 6 7 testfile %1 arc zip txt gif lzh sit if errorlevel == 7 goto unknown if errorlevel == 6 goto end if errorlevel == 5 goto lzh if errorlevel == 4 goto end if errorlevel == 3 goto end if errorlevel == 2 goto zip if errorlevel == 1 goto arc Either substitue extensions (.sit, .txt, etc) that you don't want with those you do, or add them onto the end (I don't know how many testfile.com will process, experiment with it) and remember the placement on the command line corresponds to an errorlevel #. Also, in the errorlevel section you always have to list errorlevels from the highest errorlevel to the lowest 7, 6, 5, 4, 3, 2, 1. Each errorlevel branches to a module (or to the end if you don't want a file with that corresponding extension tested). The modules are layed out in a particular order that you will have to observe, (unless you want to experiment and chagne things around). But the organization I have layed out below works well. :arc 1. name of sub-routine del o:\scan\*.* < enter 2. Clear work subdirectory pkxarc %1 o:\scan 3. uncompress upload into work dir scan o: /d /nomem > pcbfail.txt 4. scan the uncompressed files if errorlevel == 1 goto warning 5. If a virus is found, branch to the module that handles it. zap o:\scan\*.* < enter 6. clear the work directory pkxarc -t %1 > pcbfail.txt 7. file validity test of upload if errorlevel == 1 goto end 8. If file is bad, branch to module that handles this occrurance del pcbfail.txt 9. No errors? then delete pcbfail.txt goto end 10. all done, exit Comments -------- Comments, ideas etc. are welcome. I call Salt Air regularly or you can contact me on my own system. Karl Van Lear (sysop) Nitelog BBS Monterey CA (408)655-1096 Also, don't forget to thank David Terry for adding this and the many other new capbilities to PCBoard. PCBoard is a trademark of Clark Development Company, Inc. Viruscan and Netscan are trademarks of MacAfee Associates Pkzip is a trademark of PKWare Inc. LHarc is a tradmark of Haruyasu Yoshizaki Pkxarc is a trademark of ...uhhh ummm, you got me.