Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : QWHITE13.ZIP
Filename : EXEPACK.TEC

Output of file : EXEPACK.TEC contained in archive : QWHITE13.ZIP

ID:PF Packed File is Corrupt: How to Fix
Quarterdeck Technical Note #255 Filename: EXEPACK.TEC
by Michael Batchelor CompuServe: EXEPAC.TEC
Last revised: 08/11/92 Category: QEMM

Subject: An explanation of the bug in Microsoft's EXEPACK utility that results
in the erroneous message "Packed File is Corrupt", with some
suggestions for workarounds.

QEMM-386, QEMM-50/60, and QRAM, because of their ability to load device
drivers and TSRs into High RAM, can make more conventional memory available
to programs. With the advent of MS and PC DOS version 5.0 even more
conventional memory can be made available by loading the DOS kernel into the
HMA. As a result, less of the conventional memory area is occupied than
ever before. With the operating system, its device drivers and other
resident programs all loaded into memory above 640K, applications can load
into lower areas of memory, areas previously occupied by DOS and its device

This sometimes causes an error message "Packed file is corrupt" when certain
programs are run from the DOS command line or in a DESQview window. The
source of this error message is the EXEPACK program from Microsoft. EXEPACK
is a utility provided with Microsoft's Macro Assembler development package.
The purpose of EXEPACK is to reduce the file size of the finished executable
by compressing the data contained in it and prepending a small decompression
routine to the beginning of the program file. When an EXEPACKed program is
run, this decompression routine unpacks the program into memory, and then
passes control to the beginning of the actual program, which then continues
to run normally.

EXEPACK will generate a spurious "Packed file is corrupt" error message if it
finds itself loaded at a starting address below the first 64K of conventional
memory (note: 64K, not 640K), and the A20 line is enabled, which it must be
to use the HMA (as in "DOS=HIGH") or extended memory. This is a common
occurrence in today's DOS 5.0 and QEMM-386 environment. Microsoft provides a
fix for this situation in a small utility included with DOS 5.0: LOADFIX.COM.
LOADFIX is invoked with the program to fix as the sole parameter. Its only
function is to occupy the first 64K of conventional memory, forcing the
program it is "fixing" to load above that area, thereby avoiding the "Packed
file is corrupt" error message.

Of course this is not a solution to your problem at all, it is only a way to
hide the problem. You bought a memory manager to have more conventional
memory available. "LOADFIX" just throws some of that memory away for the
duration of the program that it loads. This problem originated years ago with
the faulty EXEPACK utility. When Microsoft released their own memory manager
they included LOADFIX with DOS 5.0, instead of offering a real fix for the
programs packed with the defective EXEPACK. Fortunately, someone else created
a permanent solution.

A more permanent solution is found as part of the LZEXE version 0.91 utility
package by Fabrice Bellard of France. LZEXE is a free utility which also
performs compression of executable program files, in the interest of
conserving disk space. In order for it to do its job correctly a program
file which has been previously packed with EXEPACK must be unpacked. M.
Bellard has included a program UPACKEXE.EXE in the LZEXE 0.91 distribution.
UPACKEXE can undo the compression done by EXEPACK and remove the prepended
decompression routine, restoring the executable file to its unpacked state.
This eliminates the "Packed file is corrupt" error message and removes the
need to run a program with the DOS LOADFIX utility, allowing the program to
use all available conventional memory.

Since M. Bellard is native of France his startup banners, help messages, and
documentation are all written in French. Some English instructions would
therefore be of help to many of you.

The syntax for UPACKEXE is simple:

UPACKEXE filename

The original file's extension is changed to .OLD. The new file is called
UPACKEXE.TMP and can be renamed to have an .EXE extension, and then run as
before, with the EXEPACK compression now removed. You can even write a simple
batch file to replace LOADFIX.COM in your DOS 5 directory. Let's call it

@echo off
upackexe %1
ren upackexe.tmp %1

Now when you type "loadfix program.exe," the program will really be fixed!

LZEXE Version 0.91 is copyright (c) 1989 Fabrice Bellard.

You can download LZEXE91.ZIP from the Quarterdeck BBS (310) 314-3227, from the
Quarterdeck Support Forum on CompuServe (GO QUARTERDECK), or from BIX.

It is also available via FTP from in the file
PD1:LZEXE91E.ZIP, and also from the SIMTEL20 mirror sites or by
Internet e-mail through the BITNET SIMTEL20 mail servers. You are likely to
find it on your local computer bulletin board also.

* Trademarks are property of their respective owners. *
*This technical note may be copied and distributed freely as long as it*
*is distributed in its entirety and it is not distributed for profit. *
* Copyright (C) 1992 by Quarterdeck Office Systems *
************************ E N D O F F I L E *************************