home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
arc_lbr
/
lhtools.arc
/
LHTOOLS.DOC
< prev
next >
Wrap
Text File
|
1989-04-19
|
7KB
|
176 lines
DOCUMENTATION
FOR
CHKLHARC version 1.2 & MKLHARC version 1.0
(c) Copyright 1989 by PAL Software NY, Inc.
51 Cedar Lane
Ossining, NY 10562
BBS: 914-762-8055
All rights reserved. These programs may be freely distributed
and used without the requirement of any payment to the author so
long as the programs are not modified in any form and no charge
is made for their distribution other than normal charges for disk
distribution or for BBS or other information service usage.
1
I. CHKLHARC (version 1.2)
Purpose: To "check" COM and EXE files for whether they are self-
extracting, self-executing LHARC files. Usable as a prophylactic
measure against possible trojans.
Usage: CHKLHARC somefile.ext [/C]
Discussion: Valid extentions are: COM and EXE. Normal wild-
cards (e.g. *.COM) will return the contents of all matches. The
optional /C switch tells CHKLHARC to create a basic LZH type file
from the self-extracting file, readable with LHARC for safe
examination.
This program writes to the standard output, so you can redirect
the output to a file with the normal DOS usage; e.g. "CHKLHARC
*.EXE > CHKFILE" will re-route all messages from the program to a
file called "CHKFILE".
The purpose of this program is to search COM and EXE files to
determine if they are self-extracting LHARC files, and, if they
are, a determination is made whether the file contains an "AUTO-
LARC.BAT" file, which is potentially dangerous if you do not know
what it does.
How can a LHARC file containing an "AUTOLARC.BAT" file be dange-
rous, you ask? A LHARC self-extracting file, once it does its
self-extraction, will look for such a batch file and then execute
it if present. A few "DEL *.COM" commands or the likes thereof
could do a good bit of mischief.
Hence, I wrote CHKLHARC, which can examine any COM or EXE file
and determine first if it is a LHARC self-extracting file. If it
is, it will then search for the presence of an AUTOLARC.BAT file
and warn you if one is found.
My thanks to Basil Copeland and John Newlin for their work in
analyzing the LHARC format so that I could produce this program.
History: Version 1.2 release 4/19/89:
* Since MKLHARC is being simultaneously released, which
may result in more widespread use of self-extracting, self-
executing LHARC files, CHKLHARC no longer **automatically**
creates an LZH file from the sfx COM or EXE file. A "/C"
switch has been added to force that creation.
* Minor modification to permit CHKLHARC to examine hidden
files such as IBM*.COM without bombing out.
Version 1.1 release 4/07/89: minor bug fix
Version 1.0 release 4/06/89: initial release
2
II. MKLHARC (version 1.0, initial release)
Purpose: To "make" a self-extracting, self-executing file using
LHARC.
Usage: MKLHARC somefile.ext <== "ext" must be COM or EXE
Discussion: You must have LHARC.COM in your DOS path.
Any additional parameters that you place on the command line
after "somefile.ext" will be added to the AUTOLARC.BAT file. For
instance, if your command is "MKLHARC WP RESUME", then when the
newly created file is invoked, it will wind up executing WordPer-
fect and loading your "RESUME" file for editing.
LHARC is a free compression/extraction program with origins
in Japan. One of its features is that it can create self-ex-
tracting files (as do many other U.S. competitors), but it's
special feature is that if one of the files which is extracted is
a batch file by the name of AUTOLARC.BAT, that batch file will be
executed at the conclusion of extraction. MKLHARC was written to
take advantage of this feature.
MKLHARC's operation is simple. It takes your COM or EXE
file and invokes LHARC first to create a basic LZH file and then
to convert the LZH file to a self-executing COM or EXE file with
the same name as the original file.
Warning: The original COM or EXE file apparently disappears
in this process as does any LZH file with the same basic file-
name. Although a deleted LZH file will not be restorable, the
original COM or EXE file is, however, retrievable with CHKLHARC.
Just run "CHKLHARC newfile.ext /C", and you'll get a basic LZH
file with the same filename. You can then view the LZH file with
LHARC itself. Lo and behold, you will find two files in there:
AUTOLARC.BAT and another COM or EXE file whose name appears to be
gobbledygook (the filename is actually the same as the original
name, but with the letters shifted by one position). Extract
that strange looking file, rename it to the original name, and
there you have your original file back.
Use MKLHARC judiciously. Since LHARC is relatively slow,
you would not want to use it on programs that you use very
frequently, unless you have a fast machine or don't mind the wait
for extraction. Furthermore, since what you wind up with is a
batch file that executes, it is probably inappropriate to use
such a self-executing LHARC file within a batch file, unless your
operating system can handle nested batch commands.
History: Version 1.0 release 4/19/89: initial release
3