PECompact Documentation

Options and Settings

Back to Index ] [ Back to Bitsum Technologies ]

This table describes available compression settings.

Project files can be automatically processed by the GUI using the command line parameters listed here. The command line parameters listed in the table below are only valid for the console mode version of PECompact.

Some recently added command line options may not be listed here, but are viewable in the help given by running PEC2 without any command line parameters.

Option Name Description Command Line Parameter Command Line Examples
CODEC Plugin(s) A CODEC host is a module that provides the compression and decompression (or encoding and decoding) algorithms to PECompact. Any number of CODEC hosts may be used during compression. The order they are provided in is significant and is reversed during decompressing or decoding. The default value is "pec2codec_ffce.dll". /CodecHost
or
/Ch

/CodecHost:pec2codec_ffce.dll
/CodecHost:pec2codec_jcalg1.dll
/CodecHost:pec2codec_aplib.dll
/CodecHost:pec2codec_crc32.dll,pec2codec_lzma.dll
/CodecHost:@mycodecs.lst
/Ch:pec2codec_ffce.dll
 
Code Integrity Check The code integrity check is a quick runtime test on reconstructed code. A CRC32 codec is provided for full integrity checking and should be used instead of this switch. The default value is "Yes". Turning this option on will expand the loader by a few bytes. /CodeIntegrityCheck
or
/Cic
/CodeIntegrityCheck:Yes
/CodeIntegrityCheck:No
/Cic:Yes
Compress Exports The export table identifies what symbols are exposed to other modules. By relocating it, it may be processed without the module being decompressed. The default mode of "Auto" is recommended. The default mode is "auto". In this mode, exports of executables are compressed, but exports of DLLs and other modules are not. /CompressExports
or
/Ce
/CompressExports:Yes
/CompressExports:No
/CompressExports:Auto
/Ce:Auto

Compressible Resources

 

This option allows for specification of resources that should be compressed. By default, all are compressed except the first group icon and icons it references, version, and manifest resources. For a list of resource type names, run the console application with no command line switches and select the 'R' option. /CompressibleRT:@list
or
/CompressibleRT:typename1,typename2,...
or
/CompressibleRT:typeid#1,typeid#2,...
or
/CompressibleRT:namedrsrc1,namedrsrc2

(combinations of names, type names, type ids, and list files are supported).
/CompressibleRT:@myrsrc.txt
/CompressibleRT:groupicon,version
/CompressibleRT:4,5,1,namedresource,version
Compress Safe Resources If "Yes", resources safe to compress are compressed. If "No", all resources are left uncompressed. The default value is "Yes".
/CompressResources
or
/Cr
 
/CompressResources:Yes
/CompressResources:No
/Cr:Yes
Compression Level
(Global Decoder Options)
Some codecs support a compression level. The higher the level, the better, but slower, is the compression. Decompression speed is generally unaffected by the compression level.
The LZMA codec is an exception in that the compression level adjusts parameters that perform differently on different data sets. Therefore, the compression may be better at various levels, not necessarily the highest. The default value is "7".

/CompressionLevel
or
/Cl
 
/CompressionLevel:1
/CompressionLevel:9
/Cl:8
Decoder Type (Global Decoder Options) The fast decoder performs better than the 'small' decoder, but occupies more physical space. The default is "Auto", by which the small decoders are used for files less than 48kB in size and fast decoders used for all other files. /DecoderType
or
/Dt
/DecoderType:Small
/DecoderType:Fast
/DecoderType:Auto
/Dt:Small
Enable Memory Protection Prior to compression, an executable's sections are often set to restrict write access to their virtual memory. Enabling this option causes PECompact to restore the virtual memory access rights at runtime. The default is not to restore the memory access rights. Turning this option on will expand the loader by approximately 50 bytes.
/EnableMemoryProtection
or
/Emp
 
/EnableMemoryProtection:Yes
/EnableMemoryProtection:No
/Emp:No
API Hook Plugin(s) An API Hook plugin may facilitate any number of different features. This switch indicates which API Hook plugins to utilize. There is no default value (no API hooks used). /HooksHost
or
/Hh

/HooksHost:pec2hooks_fastimport.dll
/HooksHost:pec2hooks_fastimport.dll,pec2hooks_morehooks.dll
/HooksHost:@myhooks.lst
 
Keep Overlay / Extra-data An "overlay" is the extra data appended to the end of some portable executables. Sometimes this data is useless and unnecessary, other times it is essential, such as in the case of installers and self-extracting archives. This data is often referenced by a static/constant offset, causing the executable to be unable to locate it after compression. /KeepOverlay
or
/Ko
/KeepOverlay
/Ko

Loader CODEC
(Console application only)
 
The loader itself is compressed and this module is the CODEC host for its compression algorithm. The default value is:
"pec2codec_aplib.dll"
/LoaderCodecHost
or
/Lch
/LoaderCodecHost:"pec2codec_brieflz.dll
/LoaderCodecHost:"pec2codec_aplib.dll"
Loader Plugin The loader host module provides the loader (or decompression stub) to PECompcat. The default value is:
"pec2ldr.dll"

