简体   繁体   English

如何查看 .dcu 是用哪个 Delphi 版本编译的?

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

If I have some .dcu files;如果我有一些 .dcu 文件; how can I find out which Delphi version they were compiled with?我怎样才能找出它们是用哪个 Delphi 版本编译的?

I received some old source code, and some .dcu files are included, and I don't have access to the original source code.我收到了一些旧的源代码,其中包含一些 .dcu 文件,但我无法访问原始源代码。 I want to refactor this library out, but for that I want to just make it compile in the original Delphi version first.我想重构这个库,但为此我只想先在原始 Delphi 版本中编译它。


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....它指出文件 X 是用“不同的”版本编译的,但没有说明 -哪个 - 版本是......

From unofficial sources, look at 4th byte of the .dcu从非官方来源,查看 .dcu 的第 4 个字节

$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.从 Delphi 2006 到 Delphi 2007,.dcu 格式没有变化。因此它们使用相同的格式。

Edit Jul 2, 2016 Added XE8, 10 and 10.1 to the list.编辑 2016 年 7 月 2 日将XE8、10 和 10.1 添加到列表中。

On request, also the target platform, which is found in the second byte of the .dcu.根据要求,还有目标平台,可在 .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.如果您认为有错误,请告诉我。

While looking for the answer, I ran into an awesome online tool by Alexei Hmelnov.在寻找答案时,我遇到了 Alexei Hmelnov 的一个很棒的在线工具。

It lets you upload a .dcu file, and it'll give you extremely detailed information about it.它允许您上传 .dcu 文件,它会为您提供非常详细的信息。

http://geos.icc.ru:8080/scripts/WWWBinV.dll http://geos.icc.ru:8080/scripts/WWWBinV.dll

It shows the compiler that was used, the compile time, used units, etc.它显示了使用的编译器、编译时间、使用的单位等。

The DCU file is a proprietary format developed at Borland (now Embarcadero) as the intermediate data between compiled code and the source code. DCU 文件是 Borland(现为 Embarcadero)开发的专有格式,作为编译代码和源代码之间的中间数据。 It is the main reason why the Delphi compiler can generate an executable so fast.这是 Delphi 编译器能够如此快速地生成可执行文件的主要原因。 Informations about this format are intentionally scarce.关于这种格式的信息是故意稀缺的。 Borland did not provide documentation about it, Embarcadero seems to follow the same path. Borland 没有提供有关它的文档,Embarcadero 似乎遵循相同的路径。 There is an utility called "DeDe" that can disassemble compiled files created by old Delphi versions and bring several informations about these, including the dcu file version.有一个名为“DeDe”的实用程序可以反汇编由旧 Delphi 版本创建的编译文件,并提供有关这些文件的一些信息,包括 dcu 文件版本。 It does not work for binaries produced by Delphi compilers newer than version 5, but the source code is included, maybe it could be improved.它不适用于比版本 5 新的 Delphi 编译器生成的二进制文件,但包含源代码,也许可以改进。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM