Bitsum Community Forum

General Category => PECompact, PESuite, PEBundle, and other developer tools => Topic started by: HPKunz on October 01, 2013, 05:43:12 PM

Title: Can't compress EXE generated by Embarcadero RAD Studio XE4
Post by: HPKunz on October 01, 2013, 05:43:12 PM
We use PECompact (now the latest version 3.11.00.02 beta) for many years to compact our EXE file - with standard settings. We are now changing our IDE from Embarcadero (Codegear/Borland) RAD Studio 2007 to XE4. Now we can't compress the EXE file any more. I have uploaded the EXE file in a ZIP archive to
http://www.sked.de/PECompact.zip (http://www.sked.de/PECompact.zip)
Could you please check the EXE file and tell me which settings we have to change or if there is a bug in PECompact?
Thank you for your help!
Kind regards,
Hans Peter Kunz
Title: Re: Can't compress EXE generated by Embarcadero RAD Studio XE4
Post by: Jeremy Collake on October 15, 2013, 11:08:31 AM
I'm sorry I didn't see this sooner. I'll check into it as soon as I can and update here.
Title: Re: Can't compress EXE generated by Embarcadero RAD Studio XE4
Post by: BoB on November 02, 2013, 02:53:13 PM
Hi, could you please provide a simple exe compiled with same settings?  Like a Hello World program?
It would be easier to analyse the basic structure of Rad Studio XE4 files with the file provided.

Thanks,
BoB
Title: Re: Can't compress EXE generated by Embarcadero RAD Studio XE4
Post by: HPKunz on December 15, 2013, 01:26:49 PM
An Embarcadero RAD Studio XE4 "Hello world" project is now uploaded to
http://www.sked.de/PECompactHelloWorld.zip (http://www.sked.de/PECompactHelloWorld.zip)
This EXE file can be compressed with PECompact. I hope this will help you!
Kind regards,
Hans Peter Kunz
Title: Re: Can't compress EXE generated by Embarcadero RAD Studio XE4
Post by: BoB on December 15, 2013, 02:12:16 PM
Hi Hans,

Thank you for supplying the Hello World program :)

I think it is to do with Delay Imports being used, as the XE4 linker leaves blank imports when converting to Delay Imports..

If you can try compiling your exe without Delay Imports option I think it will work until PECompact is updated

Please let us know if this works (or does not work)

Have fun!
BoB
Title: Re: Can't compress EXE generated by Embarcadero RAD Studio XE4
Post by: BoB on December 15, 2013, 11:27:38 PM
Hi Hans,

It is definitely the blank imports causing the error, I made a small tool to correct the files for you  8)

http://woodmann.com/BobSoft/Files/Other/FixBlankImports.rar (http://woodmann.com/BobSoft/Files/Other/FixBlankImports.rar)

Tested with both of your supplied exes and both ran after processing and could be compressed successfully.
If you find any problems with my tool please let me know :)

Have fun!
BoB
Title: Re: Can't compress EXE generated by Embarcadero RAD Studio XE4
Post by: Jeremy Collake on December 16, 2013, 04:55:32 AM
Nice work BoB! I'll try to get this same fix into PEC soon!
Title: Re: Can't compress EXE generated by Embarcadero RAD Studio XE4
Post by: HPKunz on December 17, 2013, 12:02:15 PM
Hi BoB,

thank you! Your tool corrects the exe file and now PECompact works and the compacted exe file runs!  :)

I searched all the compiler and linker options of Embarcadero RAD Studio XE4 (the C++Builder options) but there is nothing similar to "Delay Imports" so I have to use your tool. I hope the next release of PECompact is coming soon!

Kind regards,
Hans Peter Kunz
Title: Re: Can't compress EXE generated by Embarcadero RAD Studio XE4
Post by: BoB on December 17, 2013, 12:24:08 PM
Hi Hans,

You're welcome, glad I could help! :)

I searched the Embarcadero help files and I cannot find any way to turn it off in C++, so perhaps it can not be turned off.

Happy to hear the tool works for you!  :D

Have fun!
BoB