Archive: UPX and Compress Installer.exe


UPX and Compress Installer.exe
Hello,

I have a problem that I have large special files that
are not compressed with lzma good. I do not know why.

When I compressed the created installer exe then I got
1200 kb
compressed with zip 800kb.

I would like to compress with upx all data again. Is there
a way?


why not use zlib compression then?


Originally posted by Anders
why not use zlib compression then?
zlib is larger than lzma.

Is there a way that UPX packed an installer.exe,
so that the installer.exe worked?

UPX doesn't support compression of the installer's data. You'll have to precompress it.


lzma compression of the data plus upack header compression is the best you can get.

for header compression use

!packhdr "$%TEMP%\exehead.tmp" "upack.exe $%TEMP%\exehead.tmp -c6 -f273" ;upack

or
!packhdr tmpexe.tmp "UPX --best -f -q -v --ultra-brute --all-methods --all-filters --compress-icons=0 tmpexe.tmp" ;upx

Note that !packhdr will only compress the EXE header of the installer, NOT the data block.

For the data I'd use LZMA compression and increase the dictionary size to 128+ MB. That's really the "best" compression you can get. If the data is already compressed, it can't be compressed any further though! It's like putting a ZIP archive into a ZIP archive. It won't get any smaller. If recursive compression would work, one could take a random file of any size and compress that file over and over again, until it's one single Byte in size...