Package ghidra.program.util

# Interface AddressCorrelator

All Known Subinterfaces:
  `DiscoverableAddressCorrelator`

public interface AddressCorrelator
Interface for address correlation algorithms that can generate an address mapping from one set of program addresses to another.

This interface supplies a `priority` of `DEFAULT_PRIORITY`. `discoverable` correlators can change this priority to be a lower value to be run before the supplied system correlators. Generally, the more specific or restrictive a correlator, the earlier (higher priority) it should be.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_PRIORITY`
  The default priority.
  `static final int`
  `EARLY_PRIORITY`
  A high priority (low number value) for correlators that should used before other correlators
  `static final int`
  `LATE_CHANCE_PRIORITY`
  A low priority (high number value) for correlators that should used after other correlators
  `static final int`
  `PRIORITY_OFFSET`
  A value used to raise or lower priorities.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AddressCorrelation`
  `correlate(Data sourceData, Data destinationData)`
  Returns an address mapping from one piece of data to another.
  `AddressCorrelation`
  `correlate(Function sourceFunction, Function destinationFunction)`
  Returns an address mapping from one function to another.
  `Options`
  `getDefaultOptions()`
  Returns the options with the default settings for this correlator.
  `ToolOptions`
  `getOptions()`
  Returns the current Option settings for this correlator.
  `default int`
  `getPriority()`
  Returns a number based on an arbitrary number scheme that dictates the order that correlators should be used.
  `void`
  `setOptions(ToolOptions options)`
  Sets the options to use for this correlator.

- ## Field Details

  - ### DEFAULT_PRIORITY

    static final int DEFAULT_PRIORITY
    The default priority. This applies to client-supplied `DiscoverableAddressCorrelator`s
    See Also:
      - Constant Field Values

  - ### EARLY_PRIORITY

    static final int EARLY_PRIORITY
    A high priority (low number value) for correlators that should used before other correlators
    See Also:
      - Constant Field Values

  - ### LATE_CHANCE_PRIORITY

    static final int LATE_CHANCE_PRIORITY
    A low priority (high number value) for correlators that should used after other correlators
    See Also:
      - Constant Field Values

  - ### PRIORITY_OFFSET

    static final int PRIORITY_OFFSET
    A value used to raise or lower priorities.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### correlate

    AddressCorrelation correlate(Function sourceFunction, Function destinationFunction)
    Returns an address mapping from one function to another.
    Parameters:
      `sourceFunction` - the source function.
      `destinationFunction` - the destination function.
    Returns:
      an AddressCorrelation that represents a mapping of the addresses from the source function to the destination function.

  - ### correlate

    AddressCorrelation correlate(Data sourceData, Data destinationData)
    Returns an address mapping from one piece of data to another.
    Parameters:
      `sourceData` - the source data.
      `destinationData` - the destination data.
    Returns:
      an AddressCorrelation that represents a mapping of the addresses from the source data to the destination data.

  - ### getOptions

    ToolOptions getOptions()
    Returns the current Option settings for this correlator.
    Returns:
      the current Option settings for this correlator.

  - ### setOptions

    void setOptions(ToolOptions options)
    Sets the options to use for this correlator.
    Parameters:
      `options` - the options to use for this correlator.

  - ### getDefaultOptions

    Options getDefaultOptions()
    Returns the options with the default settings for this correlator.
    Returns:
      the options with the default settings for this correlator.

  - ### getPriority

    default int getPriority()
    Returns a number based on an arbitrary number scheme that dictates the order that correlators should be used. If a correlator returns a null value from one of the `correlate()` methods, then the next highest priority correlator will be called, and so on until a non-null correlation is found or all correlators have been called.

    A lower number value is a higher priority. See `DEFAULT_PRIORITY`.

    Returns:
      the priority