UPX compress dll fail

Search This thread

xsapphire

New member
Oct 16, 2008
3
0
I used UPX to compress a big dll(>5 MB), compress successed, but the program can't execute, anybody know why? and how to fix it?
 

pj1115

Member
May 28, 2009
41
1
London
UPX compression on modules (DLLs) does not usually work with Windows Mobile software. It renders them unreadable and the software usually returns an error.

Compress only executables (EXEs) in future. Why? Because the operating system is designed to be able to use compressed executables -- anything higher level than the OS has to be written to use compressed modules.

Think of it like this:
You can tell a child to eat some candy and he will eat it just fine. But show him some candy that doesn't look or smell like candy (even though it is candy) he will probably not eat it without being told what it is.

Terrible analogy, but you get the point.
 

xsapphire

New member
Oct 16, 2008
3
0
UPX compression on modules (DLLs) does not usually work with Windows Mobile software. It renders them unreadable and the software usually returns an error.

Compress only executables (EXEs) in future. Why? Because the operating system is designed to be able to use compressed executables -- anything higher level than the OS has to be written to use compressed modules.

Think of it like this:
You can tell a child to eat some candy and he will eat it just fine. But show him some candy that doesn't look or smell like candy (even though it is candy) he will probably not eat it without being told what it is.

Terrible analogy, but you get the point.

thx for reply, do you know some other ways to reduce dll's size? like some compile option?
 

pj1115

Member
May 28, 2009
41
1
London
If you're the developer of the application, you there are various changes you could make, including adapting the application to support UPX compression on dependencies. I'm not familiar with any methods specifically.

Otherwise, no. In short, there is not much you can due to reduce the size of the modules without breaking them.
 

bimbam69

Senior Member
Apr 16, 2008
177
6
Kaunas
UPX compression on modules (DLLs) does not usually work with Windows Mobile software. It renders them unreadable and the software usually returns an error.

Compress only executables (EXEs) in future. Why? Because the operating system is designed to be able to use compressed executables -- anything higher level than the OS has to be written to use compressed modules.

Think of it like this:
You can tell a child to eat some candy and he will eat it just fine. But show him some candy that doesn't look or smell like candy (even though it is candy) he will probably not eat it without being told what it is.

Terrible analogy, but you get the point.

Isn't dll's and exe's has the same format?

Maybe OP is facing some bug or doing it wrong.
 

xsapphire

New member
Oct 16, 2008
3
0
thx for all reply, google is really a good friend, but not help much, maybe I need to find other ways.
 

joemanb

Senior Member
Feb 22, 2006
301
0
Ogden,Ut
UPX will compress .DLLs .EXEs, and .MUIs. The problem is they don't always decompress.

I have no problems UPXing .DLLs, but you have to test them.

I always test with the UPX -d option to ensure that they decompress.

If it doesn't decompress, then you're out of luck with that particular file.

Sometimes they decompress, but still won't work properly because the resources get screwed up, in this case using the option "--compress-resources=0" increases my success rate.

the full command line I use is:
UPX *.dll -f --compress-resources=0 --compress-exports=0 --strip-relocs=0 --best --ultra-brute

then to test them:
UPX *.dll -d

I get a high rate of success, but there are occasionally files that won't work.

J03M4N
 
Last edited:

WoZZeR999

Senior Member
Dec 30, 2008
339
51
US, Michigan
If it's a large dll with many resources, you can export the resources and compress them (use less colors/detail) and that will help. Dithering can cause a image to become much larger.