Solved

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

Posted on 2008-06-09
10
691 Views
Last Modified: 2010-04-05
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
0
Comment
Question by:Marc582
  • 4
  • 3
10 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 21748636
Buy PE explorer
0
 

Author Comment

by:Marc582
ID: 21748648
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
 

Author Comment

by:Marc582
ID: 21799935
anyone plz?
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 21863347
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Marc582
ID: 21863361
I don't think there is need for stupid answer @ experts-exchange.com.

It's a serious site...
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 21865319
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
 

Author Comment

by:Marc582
ID: 21867623
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
 
LVL 3

Accepted Solution

by:
dundeemedia earned 500 total points
ID: 22187420
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now