Interface IMemoryModel
- All Known Subinterfaces:
IMethodStackMemoryModel
,INativeCodeModel<InsnType>
A manager for the collection of
memory items
generated by the
native code analyzer.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(IMemoryModelListener listener) Register a listener that will receive updates when this model is updated.int
Retrieve the bitsizeRetrieve the comment manager associated with this model.getContinuousItemsInRange
(long addressBegin, long addressEnd) Get a contiguous list of items, without gaps.Get the lowest-address element in the model.Retrieve a "gap items" factory.getItemAt
(long address) Retrieve the item starting at the given address.getItemOver
(long address) Retrieve the item spanning over the given address.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.getItemsInRange
(long addressBegin, boolean includePartialFirstItem, long addressEnd, boolean includePartialLastItem) Get a map of items in the given range.Retrieve the label manager associated with this model.Get the highest-address element in the model.getLock()
Retrieve the model lock, used to request a full-access model lock or a partial, read-only, transactional lock.getNextItem
(long address) Retrieve the closest item whose address is strictly greater than the provided address.default INativeContinuousItem
Retrieve the closest item after the given one..getPreviousItem
(long address) Retrieve the closest item whose address is strictly less than the provided address.default INativeContinuousItem
Retrieve the closest before the given one..getView()
Get a full view of the current model.Get a copy view of the current model.boolean
isEmpty()
Determine if the model is empty.boolean
isEmptyRange
(long address, int size) Determine if a provided range is free (ie, contains no item or overlapping item).void
notifyListenersOfModelChange
(MemoryModelEventType eventType, Object eventDetails) Issue a notification of model change to all listeners.void
removeListener
(IMemoryModelListener listener) Unregister a listener.int
size()
Provide the number of elements in the model.
-
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
Register a listener that will receive updates when this model is updated.- Parameters:
listener
-
-
removeListener
Unregister a listener.- Parameters:
listener
-
-
notifyListenersOfModelChange
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
SortedMap<Long,INativeContinuousItem> getView()Get a full view of the current model. Same asgetView(null, null)
.- Returns:
- an unmodifiable view of the model containing the native items
-
getView
Get a copy view of the current model.- Parameters:
fromAddress
- optional start addresstoAddress
- optional end address- Returns:
- an unmodifiable view of the model containing the native items
-
getItemAt
Retrieve the item starting at the given address.- Parameters:
address
-- Returns:
- the item or null
-
getItemOver
Retrieve the item spanning over the given address.- Parameters:
address
-- Returns:
- the item or null
-
getNextItem
Retrieve the closest item whose address is strictly greater than the provided address.- Parameters:
address
-- Returns:
- the next item or null
-
getNextItem
Retrieve the closest item after the given one..- Parameters:
item
-- Returns:
- the next item or null
-
getPreviousItem
Retrieve the closest before the given one..- Parameters:
item
-- Returns:
- the next item or null
-
getPreviousItem
Retrieve the closest item whose address is strictly less than the provided address.- Parameters:
address
-- Returns:
- the previous item or null
-
getItemOverOrGap
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 belowlowerBound
- the lower bound for the gap, if no item was foundupperBound
- 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
Get a contiguous list of items, without gaps. The last item, if present, may have an end-address past `addressEnd`. Gaps are filled usinggetGapFactory()
.- 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 addressaddressEnd
-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
ISegmentFactory<Long,INativeContinuousItem> getGapFactory()Retrieve a "gap items" factory. The factory is used to produce temporary items to fill in gaps, when using methods likegetContinuousItemsInRange(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:
-