public interface

IMemoryModel

com.pnfsoftware.jeb.core.units.code.asm.analyzer.IMemoryModel
Known Indirect Subclasses

Class Overview

A manager for the collection of memory items generated by the native code analyzer.

Summary

Public Methods
abstract void addListener(IMemoryModelListener listener)
Register a listener that will receive updates when this model is updated.
abstract int getBitsize()
Retrieve the bitsize
abstract ICommentManager getCommentManager()
Retrieve the comment manager associated with this model.
abstract SortedMap<Long, INativeContinuousItem> getContinuousItemsInRange(long addressBegin, long addressEnd)
Get a contiguous list of items, without gaps.
abstract INativeContinuousItem getFirstItem()
Get the lowest-address element in the model.
abstract ISegmentFactory<Long, INativeContinuousItem> getGapFactory()
Retrieve a "gap items" factory.
abstract INativeContinuousItem getItemAt(long address)
Retrieve the item starting at the given address.
abstract INativeContinuousItem getItemOver(long address)
Retrieve the item spanning over the given address.
abstract INativeContinuousItem getItemOverOrGap(long address, long lowerBound, long upperBound)
Retrieve the item spanning over the given address, or if no item exists, return a temporary item that fills the gap, partially or fully.
abstract SortedMap<Long, INativeContinuousItem> getItemsInRange(long addressBegin, boolean includePartialFirstItem, long addressEnd, boolean includePartialLastItem)
Get a map of items in the given range.
abstract ILabelManager getLabelManager()
Retrieve the label manager associated with this model.
abstract INativeContinuousItem getLastItem()
Get the highest-address element in the model.
abstract IUnitLock getLock()
Retrieve the model lock, used to request a full-access model lock or a partial, read-only, transactional lock.
abstract INativeContinuousItem getNextItem(long address)
Retrieve the closest item whose address is strictly greater than the provided address.
abstract INativeContinuousItem getNextItem(INativeContinuousItem item)
Retrieve the closest item after the given one..
abstract INativeContinuousItem getPreviousItem(INativeContinuousItem item)
Retrieve the closest before the given one..
abstract INativeContinuousItem getPreviousItem(long address)
Retrieve the closest item whose address is strictly less than the provided address.
abstract SortedMap<Long, INativeContinuousItem> getView(Long fromAddress, Long toAddress)
Get a copy view of the current model.
abstract SortedMap<Long, INativeContinuousItem> getView()
Get a full view of the current model.
abstract boolean isEmpty()
Determine if the model is empty.
abstract boolean isEmptyRange(long address, int size)
Determine if a provided range is free (ie, contains no item or overlapping item).
abstract void notifyListenersOfModelChange(MemoryModelEventType eventType, Object eventDetails)
Issue a notification of model change to all listeners.
abstract void removeListener(IMemoryModelListener listener)
Unregister a listener.
abstract int size()
Provide the number of elements in the model.

Public Methods

public abstract void addListener (IMemoryModelListener listener)

Register a listener that will receive updates when this model is updated.

public abstract int getBitsize ()

Retrieve the bitsize

public abstract ICommentManager getCommentManager ()

Retrieve the comment manager associated with this model.

public abstract SortedMap<Long, INativeContinuousItem> getContinuousItemsInRange (long addressBegin, long addressEnd)

Get a contiguous list of items, without gaps. The last item, if present, may have an end-address past `addressEnd`. Gaps are filled using getGapFactory().

Returns
  • a list of items, with gap items to fill in possible gaps

public abstract INativeContinuousItem getFirstItem ()

Get the lowest-address element in the model.

public abstract ISegmentFactory<Long, INativeContinuousItem> getGapFactory ()

Retrieve a "gap items" factory. The factory is used to produce temporary items to fill in gaps, when using methods like getContinuousItemsInRange(long, long).

Returns
  • a factory (mandatory)

public abstract INativeContinuousItem getItemAt (long address)

Retrieve the item starting at the given address.

Returns
  • the item or null

public abstract INativeContinuousItem getItemOver (long address)

Retrieve the item spanning over the given address.

Returns
  • the item or null

public abstract INativeContinuousItem getItemOverOrGap (long address, long lowerBound, long upperBound)

Retrieve the item spanning over the given address, or if no item exists, return a temporary item that fills the gap, partially or fully. In the latter case, the gap item is not attached to the memory model.

Parameters
address the address to be queried; the address must be in the bounds range defined below
lowerBound the lower bound for the gap, if no item was found
upperBound the higher bound for the gap, used if no item was found; must be >= that the lower bound
Returns
  • an item or a gap item, or null if the addresses are invalid

public abstract SortedMap<Long, INativeContinuousItem> getItemsInRange (long addressBegin, boolean includePartialFirstItem, long addressEnd, boolean includePartialLastItem)

Get a map of items in the given range.

Parameters
includePartialFirstItem include the first item if it spans over (not starts on) the start address
includePartialLastItem include the last item if it spans over (not ends on) the last address

public abstract ILabelManager getLabelManager ()

Retrieve the label manager associated with this model.

public abstract INativeContinuousItem getLastItem ()

Get the highest-address element in the model.

public abstract IUnitLock getLock ()

Retrieve the model lock, used to request a full-access model lock or a partial, read-only, transactional lock. All plugin code accessing the native units and units relying on native units should use those locks to perform operations safely in a concurrent environment.

public abstract INativeContinuousItem getNextItem (long address)

Retrieve the closest item whose address is strictly greater than the provided address.

Returns
  • the next item or null

public abstract INativeContinuousItem getNextItem (INativeContinuousItem item)

Retrieve the closest item after the given one..

Returns
  • the next item or null

public abstract INativeContinuousItem getPreviousItem (INativeContinuousItem item)

Retrieve the closest before the given one..

Returns
  • the next item or null

public abstract INativeContinuousItem getPreviousItem (long address)

Retrieve the closest item whose address is strictly less than the provided address.

Returns
  • the previous item or null

public abstract SortedMap<Long, INativeContinuousItem> getView (Long fromAddress, Long toAddress)

Get a copy view of the current model.

Parameters
fromAddress optional start address
toAddress optional end address
Returns
  • an unmodifiable view of the model containing the native items

public abstract SortedMap<Long, INativeContinuousItem> getView ()

Get a full view of the current model. Same as getView(null, null).

Returns
  • an unmodifiable view of the model containing the native items

public abstract boolean isEmpty ()

Determine if the model is empty.

public abstract boolean isEmptyRange (long address, int size)

Determine if a provided range is free (ie, contains no item or overlapping item).

public abstract void notifyListenersOfModelChange (MemoryModelEventType eventType, Object eventDetails)

Issue a notification of model change to all listeners.

public abstract void removeListener (IMemoryModelListener listener)

Unregister a listener.

public abstract int size ()

Provide the number of elements in the model.