To all plugin authors: UPX ???

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Jivan_Mukta
Junior Member
Junior Member
Posts: 28
Joined: 2013-09-23, 19:25 UTC

To all plugin authors: UPX ???

Post by *Jivan_Mukta »

Dear plugin authors,

I am not a program developer, so my question is:

Why you don't use UPX-compressor to produce smaller 32-bit *.wcx *.wfx *.wdx *.wlx *.dll *.exe ?

http://upx.sourceforge.net

Wherever it is possible I compress my plugin files and all the rest *.exe *.dll in TotalCMD\ with the maximal options:
UPX --ultra-brute PluginName.w?x

UPXX.bat
=========

Code: Select all

@echo.
@echo  Options:   --ultra-brute --overlay=strip
@echo.
@%~dp0upx.exe --ultra-brute --lzma --overlay=strip %1 %2 %3 %4 %5 %6 %7 %8 %9
-------------

My average result is about 3 times smaller files.
  • ADBplugin.wfx 7.2 : 2 014 720 bytes --> 588 288 bytes

    AdbWinApi.dll : 81 920 --> 47 104
    AdbWinUsbApi.dll : 96 256 --> 29 184
    aapt.exe : 855 040 --> 311 296
    adb.exe : 819 200 --> 311 296
  • tcPhonebook.wfx : 2 793 472 --> 796 160
Is there anybody against the following:
If a compressed file works it works 100%.

In my dilettante opinion the only problem with the compressed files is the resident antivirus, which spend more time for checking.

The main advantage of UPX compressed file is a PORTABE multi-functional compilation of 32-bit TC that save space on USB FLASH DRIVE.
(One day I hope UPX will support 64 bit dll & executables too.)

Best wishes to all of you!

Peter
seb-
Senior Member
Senior Member
Posts: 276
Joined: 2011-11-15, 06:14 UTC
Location: DE\BN - only part time TC user after switching to Linux ;)

Re: To all plugin authors: UPX ???

Post by *seb- »

I'm not a software developer either, but...
Jivan_Mukta wrote: In my dilettante opinion the only problem with the compressed files is the resident antivirus, which spend more time for checking.
to my knowledge it does not only take more time, but some Antivirus software will complain and warn the user that UPX-compressed (or any other runtime compressed executable) executables are executed. Edit: because it might think / detect it as a potential security threat.

I wouldn't say its easy to do it by default for every plugin file as it might lead to confused users...

brs
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Ghisler doesn't pack latest TC versions.
I prefer to have transparent unpacked programs and libraries.
Packed modules need more time for loading, also packed DLLs need more memory because OS can't use same physical section for all DLL instances.
Packed files, as it was mentioned, may be treated as suspicious by security software.
And, there is an NTFS compression that works better than PE packer because it doesn't modify them (although provides a bit less comperssion level).

So the only place where PE packing is really good is USB stucks/CDs/etc with unpacked portable software sets.
Jivan_Mukta
Junior Member
Junior Member
Posts: 28
Joined: 2013-09-23, 19:25 UTC

Re: to MVV

Post by *Jivan_Mukta »

According to http://upx.sourceforge.net
  • very fast decompression: ~10 MB/sec on an ancient Pentium 133, ~200 MB/sec on an Athlon XP 2000+.
    no memory overhead for your compressed executables because of in-place decompression.
UPX compressed PE files have some minor memory overhead (usually in the 10 - 30 KiB range) which can be seen by specifying the "-i" command line switch during compression.
So on my ancient Athlon XP 1800+ (Barton) the uncompression speed is twice faster than average sequential reading (~100MB/s) of a modern SATA HDD.

So decompresion itself cannot add a sensitive delay.

If sometimes there is a significant delay it may comes ONLY ftom the antivirus.

Besides, the smaller executabe means the higher probability whole file to be in read cache of OS for a second running.

Therefore if there is no a resident antivirus, UPX compresed file might run faster even from an internal SATA HDD.

(By the way since 30.09.2013 UPX support 64-bit PE.)
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

I think you have to thank the persons out there who misused UPX with bad intentions over the last years.
UPX is probably the most common (and one of the oldest) executable packer.
So it has been used for "concealing" bad software (Trojans, viruses, nagger programs etc.) quite often and still is.

It is quite easy and common to manipulate the header of the compressed files
so that normal decompressors in virus scanners can't analyze it on the fly.
The same applies to the once common "ASPack".

So that's why many virus scanners out there complain about such files.
Also you would lose digital signatures when compressing files which contain them.

For this, UPX and similar programs lost quite a share of popularity during the last years.
(not to mention that we're having multi-terabyte HDDs today which makes it even less useful to compress everything where possible)

It is really not common to ship your executables compressed, but it's up to you to compress them on your own, like you did.
Post Reply