public interface

ILabelManager

com.pnfsoftware.jeb.core.units.code.asm.analyzer.ILabelManager

Class Overview

Definition of a code label manager. Labels are strings associated to a memory address.

Summary

Public Methods
abstract Collection<String> getAlternateLabels(long address)
Get the alternate labels set at the provided address.
abstract String getLabel(long address, long addressDelta, AutoLabelPolicy policy)
Retrieve the label at a given memory address.
abstract String getLabel(INativeMemoryItem item, long addressDelta, AutoLabelPolicy policy)
Retrieve the label at the address of the provided memory item.
abstract Map<Long, String> getPrimaryLabels()
Retrieve a copy of the primary labels map.
abstract boolean isLegalLabel(String label)
Verify if the provided string is a legal label.
abstract boolean isLegalLabel(String label, Long address, StringBuilder legalized)
Verify if the provided string is a legal label when used at the provided address.
abstract boolean removeLabel(long address)
Remove all the labels associated to the given address.
abstract Long resolveLabel(String label)
Determine the memory address associated with the provided label.
abstract boolean setLabel(long address, String label, boolean allowAdjusting, boolean allowAlternates, boolean mustBePrimary)
Attach a label at a given address.

Public Methods

public abstract Collection<String> getAlternateLabels (long address)

Get the alternate labels set at the provided address. The primary label is not provided.

Returns
  • a collection of labels, potentially null (never empty)

public abstract String getLabel (long address, long addressDelta, AutoLabelPolicy policy)

Retrieve the label at a given memory address.

Parameters
policy determine whether a label should be -created and- returned if none was set
Returns
  • a label or null

public abstract String getLabel (INativeMemoryItem item, long addressDelta, AutoLabelPolicy policy)

Retrieve the label at the address of the provided memory item.

Parameters
policy determine whether a label should be -created and- returned if none was set
Returns
  • a label or null

public abstract Map<Long, String> getPrimaryLabels ()

Retrieve a copy of the primary labels map.

public abstract boolean isLegalLabel (String label)

Verify if the provided string is a legal label. Same as #isLegalLabel(String, Long) isLegalLabel(label, null).

Parameters
label non-null label to be tested

public abstract boolean isLegalLabel (String label, Long address, StringBuilder legalized)

Verify if the provided string is a legal label when used at the provided address.

Parameters
label non-null label to be tested
address optional address, null if none
legalized optional output buffer that will contain a legalized version of the input label, if the input label was illegal

public abstract boolean removeLabel (long address)

Remove all the labels associated to the given address.

Returns
  • always true

public abstract Long resolveLabel (String label)

Determine the memory address associated with the provided label.

Returns
  • the address, or null on error

public abstract boolean setLabel (long address, String label, boolean allowAdjusting, boolean allowAlternates, boolean mustBePrimary)

Attach a label at a given address.

Parameters
address memory address
label label string
allowAdjusting if true, the label will be adjusted if a conflict arises (eg, duplicate label, illegal label string)
Returns
  • success indicator