Function Comparison Window

The Function Comparison window can provide different types of panels for visually comparing two or more functions. The Listing View of the Function Comparison window and its capabilities is explained below.

Compare Selected Functions

A Function Comparison window can be displayed from a selection containing two or more functions in the CodeBrowser listing.

  1. In the CodeBrowser Listing make a selection containing two or more functions that you want to compare.
  2. Right mouse click and select the Compare Selected Functions... option on the right mouse popup menu.

A Function Comparison window will appear.





This window can have multiple tabs, one for each type of function comparison view that is available.

Listing View

The Listing View shows a pair of listings side by side so the functions can be compared. The highlights in the two listings indicate where there are possible differences in the bytes and instructions between the functions. The background highlights that have a default color of gray are where bytes or instructions differ wherever the instructions could be matched up between the two functions. The code units with white background also have a matching code unit in the other function but do not have any differences based on the current difference settings. Any instructions that couldn't be automatically matched up are highlighted with a default background color of blue. The detailed differences with a default background color of light green within the gray difference code units indicates individual bytes and parts of instructions that differ between a code unit in one function and its matching code unit in the other function using the current difference settings.

The user can change these colors from the Properties action in the popup menu of the Listing View or from the Listing Code Comparison entry in the Tool Options.



Indicator Default Color Description
Unmatched Code Units   Highlights where the code from one listing didn't get matched up with code from the other listing.
Differing Code Units   Highlights where matched code units have one or more detailed differences currently being detected.
Byte Differences   Highlights bytes that differ between matched code units in the two listings. A toolbar action toggles whether or not these are being detected.
Mnemonic Differences   Highlights mnemonics that are different between matched code units in the two listings.
Operand Differences   Highlights operands that are different between matched code units in the two listings. Toolbar actions toggle whether or not these are being detected for constants or registers.


If you move the cursor within one of the listings, if possible it will move the cursor to the matching location in the other listing. Scrolling one listing will scroll the other. The two listings are locked together for scrolling at the code unit where the cursor last had a matching code unit in the other listing. In other words as the cursor moves within the code units that have white and gray backgrounds, the cursor in the other listing will also move to the matching code unit. When the cursor moves into a code unit that is unmatched (with a default blue background), the cursor in the other listing will not move since it doesn't have a matching code unit.

Cursor Arrow

The left side margin of each listing can display a cursor arrow that indicates the code unit with the current cursor location. In the active side of the dual listing, the cursor arrow will always display to indicate the current cursor location. The inactive side of the dual listing will also show the cursor arrow whenever its matching location was able to be determined. If the active side's cursor location is on an unmatched code unit then the other side's cursor arrow will not appear.

Whenever the cursor arrow appears and there isn't already another background color, the code unit background will be highlighted light blue to help you determine where the red location cursor is located in the listing. If the cursor is on a code unit with an indicated difference or an unmatched instruction then that associated background color will take priority and will display instead of the light blue highlight.

Listing Layout Actions

There are actions in the toolbar that control the layout of the two listings in the Listing View. One controls the orientation of the two listings relative to each other. Another displays the header for adjusting the field sizes and positions in the listing.

Toggle Format Header

The two listings which display each of the functions can show numerous fields and those fields can be sized and positioned relative to each other in the way a user desires. The display fields can be changed from the Field Header in the same way they can be adjusted in the CodeBrowser. To change the fields in the listing,

  1. Select the menu icon on the far right end of the toolbar.
  2. From the menu that is displayed choose Toggle Format Header.

This will display the Field Header above the left Listing. For more information on how to manipulate the fields, see the help for the Code Browser Header.

Show Listings Side-by-Side

The two listings which display each of the functions can be displayed side by side or one above the other. To change how the two listings are positioned relative to each other,

  1. Select the menu icon on the far right end of the toolbar.
  2. From the menu that is displayed choose Show Listings Side-by-Side.

This switches the layout of the two panels for the functions from side-by-side (left and right) to one above the other (top and bottom). Each time you select this option, the layout will switch between these two layouts.

Navigating Differences

There are actions in the toolbar that allow you to navigate to the next or previous difference block (default gray background) or unmatched code unit block (default blue background). There is also a choice icon that indicates whether you want to navigate to the unmatched code unit blocks, the difference blocks, or both types of blocks.

There is a pink border around one of the two listings to indicate which of the two side's blocks are being navigated.

