Bitsum Community Forum

General Category => PECompact, PESuite, PEBundle, and other developer tools => Topic started by: jgutierrez on December 31, 2012, 01:21:21 PM

Title: PETrim broking InnoSetup files
Post by: jgutierrez on December 31, 2012, 01:21:21 PM
PETrim is broking InnoSetup files. Looking for additional switches to preserve overlay information, I have found no clue.
Any hints? Is it a bug on PETrim?
Title: Re: PETrim broking InnoSetup files
Post by: Jeremy Collake on December 31, 2012, 07:11:49 PM
PECompact can handle overlays with its new overlay emulation (in the beta). Try using it with overlay emulation turned on, if that is an option.

The problem is that even if if PETrim puts the overlay back, it ends up at a different physical offset. A small minority of installer/SFX archive decompression stubs dynamically calculate the offset for the overlay at runtime, and they work fine. Unfortunately, the MAJORITY of these stubs use a stupid hard-coded physical offset. Well, after the size of the base PE has been reduced, the overlay is clearly at a different offset.

This hard coded offset problem is what PECompact's overlay emulation addresses.

For the few installers and SFX archives that are available.

I can add a new option to PETrim so that it can preserve the overlay. Whether it then works for Innosetup files, I don't know. There isn't much revenue (well, none) coming in from the freeware PE Suite tools, but this won't take long to amend. If you want to 'sponser' the work, then send $50 and you're more likely to get my attention faster ;p. (sorry, I have bills :o). Otherwise, I have maintenance coming up and will try to slap this on in.

Another option is to find the Innosetup SFX/stub that is used by Innosetup when creating an installer and run PETrim on it. Soimetimes it is sitting around as a stand-alone file, other times it is in the resources. Depending on how InnoSetup works, this may or may not work correctly afterwards.
Title: Re: PETrim broking InnoSetup files
Post by: suni93 on September 29, 2014, 06:25:17 AM
 Unfortunately, the MAJORITY of these stubs use a stupid hard-coded physical offset. Well, after the size of the base PE has been reduced, the overlay is clearly at a different offset.