Can't compress EXE generated by Embarcadero RAD Studio XE4

Started by HPKunz, October 01, 2013, 05:43:12 PM

Previous topic - Next topic

HPKunz

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
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

Jeremy Collake

I'm sorry I didn't see this sooner. I'll check into it as soon as I can and update here.
Software Engineer. Bitsum LLC.

BoB

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

HPKunz

An Embarcadero RAD Studio XE4 "Hello world" project is now uploaded to
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

BoB

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

BoB

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

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

Jeremy Collake

Nice work BoB! I'll try to get this same fix into PEC soon!
Software Engineer. Bitsum LLC.

HPKunz

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

BoB

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