Next/Previous Area Marker

The Next/Previous Area Marker allows the user to choose the type of highlighted areas that you go to when navigating.

The Function Comparison window has a navigation choice icon with a small triangle to the right of it on the tool bar. This lets you choose which type of highlighted areas (blocks) you want the next/previous area navigation to go to in the listing window. The following list indicates the setting to choose for navigation to the various types of highlighted areas.

  •  Both - Navigates to the next/previous highlight area whether it is an unmatched code unit block or a difference block.
  •  Unmatched Code Units - Navigates between unmatched code unit blocks.
  •  Differences - Navigates between difference blocks.

Go To Next Highlighted Area

The Listing View provides an icon () on the tool bar to go to the next highlighted area in the listing window.

  • Right mouse click and select the Go To Next Highlighted Area option, OR select the button on the tool bar.

If there is another highlighted area to go to then the location cursor will move to that highlighted block. If there aren't any more highlighted areas below the current location, a message is displayed in the tool's status area to indicate this.

The Next/Previous Area Marker allows the user to choose the type of highlighted areas that you go to when navigating.

Go To Previous Highlighted Area

The Listing View provides an icon () on the tool bar to go to the previous highlighted area in the listing window.

  • Right mouse click and select the Go To Previous Highlighted Area option, OR select the button on the tool bar.

If there is another highlighted area to go to then the location cursor will move to that highlighted block. If there aren't any more highlighted areas above the current location, a message is displayed in the tool's status area to indicate this.

The Next/Previous Area Marker allows the user to choose the type of highlighted areas that you go to when navigating.

Difference Settings

There are several actions in the toolbar that control the highlighting of code unit differences between the functions in the two listings. More specifically, byte and instruction differences. Each of the action descriptions that follows explains how that action affects the difference highlighting in the listings.

Ignore Bytes

The ListingView has an icon () on the tool bar to ignore byte differences in the listing window. Selecting the toolbar button causes byte differences to be ignored within the two listings. In other words, they won't be highlighted. When ignoring byte differences the toolbar icon will look as though it is pressed inward and will have a in the upper left corner.

When byte differences are being displayed, do the following to now ignore bytes in the differences.

  1. Right mouse click and select the Ignore Bytes As Differences option, OR select the button on the tool bar.
  2. A will be in the upper left corner indicating bytes are now being ignored and a check mark will now appear next to the Ignore Bytes popup menu option. Any byte differences will no longer be highlighted with a light green background in the listing.

Clicking the Ignore Bytes while it is ignoring byte differences will change it back to determining byte differences.

Ignore Operand Constants

The Listing View has an icon () on the tool bar to ignore differences in operand constants when comparing instructions in the listing window. Selecting the toolbar button causes differences in operand constants to be ignored within the two listings. In other words, they won't be highlighted. When ignoring differences in constants the toolbar icon will look as though it is pressed inward and will have a in the upper left corner.

When operand constants differences are being displayed, do the following to now ignore operand constants differences when comparing instructions.

  1. Right mouse click and select the Ignore Operand Constants As Differences option, OR select the button on the tool bar.
  2. A will be in the upper left corner indicating operand constants are now being ignored and a check mark will now appear next to the Ignore Operand Constants popup menu option. Any differences of operand constants will no longer be highlighted with a light green background in the listing.

Clicking the Ignore Operand Constants while it is ignoring differences of operand constants will change it back to determining differences of operand constants.

Ignore Operand Registers

The Listing View has an icon () on the tool bar to ignore differences in operand registers other than register size when comparing instructions in the listing window. Selecting the toolbar button causes differences in operand registers other than size to be ignored within the two listings. In other words, they won't be highlighted. When ignoring differences in registers the toolbar icon will look as though it is pressed inward and will have a in the upper left corner.

When operand register differences are being displayed, do the following to now ignore operand register differences when comparing instructions.

  1. Right mouse click and select the Ignore Operand Registers As Differences option, OR select the button on the tool bar.
  2. A will be in the upper left corner indicating operand registers are now being ignored and a check mark will now appear next to the Ignore Operand Registers popup menu option. Any differences of operand registers will no longer be highlighted with a light green background in the listing.

Clicking the Ignore Operand Registers while it is ignoring differences of operand registers will change it back to determining differences of operand registers.

Listing Code Comparison Options

These are the tool options that can be adjusted for the dual listing view of a Function Comparison.




The Byte Differences Color option sets the highlight color for bytes that differ between matched code units in the two listings.

The Differing Code Units Color option sets the background highlight color of matched code units with one or more detailed differences currently being detected.

The Mnemonic Differences Color option sets the highlight color for mnemonics that differ between matched code units in the two listings.

The Operand Differences Color option sets the highlight color for operands that differ between matched code units in the two listings.

The Unmatched Code Units Color option sets the background highlight color where the code from one listing didn't get matched up with code from the other listing.


Comparing Multiple Functions

When comparing more than two functions, a Function Comparison window will have additional components at the top of it. This window displays two functions side by side again, but has two choice components at the top of the panel, which indicates the current function being displayed in each side (left and right) of the panel. Each choice component can display a list indicating the functions that can be displayed in the listing below it. Only one function at a a time from the list can be displayed below it based on the type of view currently set. You can simply change the current function for either side of the function comparison using the choice component in order to get a different function comparison.

There are two toolbar actions with quick keys that allow you to change to the next/previous function for the side that has focus as indicated by the pink border.





Multi-Function Comparison Actions

There are two additional actions that are available when you are comparing more than just two functions. The following describes them.

Compare The Next Function

The Function Comparison window has an icon () on the tool bar to change the function being compared to the next one in the list for the side that currently has focus.

  1. Make sure the side (left or right) has focus for the function you want to change to the next one. The side with focus will have the pink border around it. It if doesn't, you can mouse click in the other side to get the focused side to change or you can use the Tab key to move the focus until it moves the pink border around the correct side.
  2. Right mouse click and select the Compare The Next Function option, OR select the button on the tool bar.

The function should change to the next one available in the list from the choice component. The differences will be recomputed for the new function comparison that is now displayed. If the currently displayed function is at the end of the list, a message will display in the tool's status area indicating there isn't a next function.

Compare The Previous Function

The Function Comparison window has an icon () on the tool bar to change the function being compared to the previous one in the list for the side that currently has focus.

  1. Make sure the side (left or right) has focus for the function you want to change to the previous one. The side with focus will have the pink border around it. It if doesn't, you can mouse click in the other side to get the focused side to change or you can use the Tab key to move the focus until it moves the pink border around the correct side.
  2. Right mouse click and select the Compare The Previous Function option, OR select the button on the tool bar.

The function should change to the previous one available in the list from the choice component. The differences will be recomputed for the new function comparison that is now displayed. If the currently displayed function is at the beginning of the list, a message will display in the tool's status area indicating there isn't a previous function.

Other Function Comparison Actions

The following are additional actions that are available in the Function Comparison window.

Toggle Mouse Hover Popups

If you hover the mouse over a reference in either listing A popup window will appear showing a listing at the part of the program being referenced. You can also hover over a field in the listing that contains truncated text, which will show you the entire text in a popup. You can turn the hover popup windows off using the mouse hover button in the toolbar.

  1. Selecting the button in the toolbar will turn mouse hover popups off and the icon will switch to a .
  2. Selecting the button in the toolbar will turn mouse hover popups back on and the icon will switch to a .

Synchronize Scrolling of Dual View

If the button is showing in the toolbar then the dual listing or dual decompiler will synchronize scrolling of the left and right function in their views. Scrolling or moving the cursor in one side will cause the location in the other side to also scroll or move if a matching location can be determined.

When the button is showing in the toolbar the left and right sides of the dual listing or dual decompiler will scroll independent of the other side.

  1. Selecting the button in the toolbar will turn synchronized scrolling of the dual views off and the icon will switch to a .
  2. Selecting the button in the toolbar will turn synchronized scrolling of the dual views back on and the icon will switch to a .

Apply Function Signature To Other Side

The Apply Function Signature To Other Side action is available in the Function Comparison window from the popup menu. This will apply the function signature from the side of the panel that has focus (the one with the pink border around it) to the function in the other side.

When you apply the signature it updates the other side's function so its signature will match the function's signature in the side with focus as closely as possible. This will try to create conflict names if necessary for the function and its parameters.

To apply the signature from one function to the other:

  1. Right mouse click in the side of the Function Comparison Window that has the function signature that you want to apply.
  2. Choose the Apply Function Signature To Other Side option from the menu.

The function signature in the non-focused side of the Function Comparison window should update if the apply succeeded.



Provided By:  FunctionComparisonPlugin

Related Topics: