Solved

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

Posted on 2008-06-09
10
706 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to center only a line in richedit? 4 77
Delphi Form ownership 4 154
Delphi: Connect to running MS Outlook 4 202
Firemonkey how to swip panel with finger tap 1 40
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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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