Package ghidra.pcode.memstate
Interface MemoryState
- All Known Implementing Classes:
AbstractMemoryState,AdaptedMemoryState,DefaultMemoryState
Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
Modifier and TypeMethodDescriptiongetBigInteger(AddressSpace spc, long off, int size, boolean signed) Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for reading values from the MemoryState.getBigInteger(Register reg) Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for reading a value directly from a register rather than querying for the offset and spacegetBigInteger(Varnode vn, boolean signed) Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for reading a value directly from a varnode rather than querying for the offset and spacegetBigInteger(String nm) Deprecated, for removal: This API element is subject to removal in a future version.This is a convenience method for reading registers by name.intgetChunk(byte[] res, AddressSpace spc, long off, int size, boolean stopOnUnintialized) Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for reading a range of bytes from the MemorySate.Deprecated, for removal: This API element is subject to removal in a future version.Any MemoryBank that has been registered with this MemoryState can be retrieved via this method if the MemoryBank's associated address space is known.longgetValue(AddressSpace spc, long off, int size) Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for reading values from the MemoryState.longDeprecated, for removal: This API element is subject to removal in a future version.A convenience method for reading a value directly from a register rather than querying for the offset and spacelongDeprecated, for removal: This API element is subject to removal in a future version.A convenience method for reading a value directly from a varnode rather than querying for the offset and spacelongDeprecated, for removal: This API element is subject to removal in a future version.This is a convenience method for reading registers by name.voidsetChunk(byte[] val, AddressSpace spc, long off, int size) Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for setting values for a range of bytes in the MemoryState.voidsetInitialized(boolean initialized, AddressSpace spc, long off, int size) Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for setting the initialization status for a range of bytes in the MemoryState.voidsetMemoryBank(MemoryBank bank) Deprecated, for removal: This API element is subject to removal in a future version.MemoryBanks associated with specific address spaces must be registers with this MemoryState via this method.voidsetValue(AddressSpace spc, long off, int size, long cval) Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for writing values to the MemoryState.voidsetValue(AddressSpace spc, long off, int size, BigInteger cval) Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for writing values to the MemoryState.voidDeprecated, for removal: This API element is subject to removal in a future version.A convenience method for setting a value directly on a register rather than breaking out the componentsvoidsetValue(Register reg, BigInteger cval) Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for setting a value directly on a register rather than breaking out the componentsvoidDeprecated, for removal: This API element is subject to removal in a future version.A convenience method for setting a value directly on a varnode rather than breaking out the componentsvoidsetValue(Varnode vn, BigInteger cval) Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for setting a value directly on a varnode rather than breaking out the componentsvoidDeprecated, for removal: This API element is subject to removal in a future version.This is a convenience method for setting registers by name.voidsetValue(String nm, BigInteger cval) Deprecated, for removal: This API element is subject to removal in a future version.This is a convenience method for setting registers by name.
-
Method Details
-
setMemoryBank
Deprecated, for removal: This API element is subject to removal in a future version.MemoryBanks associated with specific address spaces must be registers with this MemoryState via this method. Each address space that will be used during emulation must be registered separately. The MemoryState object does not assume responsibility for freeing the MemoryBank.- Parameters:
bank- is a pointer to the MemoryBank to be registered
-
getMemoryBank
Deprecated, for removal: This API element is subject to removal in a future version.Any MemoryBank that has been registered with this MemoryState can be retrieved via this method if the MemoryBank's associated address space is known.- Parameters:
spc- is the address space of the desired MemoryBank- Returns:
- the MemoryBank or null if no bank is associated with spc.
-
setValue
Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for setting a value directly on a varnode rather than breaking out the components- Parameters:
vn- the varnode location to be writtencval- the value to write into the varnode location
-
setValue
Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for setting a value directly on a register rather than breaking out the components- Parameters:
reg- the register location to be writtencval- the value to write into the register location
-
setValue
Deprecated, for removal: This API element is subject to removal in a future version.This is a convenience method for setting registers by name. Any register name known to the language can be used as a write location. The associated address space, offset, and size is looked up and automatically passed to the main setValue routine.- Parameters:
nm- is the name of the registercval- is the value to write to the register
-
setValue
Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for writing values to the MemoryState. If there is no registered MemoryBank for the desired address space, or if there is some other error, an exception is thrown.- Parameters:
spc- is the address space to write tooff- is the offset where the value should be writtensize- is the number of bytes to be writtencval- is the value to be written
-
getValue
Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for reading a value directly from a varnode rather than querying for the offset and space- Parameters:
vn- the varnode location to be read- Returns:
- the value read from the varnode location
-
getValue
Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for reading a value directly from a register rather than querying for the offset and space- Parameters:
reg- the register location to be read- Returns:
- the value read from the register location
-
getValue
Deprecated, for removal: This API element is subject to removal in a future version.This is a convenience method for reading registers by name. any register name known to the language can be used as a read location. The associated address space, offset, and size is looked up and automatically passed to the main getValue routine.- Parameters:
nm- is the name of the register- Returns:
- the value associated with that register
-
getValue
Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for reading values from the MemoryState. If there is no registered MemoryBank for the desired address space, or if there is some other error, an exception is thrown.- Parameters:
spc- is the address space being queriedoff- is the offset of the value being queriedsize- is the number of bytes to query- Returns:
- the queried value
-
setValue
Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for setting a value directly on a varnode rather than breaking out the components- Parameters:
vn- the varnode location to be writtencval- the value to write into the varnode location
-
setValue
Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for setting a value directly on a register rather than breaking out the components- Parameters:
reg- the register location to be writtencval- the value to write into the register location
-
setValue
Deprecated, for removal: This API element is subject to removal in a future version.This is a convenience method for setting registers by name. Any register name known to the language can be used as a write location. The associated address space, offset, and size is looked up and automatically passed to the main setValue routine.- Parameters:
nm- is the name of the registercval- is the value to write to the register
-
setValue
Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for writing values to the MemoryState. If there is no registered MemoryBank for the desired address space, or if there is some other error, an exception is thrown.- Parameters:
spc- is the address space to write tooff- is the offset where the value should be writtensize- is the number of bytes to be writtencval- is the value to be written
-
getBigInteger
Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for reading a value directly from a varnode rather than querying for the offset and space- Parameters:
vn- the varnode location to be readsigned- true if signed value should be returned, false for unsigned value- Returns:
- the unsigned value read from the varnode location
-
getBigInteger
Deprecated, for removal: This API element is subject to removal in a future version.A convenience method for reading a value directly from a register rather than querying for the offset and space- Parameters:
reg- the register location to be read- Returns:
- the unsigned value read from the register location
-
getBigInteger
Deprecated, for removal: This API element is subject to removal in a future version.This is a convenience method for reading registers by name. any register name known to the language can be used as a read location. The associated address space, offset, and size is looked up and automatically passed to the main getValue routine.- Parameters:
nm- is the name of the register- Returns:
- the unsigned value associated with that register
-
getBigInteger
Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for reading values from the MemoryState. If there is no registered MemoryBank for the desired address space, or if there is some other error, an exception is thrown.- Parameters:
spc- is the address space being queriedoff- is the offset of the value being queriedsize- is the number of bytes to querysigned- true if signed value should be returned, false for unsigned value- Returns:
- the queried unsigned value
-
getChunk
Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for reading a range of bytes from the MemorySate. The MemoryBank associated with the address space of the query is looked up and the request is forwarded to the getChunk method on the MemoryBank. If there is no registered MemoryBank or some other error, an exception is thrown. All getLongValue methods utilize this method to read the bytes from the appropriate memory bank.- Parameters:
res- the result buffer for storing retrieved bytesspc- the desired address spaceoff- the starting offset of the byte range being readsize- the number of bytes being readstopOnUnintialized- if true a partial read is permitted and returned size may be smaller than size requested- Returns:
- number of bytes actually read
- Throws:
LowlevelError- if spc has not been mapped within this MemoryState or memory fault handler generated error
-
setChunk
Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for setting values for a range of bytes in the MemoryState. The MemoryBank associated with the desired address space is looked up and the write is forwarded to the setChunk method on the MemoryBank. If there is no registered MemoryBank or some other error, an exception is throw. All setValue methods utilize this method to read the bytes from the appropriate memory bank.- Parameters:
val- the byte values to be written into the MemoryStatespc- the address space being writtenoff- the starting offset of the range being writtensize- the number of bytes to write- Throws:
LowlevelError- if spc has not been mapped within this MemoryState
-
setInitialized
Deprecated, for removal: This API element is subject to removal in a future version.This is the main interface for setting the initialization status for a range of bytes in the MemoryState. The MemoryBank associated with the desired address space is looked up and the write is forwarded to the setInitialized method on the MemoryBank. If there is no registered MemoryBank or some other error, an exception is throw. All setValue methods utilize this method to read the bytes from the appropriate memory bank.- Parameters:
initialized- indicates if range should be marked as initialized or notspc- the address space being writtenoff- the starting offset of the range being writtensize- the number of bytes to write
-