📄 readme.txt
字号:
CExe - A tool for creating compressed executables
Description
-----------
CExe Executable Compressor
Compress any executable! With CExe, you can compress any
executable and make it significantly smaller and still fully
functional. This is useful for sending executables in email,
downloading executables over the net, fitting executables on
floppies, etc. CExe can compress Win32 executables, Win16
executables, OS/2 executables, WinNT Posix executables...
the output format is *always* Win32 executable format.
CExe has 2 compressors built into it, and picks the one that
makes the result the smallest. For smaller files, it uses LZExpand
to decompress, which is part of Windows. For larger files
(.exe files are usually large!), it uses the free and incredibly
useful ZLib Library for decompression. In the case of using ZLib,
the decompressor itself is decompressed using LZExpand and then
used, resulting in a smaller overall compressed file size.
NOTE: The resulting compressed executables run on any platform,
however at this time the CExe tool itself runs on NT only - if
someone were willing to write resource writing code it would be
working on Win95/98 too (the BeginUpdateResource()... apis aren't
implemented on Win95/98).
The compressed executables it creates work on any Windows platform.
Here are some results:
Program Old size (bytes) New size (bytes) Percent Savings
mspaint.exe 339728 170496 49.81%
excel.exe 5604624 3492352 37.69%
winhlp32.exe 311056 178688 42.55%
sort.exe 24848 14848 40.24%
winver.exe 20752 12800 38.32%
sw98.exe 124416 50688 59.26%
In the spirit of the fantastic & free ZLib, and the fact that there are
so many non-free exe compressors on the market, I am making cexe freely available.
CExe is a free utility, covered by the Gnu Public License.
The gnu public license is at:
http://www.gnu.org/copyleft/gpl.html
Please contribute to CExe so the Windows community can benefit!
Read the "Wish List" section for more info.
How it works
------------
CExe reads in a given .exe, compresses it, then attaches that
compressed result as a resource to a very small decompressor .exe
(called dexe.exe), renames the file appropriately, and also
copies over the icon that was on the original (if there is one).
When the compressed .exe is run, you are actually launching a
version of dexe.exe, which decompresses the compressed resource
into a temporary file, then launches this temp file with the
command line parameters given to dexe. Dexe waits for the target
executable to return, then deletes the temp file and returns the
right result code.
CExe is built to allow additinal compressors to be installed into
it. You just need to implement the Compressor interface (look at
cexe.h). CExe tries all the compressors that are installed, and
chooses the compressor that gives the best results on the input
file. This size comparison includes the size of the decompressor
that needs to be bundled as part of dexe.exe.
The Files and Projects
----------------------
CExe is the master program that controls how the compression process
progresses.
ZLib inflate is a project that builds a .dll that is used as the
decompressor for zlib compressed executables. CExe stuffs this .dll
into dexe.exe during the compression process if the zlib compressor
is chosen.
ZLib deflate is the project that builds a zlib compressing executable.
CExe uses this as part of its compression process.
DExe is the decompressor. It decompresses its resource based payload,
executes it, and returns the result code (as described above). CExe's
job is to figure out which compressor to use, then write out a custom
DExe with the right resources attached.
All projects are VC++ 6.0 projects. Also note that the CExe project
already has already compiled versions of inflate, deflate, and DExe.
Most people will probably only be interested in changes to CExe.
Notes
-----
A goal of DExe.exe is to be as small as possible. To this end, I did
a number of tricks to the linker settings. I did not use the default
libraries, I set the default section alignment, and I combined
output from various sections into one section. This drastically cuts
the overall .exe size. The same sort of tricks were done to inflate.dll,
since that is a .dll that is a resource in many compressed executables
(although it is compressed itself too!)
Wish List
---------
1> Gui front end to CExe would be great.
2> More compressors please! Anything better than zlib?
3> CExe.exe writes resources into an existing DExeexecutable.
In order to do this, it uses these Win32 apis:
BeginUpdateResource()
UpdateResource()
EndUpdateResource()
These apis don't work on Win95/Win98. They only work on
NT (the executable that is output from CExe will of course
run on any Windows platform). These are fairly simple apis
to write; if someone where to write versions of these apis
then cexe.exe would run on Win95/98.
Change History
--------------
07/20/01 - v1.0b
Scott Ludwig
scottlu@eskimo.com
http://www.eskimo.com/~scottlu
Fixed a bug where CExe would fail if executed on a path with spaces.
??/??/99 - v1.0a
Scott Ludwig
scottlu@eskimo.com
http://www.eskimo.com/~scottlu
Fixed a temp file bug with multi-processor machines.
10/15/98 - v1.0
Scott Ludwig
scottlu@eskimo.com
http://www.eskimo.com/~scottlu
Created and released v1.0 under gnu public license.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -