delphi .dcu file format

Posted on 1998-10-07
Last Modified: 2008-03-06
Need to know delphi .dcu file format
Question by:laolin

Expert Comment

ID: 1342102

The dcu file format has not been released by Inprise (BORLAND) as it (they say) is always changing, I think that they can't release the format as then shareware components etc would not really work as you could decompile the .dcu back to .pas format...this is just on instance of the file format not been released...



Expert Comment

ID: 1342103
i also don't think, there is no description avaiable, Borland haven't even released the former
TPU-Format in Turbo PAscal

Expert Comment

ID: 1342104
the delphi compiler can generate .obj files instead of .dcu file (go to project options | linker | output object files). i think the .obj file format is described rather good.
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

LVL 10

Expert Comment

ID: 1342105
DCU is a simple Delphi unit that has been compiled and I guess it's a resource file.. Noe exactly sure, but there is nothing wrong with a simplew guess, is it???


Expert Comment

ID: 1342106
viktor, dcu's are not resource files. i tried to load them with the resource editor of visual studio, and it didn't recognize the files as resource binaries. in my opinion, dcu's are similar to obj's and just have a different format.
LVL 10

Expert Comment

ID: 1342107
yeah. maybe your are right....

LVL 12

Accepted Solution

rwilson032697 earned 200 total points
ID: 1342108

DCU files are similar to OBJ files in that they are the machine code version of the source code for a unit. DCU files are then run through the linker to produce the final .EXE.

Borland/Inprise have never released the format of TPU/DCU files, mainly to preserve their ability to change it when they need to. With a lot of effort you could reverse engineer it but I can't think of an example where it would be worth it (and you still have the problem with the decompiled code I mention below).

OBJ files are a standard object file format and are described in the Microsoft literature.

Basically if you need to decompile a DCU/OBJ it's for one of two reasons. (1) You are trying to crack some software or (2) You have lost the source. If (1) thats not ethical :-), if (2) bad luck - even if you could decompile it the resulting code would not look anything like the original code (especially if optimization as enabled) and would be a worse result than rewriting the code.




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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

840 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