HOWTO: Comparing Binary Images of Same Project BuildsLast reviewed: October 9, 1997Article ID: Q164151 |
The information in this article applies to:
SUMMARYSometimes you may need to compare the build images (EXE, DLL, etc.) of the same project that were built at different times. Since the images contain time and date stamps, a plain file compare reports the differences between the images. You can use the DUMPBIN utility to generate the correct file compare.
MORE INFORMATIONThe time and date stamps can be removed from the built image without removing relevant information (code and data) using the /RAWDATA switch available in the DUMPBIN utility. Any file compare utility can then be used on the DUMPBIN output as follows:
DUMPBIN /RAWDATA MyApp.EXE > first.txtIf Myapp.exe is built again at a different time, then use DUMPBIN as follows:
DUMPBIN /RAWDATA MyApp.EXE > second.txtYou can now compare first.txt and second.txt using a file compare utility like:
FC /B first.txt second.txtRun DUMPBIN in the resident directory of the image. The above procedure applies to the Release build only because the Debug build records the time and date stamp on the images (irrespective of /Zi or /Z7) and DUMPBIN does not remove this information. If the predefined macros __DATE__ and __TIME__ are used in the source, the time and date stamp recorded in the images will not be removed by DUMPBIN for the Release build. Under these circumstances, you may use the /DISASM switch. However, the /DISASM switch removes the time and date stamp, as well as the initialized data. This means that you will not get a true image compare. NOTE: There is no guarantee that Visual C++ will generate the same binary image when building the same source files on successive builds. However, you are guaranteed that the EXE (or DLL) will behave in precisely the same manner under execution, all other things being equal. Compile and link options and link order play a role in whether two binary images will compare equally. If you follow the procedures outlined above and the two images compare equally, then the images are the same. If the two images do not compare equally, then there is still uncertainty as to whether the images are the same or not.
|
Additional query words: DUMPBIN RAWDATA
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |