Rebuilding dll without any changes and binary differences

  • Thread starter Thread starter Peri
  • Start date Start date
P

Peri

I build dll and change it's name.
Than I build it again without any changes (neither in code nor dll
version).
Than I run binary compare on this two dll's and they differ. Why?
 
Peri said:
I build dll and change it's name.
Than I build it again without any changes (neither in code nor dll
version).
Than I run binary compare on this two dll's and they differ. Why?

DLLs contain a timestamp in the PE header. Also, the default
wizard-generated AssemblyInfo contains a FileVersionAttribute that
automatically generates a new file verion every time it's built.

-cd
 
DLLs contain a timestamp in the PE header. Also, the default
wizard-generated AssemblyInfo contains a FileVersionAttribute that
automatically generates a new file verion every time it's built.

-cd

Do You mean this?
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

VS 2005 doesn't set Versions to 1.0.* by default like VS 2003 did. So the
version doesn't change on every build.

So what's the way to determine if dll was just rebuild without any changes
in code? After I build solution I want to determine which dll's really
changed to include them in application update. Only theese dll's and
nothing more. Maybe I would be able to skip PE header and start binary
compare from byte after it? But is PE header always the same size?
 
Peri said:
So what's the way to determine if dll was just rebuild without any
changes in code? After I build solution I want to determine which
dll's really changed to include them in application update. Only
theese dll's and nothing more. Maybe I would be able to skip PE
header and start binary compare from byte after it? But is PE header
always the same size?

You can always binary compare the files and ignore differences in the PE
header. While the overall size of the PE header may change from one build
to another (if another section was added, for example), the part of the PE
header that contains the date state will always be in the same place between
DLLs built with the same toolset.

-cd
 
Back
Top