PDA

View Full Version : UPX - Compression app to free up space


kelford
08-05-2006, 09:21 PM
I found this thread (http://www.aximsite.com/boards/showthread.php?t=125898) on aximsite, a forum I still visit from when I had a Dell Axim and it looked interesting. I didn't find the app in a search here, so I thought I'd post it for anyone who might be interested.

UPX (http://upx.sourceforge.net/) is apparently an app that lets you compress .exe and .dll files without really impacting perfomance in any noticeable way (per the postings in the thread.) I haven't tried it yet, but might give it a shot. It seems the app is not resident on the pocket PC, but needs have files moved to the pc, compressed, then moved back. It's a little bit of work, but it only needs to be done once, so after the set up, it sounds like you're good to go.

Anyway, just thought I'd pass it on as an FYI for anyone who might be interested.

Oh yeah, and it's free too.

Chatty
09-05-2006, 12:14 AM
Finally UPX is available for WinCE. You should have posted in "General" in the first place.

This program makes your programs even start faster (less to read from usually slow SD card, storage, ...).

stanip
09-05-2006, 06:40 AM
For a non-technical person, I am a bit confused... Reading thru the thread, it seems that more ram are required to run the compressed apps.
What exactly do we gain if the apps are stored on a storage card where storage space is not really the issue? Need help.

vijay555
09-05-2006, 11:33 AM
Wow, thank God. UPX is old skool genius.

Can someone give it a go on the enormous Skype executable? I'm not near my phone for a while and can't check it.

V

Chatty
09-05-2006, 01:39 PM
vijay, I tested it on the big MobileNavigator.exe which is around 3,7 MB originally. UPX'd only 1,1 MB or so. And it runs! Even Voice Command (300KB down to 100KB). Since I have it installed in Storage it starts faster (Storage is soo slow).

vijay555
09-05-2006, 02:29 PM
Thank goodness. This is a God send, when reversing PPC binaries you can see that they're full of so much slack.
I had a look at UPX quite a while ago - I use it to compress all my PC VB and C++ stuff, but was disappointed to find it didn't work on PPC. I'm :D now.

Decompressing presumably incurrs some overhead, but it'll help us out when we've got limited storage.

V

Chatty
09-05-2006, 03:06 PM
Decompressing presumably incurrs some overhead, but it'll help us out when we've got limited storage.

I can't agree with that. You can read on the authors page, that

Your executables suffer no memory overhead or other drawbacks because of in-place decompression.

Although decompression takes some time it is still faster, because it is read into RAM a few times faster than it normally would. This saves more time than it takes.

vijay555
09-05-2006, 03:31 PM
Good point Chatty. My concern was CPU overhead on slower processors (OMAP), but as you say, since you're using RAM or faster storage, it'll probably compensate.

V

Bartjan
09-05-2006, 11:21 PM
i tried it with opera and tomtom which are both on my main memory

results:

original opera startup 14 sec
upx opera startup 9 sec

original tomtom startup 15 sec
upx tomtom startup 14 sec

i also tried it with tcpmp which is on my SD card

original tcpmp startup 3 sec
upx tcpmp startup 2,5 sec

so it seems to speed things up a little :D

HOWEVER... in opera the the '-' buttons dont work anymore.. they do work when you use them through the touch screen though..
and the text ('Stop'/'Go to' and 'Menu') is aligned to the left of the screen instead of the normal at 1/3rd and 2/3rd of the screen.

--------------------------------------------
[edit] extra information

original opera 4,86mb
upx opera 1,63mb

original tomtom 2,62mb
upx tomtom 1,67mb

original tcpmp 1,21mb
upx tcpmp 1,21mb

not only a speed gain but it also saves room :D

Bartjan
10-05-2006, 10:29 AM
after a few tests i found out the opera.dll is responsible for the movement of the ´-´ buttons and the not functioning with the keyboard

the opera.exe, xmlparse.dll and zip.dll have nothing to do with it..

with the upx´ed above three and the standard opera.dll startup takes 12 sec so its still some faster then all original files :)

however the original opera.dll is 4,74mb and the upx opera.dll is 1,57mb, so it doesnt save much room :!:

im just glad ill receive a 4gb SD card today which will give me some extra breathing room compared to my 512mb :D

Chatty
10-05-2006, 01:45 PM
however the original opera.dll is 4,74mb and the upx opera.dll is 1,57mb, so it doesnt save much room :!:

1/3! What do/did you expect? I find this rather great!

Bartjan
10-05-2006, 01:57 PM
i meant:
when you use the original opera.dll so the ´-´ buttons still work right, you dont save much room compared to the all original opera :roll:

PReDiToR
11-05-2006, 06:18 AM
I went through last night and UPX'd every DLL and EXE that I could, including WisBar (and Desktop), Resco, Opera, PocketInformant and other stuff.

PocketInformant won't start if one of the DLLs is UPX'd, but I don't remember which one. The rest of them and all the EXEs are fine.

Opera - as above. Screw the soft keys, 3MB is a lot of slack to be rid of.

Resco was interesting. The Today plugin messed up at one point, and the Explorer went completely scatty with fonts. Even after uncompressing all the Resco files again the Encrypt/Decrypt context menu items were blank but functioning.

WisBar (compressed) can now live in the 10MB Ext_ROM along with Opera and Resco.

All in all it is something to use carefully, but can save a LOT of space.

hanmin
11-05-2006, 10:36 AM
Hmm.. so far the responses from the trial seems good. I'll give it a try too later this weekend :)

--- UPDATE (12 May 06) ---
My results, using UPX -9 (e.g. max compression)

All programs are working so far, but performance are negligible (e.g. less than 2 seconds improvements)

from \Windows

PITools.dll 1.18M -> 504K (save 700K)

from \Program Files

Mobibook.exe : 1.61M -> 619K (save 1.0M)
Tom tom navigator : 1.59 -> 692 (save 900K)
WorldMate.exe : 747K -> 207K (540K)

So, that is a saving of 3M of space! Anyway, for those of you that are adventurous, there are various 500K size dll files in \Windows folder, which I doubt can save much (e.g. the effort/space ratio isn't that attractive).

Anyway, I've found the following files on \Windows that seems to be compressable.

ppt.exe (powerpoint)
gwes.exe (???) <-- DO NOT RUN. It will hang your unit.
gdiplus.dll (???)
msxml3.dll (???)

However, I'm not sure if it is a good idea to compress the ppt that is in ROM, and others are unknown programs (e.g. not sure how to test it after compression)

I've also looked around my SD card and found the Tennis.exe game that I have, that is 2.4M in size which were then compressed downed to 2.17M, which is a bit disappointing. I didn't test if it runs on my unit or not.

belfast-biker
12-05-2006, 01:15 PM
Hmm.. so far the responses from the trial seems good. I'll give it a try too later this weekend :)


An pages anywhere with a list of what NOT to compress?

acetuk
14-05-2006, 10:23 PM
This is an excellent app! I have compressed all of my apps and have not had any problems.

The big ones for me are PlanMaker and TextMaker - both have compressed to a fraction of their original size. Infact I was running a little tight on space I hadn't even installed TextMaker. But now I have compressed both it isn't a problem.

The only strange one so far is ListPro which works fine but loses it's icon.

I haven't tried to compress everything possible, just the apps and may be the main dll.

I have now got about 5mb more storage space than when I started with TextMaker installed.

Excellent! :)

PReDiToR
15-05-2006, 02:02 AM
Anyway, I've found the following files on \Windows that seems to be compressable.

ppt.exe (powerpoint)
gwes.exe (???) <-- DO NOT RUN. It will hang your unit.
gdiplus.dll (???)
msxml3.dll (???)

However, I'm not sure if it is a good idea to compress the ppt that is in ROM, and others are unknown programs (e.g. not sure how to test it after compression)
You're right that compressing something that is in ROM isn't a good idea, that takes up space!

If you have a file in ROM like \windows\PPT.EXE and it is 1MB in size, then compress it to 500KB, copy it back to \windows, you actually USE 500KB of Program Storage rather than saving it.

Your ROM is Read Only, you can't delete files from it or overwrite them.
What actually happens is that you create another file with the same name and the OS ignores the one in ROM.

I do this with ClearStorage.exe.

I created a .TXT file and in it put
Clear Storage is dangerous.
then renamed it to ClearStorage.exe. I put it in the \windows folder to stop anyone erasing my device by accident(!).

If I need to clear my device I can delete the file and the original ClearStorage.exe is still there.

Try it yourself.

There is no easy way to save space.
If you want to load your apps to ROM and delete the crap ones that come with the OS this will work, but you will have to decode the ROM, edit the hive files, re-encode the ROM and flash it.
This is no small task, but it can be done (I plan on doing it myself actually).

Rabangus
15-05-2006, 10:31 AM
Wow - This is fantastic. In just a short amount of time I have saved several meg of space, and some programs (such as TomTom) run significantly faster.

Superb!

Cheers
Rowan

monx®
17-05-2006, 04:05 AM
Amazing. My Big Storage now BIGGER :)

CameronJ
17-05-2006, 08:40 PM
Some results (on a Wizard)

MS Communicator Mobile - Compressed the exe and one dll down to 33% (1.3mb). The app would not run with one dll (lclang-res96.dll) compressed.

GoodLink - Compressed GoodApp.exe (the biggest file) from 3.5mb to 1.2mb successfully, however by compressing the largest dll (GoodLinkRes_EN.dll) I lost the soft key labels (and probably some other stuff).

TomTom Navigator - 41%

MS VoiceCommand - Compressed from 1.6mb to .6mb

Those were my big files on my device. Using UPX gained me an extra 6mb storage memory - which was a 50% increase (I went from 12 to 18 ). Off to try it now on my Storage Card apps.

Also, .NET files are not currently supported.

4yunweb
07-06-2006, 01:36 AM
sounds very interesting.

which file to download, please? i don't see the version for WinCE, only Windows 32

does it compress tomtom maps, voices etc (they are not .exe or .dll files)?

jvoelcker
14-06-2006, 04:31 PM
I've just been having a play with this and I think I have done one compression too much with Spb Pocket Plus and now my machine locks so am having to reinstall everything.

During my playing I think I have resolved the icon problem by just setting UPX to not compress the icons.

For those of you using UPX, would it be possible to post a list of the programs/files that you have compressed and also give details of the settings that you used just to give an idea of what works/doesn't work.

