PECompact v0.98 beta
(c)1999 by Jeremy Collake
All Rights Reserved.
Email: collake@charter.net
Homepage: http://webpages.charter.net/collake
This software is provided as-is, without warranty of ANY KIND,
either expressed or implied, including but not limited to the implied
warranties of merchantability and/or fitness for a particular purpose.
The author shall NOT be held liable for ANY damage to you, your
computer, or to anyone or anything else, that may result from its use,
or misuse. Basically, you use it at YOUR OWN RISK.
PECompact is a utility that compresses Windows 9x/NT4/w2k executables
and DLLs, while leaving them 100% functional. PECompact compresses the
code, data, selected resources, import/export table of a win32
executable and optimizes its structure. It then installs a symbiote which
decompresses the executable at run-time without any noticeable speed
difference. Load time can actually be improved in some cases because
less data has to be retrieved from the disk or network.
Features
- Written in 100% assembly language for maximum performance and
minimum size.
- Compresses Windows executables and DLLs significantly, while leaving
them 100% functional.
- Runtime decompression is *extremely* fast.
- Decreases load time of compressed executables across networks.
- *Very* minimal memory footprint increase of compressed executables.
- Makes applications more difficult to reverse-engineer, analyze, or modify.
- Compressed executables run fine in any win32 environment (win95/98/NT,etc).
- Unique plugin support allows for increased security and additional functionality.
- Trim only option allows executables to be trimmed, optimized, and, optionally,
relocations stripped without applying any compression or installing a symbiote.
- Highly configurable.
- ..and much more!
verison 0.98 changes (since v0.978)
- Fixed bugs in compression of executables with TLS
directories.
- Improved compression ratio and speed with JCALG1 r4.53.
- Other bug fixes and changes.
Usage
PECompact is highly configurable, however it auto-configures itself
to the recommended settings, so if you don't know what any of the below
means don't worry because there will probably never be a need to use
any of it.
PECompact can be run without any parameters, however it also accepts
the following command line syntax:
PECompact [filename] [switches]
Switches
- /A
Automatically invoke/exit PECompact without user intervention.
- /X
Automatically exit PECompact after compression completed.
- /T
Trim only, do not compress.
- /M[-]
Toggle on/off section merging.
- /R[-]
Toggle on/off resource restructuring.
- /E[-]
Toggle on/off compression of export table.
- /I[-]
Toggle on/off compression of shell icons.
- /B[-]
Toggle on/off backup of file.
- /O[-]
Toggle on/off copying of overlay.
- /S[-]
Toggle on/off stripping of relocations.
- /L[-]
Toggle on/off usage of windows DLL loader.
Command line switches override a saved configuration.
Options
Operations
- PE: Compress Normal App
Compress executable as a normal win32 exe.
- PE: Compress DLL/OCX
Compress executable as a DLL/OCX file.
- PE: Trim Only
This option will disable compression and installation of the PECompact
symbiote. The executable will be trimmed and realigned only and the
relocations will be stripped if that toggle is on (see below).
- Compression Level
This slider allows you to adjust the level of compression. This
will only affect compression speed and ratio, decompression
speed will not be affected in any significant way.
Advanced Configuration Toggles
- Restructure Resource Data
On/Off toggle to restructure resource data in a manner more
friendly for compression.
- Merge Sections
On/Off toggle to merge compressible sections, therefore
reducing the overhead of file alignment in the PE structure.
- Strip Relocations
On/Off toggle to strip relocations (fixups) from the PE. It
should be safe to do this for all win32 EXEs, however you
should not strip the relocations from DLLs unless you know
what you are doing.
- Compress Export Table
On/Off toggle to allow compression of the export table. You
should turn this off for DLLs.
- Use Windows DLL Loader
On/Off toggle to disable compression and symbiotic handling of
the import table. Turning this option on will leave the original host
import table in-tact, allowing the windows DLL loader to handle imports.
- Copy Overlay
On/Off toggle to copy data appended to the end of the PE.
Some applications append extra data to the end of the
executable; if this data is necessary, then check this option.
Note that many install applications either use a static
address for the overlaid data, or perform an executable size
verification and may still not work even though the overlay
is properly copied. There isn't much I can do about this
problem, I suggest all software authors which use overlaid
data properly compute the location of it by adding the last
section physical offset and size.
- Backup File
On/Off toggle to backup the file before compression. Backup
file will have a .bak extension appended.
- Compress shell icons
By default, PECompact attempts to preserve the shell icons (the
icons available for explorer to display). If you would like to
compress these icons anyway, then check this option.
- # of shell icons
This parameter sets the maximum number of shell icons to preserve
in the executable, as many executables contain more than one for use
at various resolutions. By default, PECompact preserves up to 15
different shell icons.
- Resource Types
Allows you to specify which resource types may be compressed.
Menu Options
- Configuration / Restore Defaults
Select this menu option to restore configuration to its
default state.
- Configuration / Save Configuration
This option will save the current PECompact configuration,
which will act as the default for each subsequent run.
- Configuration / Register Shell Extension
Select this menu option to register PECompact as a shell
extension, adding it to the explorer menu for EXE files.
License
This program is free for non-commercial use. If you plan to use PECompact
on an application which will be distributed as shareware, you must register
PECompact for $20 USD. For a commercial/retail license you must contact the
author at collake@charter.net for price negotiation.
To register your copy of PECompact for shareware use, please send a
check or money order for $20 to:
Jeremy Collake
PO BOX 426
Talbott, TN 37877
Include your name or company name, mailing address, email, and
optionally your phone number. Indicate whether you wish to have the
registered version of PECompact sent to you via email, or mailed to
you on a 3.5" disk.