Determine whether .NET assemblies were built from the same source

前端 未结 7 1132
独厮守ぢ
独厮守ぢ 2020-12-02 17:38

Does anyone know of a way to compare two .NET assemblies to determine whether they were built from the \"same\" source files?

I am aware that there are some differen

7条回答
  •  广开言路
    2020-12-02 17:58

    I have used the solution of Jerry Currry on .Net 4 assemblies and found out that there is now a third item that will vary on each build: Checksum. Isn't it surprising to find a checksum inside an assembly? I think that adding the checksum of a file inside that file will change the checksum...

    Anyway, the modified command is:

    ildasm /all /text "assembly.dll"
    | find /v "// Time-date stamp:"
    | find /v "// MVID:"
    | find /v "// Checksum:"
    > assembly.dasm
    

    Note that I have also changed the search strings a bit by adding the slashes, in order to avoid unintentional matches. The lines of this command should be run together on the same line, split for readability. File names will need double quotes around them if they contain spaces.

提交回复
热议问题