Vibeeshan Mahadeva
Vibeeshan Mahadeva

Reputation: 7248

Dcu in Delphi XE2

Is the *.dcu files in delphi xe2 for firemonkey application are independent from platforms. here. for both 32bit and 64 bit and other operating systems.

If so how is the dcu files are designed. is it something similar to the previous(delphi 1-delphi xe) or something like an intermediate language(like java or .net)

is this new dcu going to make the decompilation of dcu files easier.

The main intention of this question is to know some details about the pros and cons about the new dcu files for firemonkey.

Upvotes: 1

Views: 1169

Answers (2)

Marco van de Voort
Marco van de Voort

Reputation: 26371

To make it somewhat more insightful, some background info:

DCU's are more or less a combination of the following parts

  1. The object code, which is normal statically compiled relocatable object code, just like what C or C++ would generate.
  2. debug code inclusive (a Topview variant if I'm not mistaken)
  3. A precompiled header(interface) in some form.
  4. unspecialized generics in some representation (*)
  5. cross-unit inlinable code (tree representation?)

I don't know if all these 4 are separate sections or that they are interleaved. My guess is that 1+2 are combined (since that allows more generic routines in the linker) and there is a "rest" with 3+4+5 and maybe some other metadata.

Since headers might depend on OS specific types and symbols in system unit and OS specific units, even in theory only the most self contained units could be crossplatform. Probably not worth the effort to bother.

As far as decompilation goes, it is pretty much the same as the general decompilation problem, with a few twists:

  1. not yet finally linked (object) code is slightly easier decompilable
  2. code with attached debug code is slightly easier decompilable.
  3. however the DCU format is version dependent and proprietary.
  4. the entire decompilation process is very compiler and -version dependent.

In short, it is probably not a bit easier than earlier Delphi compilers or even a static lib + header files of a random C++ compiler.

Upvotes: 3

vcldeveloper
vcldeveloper

Reputation: 7489

Is the *.dcu files in delphi xe2 for firemonkey application are independent from platforms. here. for both 32bit and 64 bit and other operating systems.

No they are not; Delphi XE2 generates different .dcu files for different platforms, and .dcu files for each platform are created in separated folders.

Upvotes: 9

Related Questions