编译两次与Delphi 6和获得相同的校验和二进制 [英] Compiling Twice with Delphi 6 and getting the same checksum on the binary

查看:284
本文介绍了编译两次与Delphi 6和获得相同的校验和二进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了二进制/源代码验证的目的,我想能够在同一台计算机上两个编译器分开两个星期,并且二进制文件是相同的,因此通过一些校验和测试。

For the purposes of binary / source code verification, i'd like to be able to make two compiles on the same computer 2 weeks apart and have the binaries be identical and thus pass some checksum test.

到目前为止,我发现很可能时间戳将被编译器写入二进制。我可以通过对这个msdn文章的dumpbin / rawdata结果进行比较来解决这个问题。

So far I've found that most likely the timestamp will be written by the compiler into the binary. I can work around this by doing the compare on the dumpbin /rawdata results per this msdn article.

http://support.microsoft.com/kb/164151

但是dumpbin的结果仍然不同一个大约十几个地方,差异仍然是某种时间戳(例如从A1 73到C4 76)。

However the dumpbin results still differ in a about a dozen places and the difference still appears to be some kind of timestamp (changing from A1 73 to C4 76) for example.

我假设这是时间戳delphi编译器是放在代码/数据部分,但我不能找到这里发生或如何关闭它。充斥着各种编译器/链接器选项并没有改变这种行为。

I assume this is the timestamp that the delphi compiler is putting into the code/data sections but i can't find where this is happening or how to turn it off. Fiddling with the various compiler/linker options has not changed this behavior.

任何帮助将非常感激。

推荐答案

我们在几年前研究了这个问题,我回忆说,Borland / Codegear / Embarcadero的人并不认为编译器应该准确地生成相同的输出给定完全相同的输入(假定当前日期时间不能被接受作为输入)。

We researched this question a few years ago, and as I recall the answer was simply that the people at Borland/Codegear/Embarcadero do not subscribe to the notion that the compiler should produce exactly the same output given exactly the same input (given that the current date-time is not acceptable to consider as input).

这是令人失望的,但鉴于Delphi是upmteen主要版本旧,它可能不会改变。

This is disappointing, but given that Delphi is upmteen major versions old, it probably will not change.

这篇关于编译两次与Delphi 6和获得相同的校验和二进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