Bindiff Examples

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

BinDiff Examples

Example 1: Compare Two Versions of a File

You have two versions of the file dcpromo.dll, and you want to see if there are any differences between the two files. Using BinDiff with no parameters other than FileSpec1 and FileSpec2 performs a basic compare. To check for different versions of dcpromo.dll, type the following at the command line:

bindiff \\heapsort\htmdrop\binold\dcpromo.dll \\heapsort\htmdrop\binnew\dcpromo.dll

Press Enter . The following output is displayed:

Different, Right is newer

In this case, the two versions are different: the second file (the one specified on the right) (\\heapsort\htmdrop\binnew\dcpromo.dll) is newer than the first file.

Example 2: Compare Two Versions of a File But Eliminate Version and Time Stamp Differences

You have two versions of a file that you want to compare, and you want to make sure that versioning and time stamp information are not the only differences between the two files. To compare the two files while ignoring versioning and time stamp information, type the following at the command line:

bindiff /v \\heapsort\htmdrop\binold\dcpromo.dll \\heapsort\htmdrop\binnew\dcpromo.dll

Press Enter. The following output is displayed:

Different, Right is newer

In this case, the two versions are different and the second file (the file on the right) (\\heapsort\htmdrop\binnew\dcpromo.dll) is newer than the first file (the file on the left). Versioning and time stamp information are not the only differences between the two files. If this were the case, the files would be listed as Near Identical.

Example 3: Compare Differing Byte Counts for Two Versions of a File

You have two versions of a file that you know differ, but you want to see how different they really are. To compare the two files and get a differing byte count, type the following at the command line:

bindiff /c \\heapsort\htmdrop\binold\dcpromo.dll \\heapsort\htmdrop\binnew\dcpromo.dll

Press Enter. The following output is displayed:

Different, Right is newer  16,294 bytes differ

File Count Summary
   Identical:      0 files
   Near Identical: 0 files
   Different:      1 files
   Left Only:      0 files
   Right Only:     0 files
   Errors:         0 files
   Total:          1 files

Byte Count Summary
   Matched:    16,294 bytes differ
   Left Only:       0 bytes
   Right Only:      0 bytes
   Total:      16,294 bytes

Both versions of the file are 29 KB, and 16 KB of code differs between the two files . The 16 KB difference results from deleting code in the original file, then adding code back in.

Example 4: Compare Files in Two Directories

You want to compare the files in one build folder to those in another folder. To compare the files in the two directories, discounting any differences due to versioning and time stamp information, type the following at the command line:

bindiff /s /v \\heapsort\htmdrop\binold \\heapsort\htmdrop\binnew

Press Enter. The following output is displayed:

appsec.dll   Right-only File
appsec.exe   Right-only File
APPSEC.HLP   Right-only File
dcpromo.csv  Identical
dcpromo.dll  Different, Right is newer
dcpromo.exe  Different, Right is newer

In this case, three files have been added to the new build directory (in ...\BinNew). One file, (dcpromo.csv), is unchanged between builds, and two files, (dcpromo.dll and dcpromo.exe), have had changes in addition to versioning and timestamp changes made.

See Also

Concepts

Bindiff Overview
Bindiff Remarks
Bindiff Syntax
Alphabetical List of Tools
Iasparse Overview