Solved

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

Posted on 2008-06-09
10
701 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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
QRReport  TQrmemo vertical stretching 1 53
Create a path if not exists 7 92
Drag & Drop... Data from one grid to another 2 42
How to make Sign in, using Clientdataset? 1 28
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

821 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