How to Remove/Strip Debug Info of a compiled exe? (Delphi)

Hi all,

How to Remove/Strip Debug Info of an exe in Delphi?

NOTE that I know how to remove the debug info of my project, what I want to do is to be able to remove/strip debug info of any compiled exe.

here a program that do exactly what I want: Pe Explorer (http://www.heaventools.com/remove-debug-information.htm)

500 points for this one,

thanx in advance
Marc582Asked:
Who is Participating?
 
dundeemediaConnect With a Mentor Commented:
I don't have code, but it should be easy enough to write if you know about streams etc in delphi.

First, download the PE specification - http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx

Just load the PE file as a stream, then browse the IMAGE_OPTIONAL_HEADER - at the end of this is the data directory, which is an array of _IMAGE_DATA_DIRECTORY.

The 7th item IMAGE_DIRECTORY_ENTRY_DEBUG contains the location and size of the debug directory. The debug directory is an array of _IMAGE_DEBUG_DIRECTORY which contains information about the debug data, and the address and size of this data. THis means that a PE file can contain multiple debug data!

To strip it, you could zero out the debug data, yet leave the debug directory entries where they are.
0
 
Geert GOracle dbaCommented:
Buy PE explorer
0
 
Marc582Author Commented:
thx but I already have it, maybe you should guess that if I post under Delphi section, that means I want the code to do that.

anyway, thx for the try
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
Marc582Author Commented:
anyone plz?
0
 
Geert GOracle dbaCommented:
get the source code from
http://www.heaventools.com

if it's too expensive there is an other way ...
apply for a programming job there.
copy the code
quit
0
 
Marc582Author Commented:
I don't think there is need for stupid answer @ experts-exchange.com.

It's a serious site...
0
 
Geert GOracle dbaCommented:
seriously ?
answer = impossible
unless you recompile without debug info

>>what I want to do is to be able to remove/strip debug info of any compiled exe.
even at heaventools they state this is not possible for "any" compiled exe.

if it would be that easy it wouldn't have taken this long to create decompile tools
and they still don't work properly for everything

0
 
Marc582Author Commented:
nan not all, debug info are a section of the pe header, we can remove this section cuz its useless, pe explorer doesnt decompile the exe to remove that.....

plz stop talking about things you don't know...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.