Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see which Delphi version a .dcu was compiled with?

Tags:

delphi

dcu

If I have some .dcu files; how can I find out which Delphi version they were compiled with?

I received some old source code, and some .dcu files are included, and I don't have access to the original source code. I want to refactor this library out, but for that I want to just make it compile in the original Delphi version first.


By the way, the compiler could be a bit more helpful here. It states that file X was compiled with a "different" version, without saying -which- version that is....

like image 645
Wouter van Nifterick Avatar asked Feb 19 '15 22:02

Wouter van Nifterick


People also ask

What is DCU file in Delphi?

A Delphi compiled unit file is an intermediate compiler output file produced from the source code of each unit in your project. Delphi compiled unit files enable rapid compiling and linking. You can link a Delphi project to Delphi compiled unit files for any of the supported target platforms.

How to add DCU file in Delphi?

In Delphi 3.0, select the "Component" menu, "Install Component", >hit the "Browse" button, and change the "File of Type" to . DCU.


1 Answers

From unofficial sources, look at 4th byte of the .dcu

$0F = Delphi 7
$11 = Delphi 2005
$12 = Delphi 2006 or 2007
$14 = Delphi 2009
$15 = Delphi 2010
$16 = Delphi XE
$17 = Delphi XE2
$18 = Delphi XE3
$19 = Delphi XE4
$1A = Delphi XE5
$1B = Delphi XE6
$1C = Delphi XE7
$1D = Delphi XE8
$1E = Delphi 10 Seattle
$1F = Delphi 10.1 Berlin
$20 = Delphi 10.2
$21 = Delphi 10.3
$22 = Delphi 10.4

There was no change in .dcu format going from Delphi 2006 to Delphi 2007. Therefore they use the same.

Edit Jul 2, 2016 Added XE8, 10 and 10.1 to the list.

On request, also the target platform, which is found in the second byte of the .dcu. Values are of course valid only for versions that have these targets.

$03 = Win32
$23 = Win64
$04 = Osx32
$14 = iOS emulator
$76 = iOS device
$77 = Android

Let me know if you think there's an error.

like image 82
Tom Brunberg Avatar answered Oct 27 '22 05:10

Tom Brunberg