Re: Building EXE Twice Produces Different Files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Charles,

I think I sometimes see differences with my application because of a
status bar control. It think the status bar control pulls in the latest
time and compiles that time into the exe. Same goes for the current
status of the num lock, caps locks, and insert statuses. At least I
think it does. Do you have anything similar in the app that could pull
in the current status of something? Perhaps a third party control?

Just an idea - I haven't really verified it.

Also do you have any public classes that your application exposes? Is
so, it may be creating a new clsid each time you compile. Is your
project type an Active EXE or Standard EXE under the properties?

Greg



Hi Ralph

Thanks for the reply. Yes, I am using VB6 with SP6.

I have just tried building the EXE, closing the IDE, re-opening and
building, but I get the same effect. Both files are 1,875,968 bytes long,
but the first third of the files are peppered with differences.

I am using the hex viewer in Beyond Compare to make the comparison (it
re-aligns after a difference), so I can see exactly what genuine differences
there are. In a lot of places each occasion of a difference is a group of
three bytes (occasionally four bytes). That seems to be significant to me.
Could they be addresses? Further down the file each difference is a group of
between 16 and 24 bytes.

The problem I have is that my client wants to be able to rebuild the
software to prove to himself that he has the ability to do so if I fall
under a bus. Not only does his build produce a different file from the one I
gave him, but it also produces different files every time he builds it. How
can I prove to him that the software that I tested is the same as the
software he builds each time?

Charles

"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:VrednViRR-OBsc7YnZ2dnUVZ_rKdnZ2d@xxxxxxxxxxxxxxx

"Charles Law" <blank@xxxxxxxxxxx> wrote in message
news:erMhY2$AHHA.4672@xxxxxxxxxxxxxxxxxxxxxxx
I have just built my code twice, on the same machine, with auto-increment
off (I did not change the code in any way). I also did not close the IDE
between builds, but now I have two different EXE files. If I perform a
hex
comparison on the files, they are quite different, and not just at the
start
but throughout.

How can I be sure that the executable code is the same in the two EXEs,
and
if it isn't then why isn't it?

Thanks for any insights.

Charles


Are you using VB6? (Just to make sure. <g>)

This is a common phenomenon - repeatedly compiling a VB application will
produce a file of ever increasing size. (I think the increment is around
2k)

I have heard numerous explanations, some plausible, some rather
incredulous.
MS did have an article on this subject but can't find it at the moment
(likely on the wayback machine somewhere). This perhaps indicates there is
no ONE source/cause for the increase.

The best explanation is that VB does some quick caching of metadata that
it
includes in its 'pre-processed' object files that are submitted to the C2
compiler. It doesn't remove or compare with data already written in this
cache - so this data just gets appended. Duplicate information is ignored
by
the C2 compiler, but it ends up in the finished executable.

Using a Hex editor to isolate the exact changes is difficult because as
you
noted the 'increase' appears to be distributed through-out the executable.
(Due to the absence of 'lines' once a comparison gets out of synch - it
stays out of synch.)

However, AFAIK, the differences are benign. If you shut-down the IDE, open
and recompile, the executable will be squeezed back to its original size.

hth
-ralph


.



Relevant Pages

  • Re: If APL Is So Wonderful, How Come APL Programmers Arent Rich
    ... compiled to a single EXE: ... >> Will APEX allow me to take a set of APL2 functions and produce an .EXE ... Compiler runs under APL+Win today, ...
    (comp.lang.apl)
  • Re: How to locate compiled binary code relative to source code?
    ... > I need to be able to identify in the compiled EXE a specific location ... Your best bet is assembly language. ... Have you tried having the compiler print out the assembly language ... C++ Faq: http://www.parashift.com/c++-faq-lite C Faq: http://www.eskimo.com/~scs/c-faq/top.html alt.comp.lang.learn.c-c++ faq: ...
    (comp.programming)
  • Re: VS2005, x86/x64 build questions
    ... I created a solution with Win32 and x64 platforms and an empty C++ console ... the only changes to the compiler flags are ... there's base addr differences between those built on the XP x86 box and ... The exe is for Itanium. ...
    (microsoft.public.vc.language)
  • Re: convert VB script code to vb (cheap & dirty)
    ... an exe, there are other "cheap-and-dirty" ways to do it. ... of the compiler, the runtime, your script and a little ... the compiler, the runtime and your source code into temporary ... running your vbs with wscript). ...
    (microsoft.public.scripting.vbscript)
  • Changing the .exe icon compiled stand alone applications
    ... I had a problem with changing the icon of .exe file ... generated by MCC when building a standalone application. ... is launched by MCC to configure compiler. ...
    (comp.soft-sys.matlab)