/LoaderHost
or
/Lh
 
/LoaderHost:"pec2ldr.dll"
Merge Sections This option indicates whether or not to merge congruent, wholly compressible sections together. By default, PECompact does merge sections. It is not recommended that this option be turned off unless you are debugging or experience problems of some sort. /MergeSections
or
/Ms
/MergeSections:Yes
/MergeSections:No
/Ms:Yes
No Backup If this switch is present, the file PECompact 2 processes will not be backed up. The default is to backup any file processed by PECompact 2.
/NoBackup
or
/Nb
 
/NoBackup
Allow Multiple  Compressions (on single file) If this switch is present, PECompact 2 will compress even files that have already been compressed with PECompact or some other product. The default is to skip (not compress) already compressed files.
/MultiCompress
or
/Mc
 
/MultiCompress

Priority class
 

This switch specifies the priority class in which to perform the compression. For instance, one may wish to have PECompact compress a large file in the low or idle priority class so that the computer remains responsible. The default is the normal priority class.
 
/Priority /Priority:idle
/Priority:low
/Priority:high
/Priority:realtime
Quiet
If this switch is present, PECompact 2 reduces the amount of writing to the console. This is intended for use in development environments. The default is off. That is, not to reduce the amount of console output.
 
/Quiet
or
/Q
/Quiet
/Q
Recurse (Console application only)
If supplied, directories will be recursed when searching for target filespec. The default is not to recurse subdirectories.
 
/R /R
 

Restore Imports

 

If "Yes" the original import directory is restored at runtime so that applications which hook imports to extend or modify third-party applications while running can find those of compressed modules. An example is NJStar Communicator and the ATI video adaptor drivers. The default value is "Yes". /RestoreImports
or
/Ri
/RestoreImports:Yes
/Ri:Yes
/Ri:No
Skip Shared Sections
If "Yes" sections marked as shared between instances are not compressed. If "No" these sections are unshared then compressed. If you expect multiple instances of your module(s) to be a common occurance, or if you need to these section(s) shaed, you should set this option to "No". The default is value is "No".
 

/SkipSharedSections
or
/Ssh
 
/SkipSharedSections:No
/SkipSharedSections:Yes
 
Strip Debug
Debug information is included so that debuggers may identify symbols. Release builds should never contain debug information. By stripping it, PECompact ensures that it does not exist in a release build. The default mode is "yes". In this mode, debug information will always be stripped.
 
/StripDebug
or
/Sd
/StripDebug:No
/StripDebug:Yes
Strip Fixups
Fixups allow a PE module to be rebased. That is, loaded an address different from that which it expected. Most executables do not need fixups, but most DLLs do. The default mode of "Auto" is recommended. The default mode is "auto". In this mode, fixups of executables will be removed, but fixups of DLLs and other modules will be preserved.
 
/StripFixups
or
/Sf

/StripFixups:No
/StripFixups:Yes
/StripFixups:Auto
 
 

Trim memory

 

If "Yes" the virtual memory of compressed applications will be temporarily trimmed at runtime (paged out). As the pages are referenced again Windows will of course page them back in. See MSDN documentation of SetProcessWorkingSetSize(hProcess,-1,-1) for more information. The default value is "No". /TrimMemory
or
/Tm
/TrimMemory:Yes
/TrimMemory:No
/Tm:Yes

Truncate Last Section

 


Truncates the last section to its unaligned raw data size. This results in an executable that is, at most, 511 bytes smaller. Some other executable packers do this, and it appears to be a safe operation. We recommend to test carefully though, as it is an unnatural state for a PE image. The default is currently 'No'.
 
/TruncateLastSection
or
/TL
/TruncateLastSection:Yes
/TruncateLastSection:No

Uncompressible Resources

 


This option allows for specification of resources that should not be compressed. By default, the first group icon and icons it references, version, and manifest resources are left uncompressed. For a list of resource type names, run the console application with no command line switches and select the 'R' option.
 
/UncompressibleRT:@list
or
/UncompressibleRT:typename1,typename2,...
or
/UncompressibleRT:typeid#1,typeid#2,...
or
/UncompressibleRT:namedrsrc1,namedrsrc2

(combinations of names, type names, type ids, and list files are supported).
/UncompressibleRT:@myrsrc.txt
/UncompressibleRT:groupicon,version
/UncompressibleRT:4,5,1,namedresource
Verbose (Console application only) If this switch is present, verbose messages will be emitted to the standard output device. The default is not to display verbose messages.
/Verbose
or
/V
 
/Verbose
/V
Windows Module Loader
(Console application only)
When this option is \"Yes\" all imported modules are added to the new import table so that Windows is responsible for loading them instead of the PECompact loader. When this option is \"No"\, the new import table may be smaller resulting in a smaller executable. It is recommended to leave this option \"Auto\" so that the appropriate action may be taken by PECompact. The default mode is "auto". In this mode, PECompact will determine the appropriate action. /WinModuleLoader
or
/Wl

/WinModuleLoader:No
/WinModuleLoader:Yes
/WinModuleLoader:Auto