Discussion:
data in exe changes per compile
(too old to reply)
Peter
2007-07-26 22:09:14 UTC
Permalink
Hi,

I am moving all my 'stuff' to a new PC (PC2) and so I have BCB5 installed on
two PCs, checking if all works before I retire PC1.
I have made sure that all the same version of components are installed etc.
I built my main project again on PC2 and figured the compiled versions
created on PC1 and PC2 should be the same so I did a hex compare.
They were different ... ouch ... (PS both compiled for 'release')
I have been looking, searching and spent considerable time trying to figure
out what the problem is as I don't like it that one project, using identical
compilers (and settings), yields to different exes.
Then I compared two builds built on the same system. Built a version, moved
it to a different folder, build a version again and then compared the two.
They are different too and different on the same locations as with the
version built on PC2.
That more or less put me at ease, as it seems this is not that strange.

However, I would like to find out *if* it is normal and what the reason
might be ?

Differences seems to be in the beginning (about 6 bytes further than 'PE')
Each time one byte at different locations (6, 7 occurances).
And then a larger chunk towards the end although it looks like again one or
two bytes different, but they happen to be in that chunk in large numbers,
so the hex editor sees a larger chunk as different.

Your expertise appreciated.
Remy Lebeau (TeamB)
2007-07-26 23:11:38 UTC
Permalink
Post by Peter
I built my main project again on PC2 and figured the
compiled versions created on PC1 and PC2 should
be the same so I did a hex compare. They were different
Executables are rarely ever the same between compiles. Even if you compile
and then immediately compile again on the same machine, there will likely be
slight differences, as you have already discovered.
Post by Peter
I have been looking, searching and spent considerable
time trying to figure out what the problem is
There is no problem. This is how things are supposed to work.
Post by Peter
I don't like it that one project, using identical compilers
(and settings), yields to different exes.
You haven't been comparing your executables all along, so why worry about it
now? There is no need to worry.
Post by Peter
Then I compared two builds built on the same system. Built a
version, moved it to a different folder, build a version again and
then compared the two. They are different too and different
on the same locations as with the version built on PC2.
They are supposed to be.
Post by Peter
However, I would like to find out *if* it is normal
It is completely normal.
Post by Peter
Differences seems to be in the beginning (about 6 bytes further
than 'PE') Each time one byte at different locations (6, 7
occurances). And then a larger chunk towards the end although
it looks like again one or two bytes different, but they happen
to be in that chunk in large numbers, so the hex editor sees a
larger chunk as different.
If you read the documentation for the PE format, you will find out what
those bytes coorespond to:

An In-Depth Look into the Win32 Portable Executable File Format
http://msdn.microsoft.com/msdnmag/issues/02/02/PE/


Gambit
Peter
2007-07-27 00:03:29 UTC
Permalink
Post by Remy Lebeau (TeamB)
Post by Peter
However, I would like to find out *if* it is normal
It is completely normal.
Thanks for the feedback !

Continue reading on narkive:
Loading...