Skip to content
⌘ NSIS Forum Archive

Upx & Nsis

5 posts

amckern#

Upx & Nsis

Hey!

I was just messing around with UPX 2.03 (http://upx.sourceforge.net/ OR http://en.wikipedia.org/wiki/UPX) and found I can compress almost 20KB out of some of Null soft installers, while I can dump 30kb-190kb out of my own.

Now, I know this is a complex question but:

Am I destroying the content of these installers? (I am making back ups before I UPX them)

Is it only the NSIS scripting language that is getting compressed inside the installers, or has UPX found the actual program that the installer is meant to install, and is compacting it as well?

Examples

nsis-2.24-setup.exe

1480945 bytes to 1467121 bytes (99.07%) = 13824 bytes / 13.5 KB smaller

Original File


UPX File


Stats



Setup_Prime_TCS.exe

382761948 bytes to 382749148 bytes = 12800 Bytes / 12.5 KB smaller

Script


Before


After


Stats

amckern#
Because I normally use HM NSIS, where about would I stick !packhdr - and will that UPX the correct files at compile time, instead of having to run them through the external tool?

I also saw that UPX reserves its self a slice of ram at run time, would this be a hack way to safe guard your self against buffer over runs? Or is it the other way around, and will have a more significant chance of causing them?
Afrow UK#
You just put it in your script.
Documentation shows this example:
!packhdr "$%TEMP%\exehead.tmp" '"C:\Program Files\UPX\upx.exe" "$%TEMP%\exehead.tmp"'
-Stu