Help - Search - Members - Calendar
Full Version: Let's UPX the rarely used dll's in system32 ?
MSFN Forums > Member Contributed Projects > nLite

   
Google Internet Forums Unattended CD/DVD Guide
AlfonsoX
Hi,

I have a Asus EEE PC with a 4 GB flashdisk with an nlited XP installed now.
But I was wondering if it's a good idea to make a list of the rarely used dll's and
to UPX then after the windows setup, which could save some valuable MB's smile.gif

any idea's?

greetings,

Alfonso
TranceEnergy
Why not upx everything? Most things could be compressed i guess. Stay away from kernel files. Test in a vm setup.
johnhc
TranceEnergy and AlfonsoX,
One reason to be careful about this is something I found (via Google) some time ago:
Windows reuses DLLs that are in memory for all processes requesting them. When a DLL is UPXed, Windows does not recognize it and will therefore load it as many times as requested by processes. Saving a little disk space, requiring decompression time on each load, then getting multiple copies in memory did not seem to be worth any HDD space saved. HDD space is dirt cheap now and is only going to get cheaper.
Enjoy, John.
TranceEnergy
Well i remember i used AsPack once upon a time on windows 2000 i think it was, that worked. Program had option to enable decompression by default in windows boot or something. Dont really recall too good, except that it worked. I know upx is far better for compression, but i'm regardless sure there are ways to compress system .


AlfonsoX: A couple of simple steps you could do to maximize space usage on your 4gb flashdisk.

Get a disk partitioning program that can set cluster size to 512bytes (0.5kb) and disable pagefile or at very least set it to a small size like 16mb minimum/16mb maximum for systemdrive and rather use a large pagefile on another drive, if you really think you need it..

Also you could use normal windows compression. I have no idea if there are tweaks to set a stronger compression as default in windows, but worth a google i guess.

On the other end there are tweaks to disable compression for good that i know.
AlfonsoX
Hi,

thanks for the response, some notes.
I know that the dll's won't be reused, that's why I want to UPX only the rarely used ones, which I think there are a lot...problem is more which one is rarely used and which one much. Mhh I think it's more an idea then realistic to do it.
I have disabled the pagefile and hiber file. The clustersize is probably a good one, because there is now 16MB wasted.
TranceEnergy
I have started to write some batch files that will effectively move files out of windows folders, to a backup folder mirroring the location of the original file.

If you have suggestions for what files to move im open for suggestions. I'm going to write this in some posts i have in a thread under windows 64bit (but would work for 32bit xp too im sure),
but currently, last time i checked, i could not edit my own first post there, so im not adding things to it until that situation has been resolved.
The whole idea i have is that, windows install can be nlited after windows install, and still be able to revert any changes to it.

F.ex Windows Error reporting, some like it some not, i dont really need it, but i found that it had like 20 dll files that were language files, so i added that i would move those files, so they can be deleted if user wants to.
Or one could back them up,archive them, whatever one wants.

Currently i can do small things like disable system restore, remove the system restore tab from my computer, stuff like that.
GrofLuigi
QUOTE (TranceEnergy @ Aug 29 2008, 02:16 PM) *
I have started to write some batch files that will effectively move files out of windows folders, to a backup folder mirroring the location of the original file.

If you have suggestions for what files to move im open for suggestions. I'm going to write this in some posts i have in a thread under windows 64bit (but would work for 32bit xp too im sure),
but currently, last time i checked, i could not edit my own first post there, so im not adding things to it until that situation has been resolved.
The whole idea i have is that, windows install can be nlited after windows install, and still be able to revert any changes to it.

F.ex Windows Error reporting, some like it some not, i dont really need it, but i found that it had like 20 dll files that were language files, so i added that i would move those files, so they can be deleted if user wants to.
Or one could back them up,archive them, whatever one wants.

Currently i can do small things like disable system restore, remove the system restore tab from my computer, stuff like that.


...And a new Bold Fortune is born! biggrin.gif

GL
TranceEnergy
Please dont compare me to a guy who sells batch files, thanks. xD
GrofLuigi
QUOTE (TranceEnergy @ Aug 29 2008, 09:15 PM) *
Please dont compare me to a guy who sells batch files, thanks. xD

Sorry, didn't mean to offend you. no.gif blushing.gif

GL

Kelsenellenelvian
QUOTE (TranceEnergy @ Aug 29 2008, 01:15 PM) *
Please dont compare me to a guy who sells batch files, thanks. xD


OUCH! Thats a very good rep point Trance!!!

Good to see not everyone loves him...
TranceEnergy
Anyone sane person, tho i consider myself crazy, would never consider buying text files. How ridiculous is that. lol.
I just hope to fill a hole in what nlite can't do, such as removing bloat that is installed from applications.
F.ex adobe cs3 installs like eula and different language files for xx different languages. So the plan basically is to build a set of such batches that will remove everything but english, as an example. I'm not sure how much i remove yet, but i think the file count is like 400+ atm.
I'm quite sure many of you like this idea of having that capability. It's kind of sad when you have made a nlite iso that works really great for you, and every application you install, comes with all these files that you will never, ever need. Tho if you might, you could put them back in, if you didnt delete files.
GrofLuigi
I didn't even know he started selling them...

But nevermind. I'm not particularly into this method - deleting files. I use regsvr32 /u instead. laugh.gif biggrin.gif tongue.gif

But Windows don't play fair and silently regsvr's them again. ohmy.gif mad.gif angrym.gif realmad.gif

