Microsoft KB Archive/72360

= &quot;Packed File Corrupt&quot; Error Message =

Article ID: 72360

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft MS-DOS 2.11 Standard Edition
 * Microsoft MS-DOS 3.1
 * Microsoft MS-DOS 3.2 Standard Edition
 * Microsoft MS-DOS 3.21 Standard Edition
 * Microsoft MS-DOS 3.3 Standard Edition
 * Microsoft MS-DOS 3.3a
 * Microsoft MS-DOS 4.0 Standard Edition
 * Microsoft MS-DOS 4.01 Standard Edition
 * Microsoft MS-DOS 5.0 Standard Edition
 * Microsoft MS-DOS 5.0a
 * Microsoft MS-DOS 6.0 Standard Edition
 * Microsoft MS-DOS 6.2 Standard Edition
 * Microsoft MS-DOS 6.21 Standard Edition
 * Microsoft MS-DOS 6.22 Standard Edition

-



This article was previously published under Q72360



SYMPTOMS
Running an .EXE file that has been &quot;packed&quot; using the EXEPACK utility or the /EXEPACK linker option may result in the following error message even though the packed file is intact:

Packed file corrupt



CAUSE
This behavior is a result of an error in the code that unpacks the .EXE file. You can determine if this is the cause of your problem by starting a new copy of COMMAND.COM. To do this, type command at the MS-DOS prompt and press ENTER. (It may be necessary to repeat this several times.) Then try to run your program.

NOTE: This error is more likely to occur with MS-DOS version 5.0 and later because it is capable of freeing up more conventional memory.



WORKAROUND
If the method above is successful, you may resolve the problem in a more permanent fashion by increasing the FILES and BUFFERS in your CONFIG.SYS file.

If you are running MS-DOS 5.0 or later, you can resolve this problem by loading MS-DOS low (by adding the DOS=LOW command to the CONFIG.SYS file) or by using LOADFIX. LOADFIX ensures that a program is loaded above the first 64K of conventional memory. For example, to ensure that a program file named TEST.EXE is loaded above 64K, type the following:

loadfix test.exe

For more information on LOADFIX, see the version 5.0 &quot;Microsoft MS-DOS Getting Started&quot; guide. Or, if you are using version 6.0 or 6.2, type the following at the MS-DOS command prompt:

HELP LOADFIX



MORE INFORMATION
This problem occurs because of a problem in the EXEPACK.EXE utility and the LINK.EXE linker utility when the /EXEPACK switch is used. Each will cause the executable file to be compressed or packed by removing repeating sequences of identical bytes, allowing the program to occupy less disk space. The program will then load for execution more quickly.

Because of an error in the unpacking algorithm, the error message &quot;Packed file corrupt&quot; may occur when the packed program is loaded into memory before the first 64K boundary. By spawning additional copies of COMMAND.COM or increasing your FILES and BUFFERS sizes, you will increase the amount of space MS-DOS occupies in memory. This forces the program to load above the first 64K boundary. This problem was corrected in version 5.1 of the linker.

This error message may also result if the EXEPACK utility is fooled into creating a packed file with the same name as the .EXE file. For example, if the current directory is C:\BIN and you type the following (the syntax for EXEPACK is &quot;EXEPACK  &quot;), the resulting packed file will probably be corrupt:   exepack c:\bin\test.exe test.exe

