Package ghidra.program.model.mem
Interface LiveMemoryHandler
public interface LiveMemoryHandler
Live memory handler interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLiveMemoryListener
(LiveMemoryListener listener) Adds a LiveMemoryListener to this handler.void
Called when the memory map is re-initializing.byte
Gets the byte at the given address.int
Get the bytes at the given address and size and put them into the destination buffer.void
Writes the given byte value to the address in memory.int
Writes the given bytes to memory starting at the given address.void
removeLiveMemoryListener
(LiveMemoryListener listener) Removes the LiveMemoryListener from this handler.
-
Method Details
-
clearCache
void clearCache()Called when the memory map is re-initializing. Usually after an undo or redo. -
getByte
Gets the byte at the given address.- Parameters:
addr
- the address of the byte to be retrieved- Returns:
- the byte at the given address.
- Throws:
MemoryAccessException
- if the byte can't be read.
-
getBytes
Get the bytes at the given address and size and put them into the destination buffer.- Parameters:
address
- the address of the first byte to be retrieved.buffer
- the byte buffer in which to place the bytes.startIndex
- the starting index in the buffer to put the first byte.size
- the number of bytes to retrieve and put in the buffer.- Returns:
- the number of bytes placed into the given buffer.
- Throws:
MemoryAccessException
- if the bytes can't be read.
-
putByte
Writes the given byte value to the address in memory.- Parameters:
address
- the address whose byte is to be updated to the new value.value
- the value to set at the given address.- Throws:
MemoryAccessException
- if the value can not be written to the memory.
-
putBytes
Writes the given bytes to memory starting at the given address.- Parameters:
address
- the address in memory to write the bytes.source
- the buffer containing the byte values to be written to memory.startIndex
- the starting index in the buffer to get byte values.size
- the number of bytes to write to memory.- Returns:
- the number of bytes written to memory.
- Throws:
MemoryAccessException
- if the bytes can't be written to memory.
-
addLiveMemoryListener
Adds a LiveMemoryListener to this handler. The listener will be notified when memory bytes change.- Parameters:
listener
- the listener to be notified of memory byte value changes.
-
removeLiveMemoryListener
Removes the LiveMemoryListener from this handler.- Parameters:
listener
- the listener to be removed.
-