GL
Kelsenellenelvian
HAHAHH windows wasn't built to play fair! Thats what god made Nuhi for...
TranceEnergy
GrofLuigi: Not if i have moved/deleted the files! xD Whole point is to take charge of what files are kept in the system.
GrofLuigi
QUOTE (TranceEnergy @ Aug 30 2008, 12:18 PM) *
GrofLuigi: Not if i have moved/deleted the files! xD Whole point is to take charge of what files are kept in the system.

I know, but it isn't ideal. You can only get away with the odd ones that noone asks for. Otherwise, the 'hot' ones (and they are usually the most annoying) are referenced through:

1. Ole/Com registration - unregsvr is the cure for that (not perfect, as we know). BTW, Windows plays another dirty trick for some .dll's - they can't be unregsvr'd by themselves, you have to search&destroy their registration manually in regedit.
2. inf files - nLite is the cure for that. Or direct .inf editing if you have the nerves.
3. direct hardcoded dependency in another executable file - if you delete the referenced file, SOMETIMES you can get away with it.
4. Then there is WFP - that's completely cured. smile.gif

I fear that the reversal of 1. will never be cured.
Reversals of 2. are slowly sorted out (as ironed bugs in nLite) but it still isn't perfect - and I don't know if Nuhi deliberately leaves some entries for compatibility reasons or not. But I like it that Nlite fights back too - patches if necessary. newwink.gif
You can see 3. in Dependency Walker - hell, even Microsoft haven't sorted out MSJAVA.DLL yet, four years after it was removed. You always see it missing even on a full clean install.

So... it's difficult. But work on that is always welcome. thumbup.gif

GL
TranceEnergy
The only way to get it done, is to start, or obviously there's not a chance in hell of ever being able to do anything ;D
At least that's one of the thoughts i have, i'll note down problems and somewhere down the road i might find solutions, and i'm pretty confident in that regard.
As far as registry issues, well, reverse engineering will go a long way xD Most likely some issues in general can only be "fixed" by patching various files.
Also another good reason i like is to find files that nlite doesnt remove, which is just pure joy. I'm hoping to upload the s*** in a few weeks when i'm confident that things more or less work.
edit: while these lasts posts i originally thought was off topic, they kind of isn't. Alternative solutions forever =p

On a sidenote/more on topic: It would probably, for majority of files i *think* be doable to have batch files to upx compress and upx decompress files. Then in my head/theory it wouldnt be a problem with windows updating etc.
However most likely one would need to run with wfp/sfc disabled and or/patched.
It wouldn't take much time either to make it, tho i haven't read up on upx command line usage lately.

What would be needed in order to do that?

1 : Well, a complete listing of all files on the windows installed operating system. There's little point in trying to exclude files at start.
2 : Duplicate file list, for compression and decompression.
3 : integrate upx packer in windows with possibly using $OEM to copy files to system32 f.ex.
4 : Testing. If things first dont work, try to exclude files 1 by 1 needed in order to just simply boot. Then try WU files.

OR alternatively there might exist software already that will do on the fly upx compression of files.
I remember some years ago it was popular with software that would zip archive any files, made things a total mess imho =D
mitsukai
pessimization.

obviously computer with low storage also has low processing, slowing the system down(at appllication start and windows boot).
I know how PE's work, dont know how UPX packs the DLL's, but that it will load DLL's multiple times seems logical to me.
Storage is cheap.
All this is sayd before, so u think its useless. And the best solution would be to use NTFS compression. Linux is good in this, it probally has a file system with good compression already.
TranceEnergy
mitsukai, you are totally forgetting that 4gb is what he maximum has to go on on that disk.

And low storage space and low processing doesnt make sense as you say.

Take my amiga f.example 1000GB storage space and 66mhz. Ergo your argument totally fails, breaks, crushes. It doesnt make sense.
mitsukai
you are right that ther are exceptions to my statement, i was talking generally. Still it does make starting applications slower.

still your statement breaks also. Cause they are microsd of a few gig aenough to store windows. there are external hd's with up to a TB. usb sticks up 16 gig and sd cards up to 32 gig. if not more, im not keeping count.

if for example you have a EEE Box, then i dont think you want compress anything, it will be so much slower.

And not to mention sinds viruses are also packed UPX to hide themself from antivirus, might trigger an antivirus. Then there is also windows debugging which also breaks. And there are more reasons. Thats why im telling you to compression through the FileSystem, this way you dont get such problems.
TranceEnergy
Look, if the disk is only 4gb it is only 4gb. Period. I'm quite sure he is aware it is possible to get larger drives. That is not what he asked for though.
mitsukai
how is 4 gig not enough? in my nlited i had windows on a 2gig partition, and i dint even optimize that partition for space, nor dint i use ntfs compressions, nor dint i remove pagefile and hibernation file, then there is 2 gig left for applications, which you can make portable versions of and are way smaller. then there is an option to just get more space and its so cheap.
TranceEnergy
Maybe he plans to install MAME and some old games taking up some space, who knows? Maybe he's crazy enough to run cs3 on it. Who cares? Point is he wanted a way to get more space on iso, and kind of want to keep components it seems.

I agree though that ntfs compression seems like the easiest best way in general. Still upx is great on exe compression..and other files too of course.

Perhaps get hold of PE bundle so he can stick dll files into exe files, saving some more space then, and upx the new exe file.
mitsukai
maybe he wants to run World of Warcraft on his 4 gig disk .... wait i thought wow is 8 gigs + : )
TranceEnergy
And here i am thinking i was the off topic person.
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.