meschle
22-07-2006, 02:57 AM
Vicott Wong has just put together a PPC version of UPX compression UPX4PPC - and very good it is too. Much easier than the command line pc way and can make a backup too.

http://mobile-sg.com/ppc/apps/UPX4PPC/SS_b2.png

download here http://mobile-sg.com/ppc/apps/download.asp?dl=UPX4PPC&type=cab

web page here http://mobile-sg.com/ppc/apps/?p=UPX4PPC

adam_j_bradley
04-08-2006, 10:25 AM
Looks like most of the DLL's from the .NET CF 2.0 compress with UPX ok

ashleyhall
04-08-2006, 01:15 PM
If I can suggest a feature for any update of this great app - A 'Scan' feature would be nice, with the ability to pickup any exe/dll that can be successfully compressed, saves trauling through the entire device and then accidently clicking Cancel (yes...I know...silly me....!).

Another useful feature, when the compresssing begins, a status screen, or at least something that shows a running process (rather than a spinning symbol in the center) would be nice.

And finally something to stop the screensaver/keypad lock kicking in would be nice, my device kept going onto standby whilst compressing and I was worried that it wasn't actually compressing whilst on standby?

vicott
04-08-2006, 04:05 PM
If I can suggest a feature for any update of this great app - A 'Scan' feature would be nice, with the ability to pickup any exe/dll that can be successfully compressed, saves trauling through the entire device and then accidently clicking Cancel (yes...I know...silly me....!).

Another useful feature, when the compresssing begins, a status screen, or at least something that shows a running process (rather than a spinning symbol in the center) would be nice.

And finally something to stop the screensaver/keypad lock kicking in would be nice, my device kept going onto standby whilst compressing and I was worried that it wasn't actually compressing whilst on standby?
Unfortunately, all these features are out of the scope of UPX4PPX. This is because the program is nothing but a frontend user interface for UPX and UPX is the command line utility that does the real work. Since I am not the developer of UPX, it is impossible for me to determine which files can be compressed or find out how long it would take to compress a file. The most ideal solution would be for the original UPX team/developer to release the UI.

adam_j_bradley
04-08-2006, 04:16 PM
In order of preference, the following would be nice!

x The ability to filter on exe/dll files that are in ROM
x The ability to add more than one file at a time
x The ability to set a default scan type (exe/dll)
x The ability to set and return to a default directory
x To cache files in a particular directory
x To display which files have already been compressed

Thanks in advance
Adam

JeromeMorrow
05-08-2006, 12:19 AM
So, I am going to try it! :D

amf
10-12-2006, 08:54 AM
I'm using it on my TyTn. Have compressed the exe files for Pocket Informant, Skype, Resco Explorer, MapKing, Pocket Zen. Sktools doesn't launch when compressed. I find that exe files launch faster when compressed.

mbirth
10-12-2006, 06:36 PM
I'm not sure whether it is wise to compress everything with UPX. Especially after I read this paragraph from the Wikipedia page (http://en.wikipedia.org/wiki/UPX#Disadvantages_2) of UPX:

Executables compressed with UPX have a greater impact on system resources. The operating system cannot read their decompressed images on demand from the disk (see virtual memory), like it would with normal, uncompressed executables. Instead, the UPX stub allocates a block of memory to hold the decompressed data, which stays allocated as long as the executable stays loaded, whether it is used or not, competing for memory resources with other applications all along. This also prevents UPX packed executables from reusing resources when an executable is loaded more than once at the same time.

Also read the page about Executable compression (http://en.wikipedia.org/wiki/Executable_compression).

On a device with such small memory resources (i.e. RAM), I prefer to keep everything as it is meant to be. In memory those compressed apps require at least the same or even more space as the uncompressed version. And for storage I have a 2 GiB Hi-speed SD-card. So why compress them?

Cheers,
-mARKUS

r3bel
11-12-2006, 08:36 PM
because some things cannot be installed on sd card. this means that main storage memory is highly prized but quite small. (like land in manhattan :))