Interface IMemoryModel

All Known Subinterfaces:
IMethodStackMemoryModel, INativeCodeModel<InsnType>

@Ser public interface IMemoryModel
A manager for the collection of memory items generated by the native code analyzer.
  • Method Details

    • getLock

      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.
      Returns:
    • addListener

      void addListener(IMemoryModelListener listener)
      Register a listener that will receive updates when this model is updated.
      Parameters:
      listener -
    • removeListener

      void removeListener(IMemoryModelListener listener)
      Unregister a listener.
      Parameters:
      listener -
    • notifyListenersOfModelChange

      void notifyListenersOfModelChange(MemoryModelEventType eventType, Object eventDetails)
      Issue a notification of model change to all listeners.
      Parameters:
      eventType -
      eventDetails -
    • isEmpty

      boolean isEmpty()
      Determine if the model is empty.
      Returns:
    • size

      int size()
      Provide the number of elements in the model.
      Returns:
    • getFirstItem

      INativeContinuousItem getFirstItem()
      Get the lowest-address element in the model.
      Returns:
    • getLastItem

      INativeContinuousItem getLastItem()
      Get the highest-address element in the model.
      Returns:
    • 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
    • getView

      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
    • getItemAt

      INativeContinuousItem getItemAt(long address)
      Retrieve the item starting at the given address.
      Parameters:
      address -
      Returns:
      the item or null
    • getItemOver

      INativeContinuousItem getItemOver(long address)
      Retrieve the item spanning over the given address.
      Parameters:
      address -
      Returns:
      the item or null
    • getNextItem

      INativeContinuousItem getNextItem(long address)
      Retrieve the closest item whose address is strictly greater than the provided address.
      Parameters:
      address -
      Returns:
      the next item or null
    • getNextItem

      default INativeContinuousItem getNextItem(INativeContinuousItem item)
      Retrieve the closest item after the given one..
      Parameters:
      item -
      Returns:
      the next item or null
    • getPreviousItem

      default INativeContinuousItem getPreviousItem(INativeContinuousItem item)
      Retrieve the closest before the given one..
      Parameters:
      item -
      Returns:
      the next item or null
    • getPreviousItem

      INativeContinuousItem getPreviousItem(long address)
      Retrieve the closest item whose address is strictly less than the provided address.
      Parameters:
      address -
      Returns:
      the previous item or null
    • getItemOverOrGap

      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
    • getContinuousItemsInRange

      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().
      Parameters:
      addressBegin -
      addressEnd -
      Returns:
      a list of items, with gap items to fill in possible gaps
    • getItemsInRange

      SortedMap<Long,INativeContinuousItem> getItemsInRange(long addressBegin, boolean includePartialFirstItem, long addressEnd, boolean includePartialLastItem)
      Get a map of items in the given range.
      Parameters:
      addressBegin -
      includePartialFirstItem - include the first item if it spans over (not starts on) the start address
      addressEnd -
      includePartialLastItem - include the last item if it spans over (not ends on) the last address
      Returns:
    • isEmptyRange

      boolean isEmptyRange(long address, int size)
      Determine if a provided range is free (ie, contains no item or overlapping item).
      Parameters:
      address -
      size -
      Returns:
    • 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)
    • getLabelManager

      ILabelManager getLabelManager()
      Retrieve the label manager associated with this model.
      Returns:
    • getCommentManager

      ICommentManager getCommentManager()
      Retrieve the comment manager associated with this model.
      Returns:
    • getBitsize

      int getBitsize()
      Retrieve the bitsize
      Returns: