Package ghidra.pcode.memstate
Class AbstractMemoryState
java.lang.Object
ghidra.pcode.memstate.AbstractMemoryState
- All Implemented Interfaces:
MemoryState
- Direct Known Subclasses:
AdaptedMemoryState
,DefaultMemoryState
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal BigInteger
getBigInteger
(AddressSpace spc, long off, int size, boolean signed) This is the main interface for reading values from the MemoryState.final BigInteger
getBigInteger
(Register reg) A convenience method for reading a value directly from a register rather than querying for the offset and spacefinal BigInteger
getBigInteger
(Varnode vn, boolean signed) A convenience method for reading a value directly from a varnode rather than querying for the offset and spacefinal BigInteger
getBigInteger
(String nm) This is a convenience method for reading registers by name.final long
getValue
(AddressSpace spc, long off, int size) This is the main interface for reading values from the MemoryState.final long
A convenience method for reading a value directly from a register rather than querying for the offset and spacefinal long
A convenience method for reading a value directly from a varnode rather than querying for the offset and spacefinal long
This is a convenience method for reading registers by name.final void
setValue
(AddressSpace spc, long off, int size, long cval) This is the main interface for writing values to the MemoryState.final void
setValue
(AddressSpace spc, long off, int size, BigInteger cval) This is the main interface for writing values to the MemoryState.final void
A convenience method for setting a value directly on a register rather than breaking out the componentsfinal void
setValue
(Register reg, BigInteger cval) A convenience method for setting a value directly on a register rather than breaking out the componentsfinal void
A convenience method for setting a value directly on a varnode rather than breaking out the componentsfinal void
setValue
(Varnode vn, BigInteger cval) A convenience method for setting a value directly on a varnode rather than breaking out the componentsfinal void
This is a convenience method for setting registers by name.final void
setValue
(String nm, BigInteger cval) This is a convenience method for setting registers by name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ghidra.pcode.memstate.MemoryState
getChunk, getMemoryBank, setChunk, setInitialized, setMemoryBank
-
Constructor Details
-
AbstractMemoryState
-
-
Method Details
-
setValue
A convenience method for setting a value directly on a varnode rather than breaking out the components- Specified by:
setValue
in interfaceMemoryState
- Parameters:
vn
- the varnode location to be writtencval
- the value to write into the varnode location
-
setValue
A convenience method for setting a value directly on a register rather than breaking out the components- Specified by:
setValue
in interfaceMemoryState
- Parameters:
reg
- the register location to be writtencval
- the value to write into the register location
-
setValue
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.- Specified by:
setValue
in interfaceMemoryState
- Parameters:
nm
- is the name of the registercval
- is the value to write to the register
-
setValue
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.- Specified by:
setValue
in interfaceMemoryState
- 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
A convenience method for reading a value directly from a varnode rather than querying for the offset and space- Specified by:
getValue
in interfaceMemoryState
- Parameters:
vn
- the varnode location to be read- Returns:
- the value read from the varnode location
-
getValue
A convenience method for reading a value directly from a register rather than querying for the offset and space- Specified by:
getValue
in interfaceMemoryState
- Parameters:
reg
- the register location to be read- Returns:
- the value read from the register location
-
getValue
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.- Specified by:
getValue
in interfaceMemoryState
- Parameters:
nm
- is the name of the register- Returns:
- the value associated with that register
-
getValue
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.- Specified by:
getValue
in interfaceMemoryState
- 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
A convenience method for setting a value directly on a varnode rather than breaking out the components- Specified by:
setValue
in interfaceMemoryState
- Parameters:
vn
- the varnode location to be writtencval
- the value to write into the varnode location
-
setValue
A convenience method for setting a value directly on a register rather than breaking out the components- Specified by:
setValue
in interfaceMemoryState
- Parameters:
reg
- the register location to be writtencval
- the value to write into the register location
-
setValue
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.- Specified by:
setValue
in interfaceMemoryState
- Parameters:
nm
- is the name of the registercval
- is the value to write to the register
-
setValue
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.- Specified by:
setValue
in interfaceMemoryState
- 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
A convenience method for reading a value directly from a varnode rather than querying for the offset and space- Specified by:
getBigInteger
in interfaceMemoryState
- 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
A convenience method for reading a value directly from a register rather than querying for the offset and space- Specified by:
getBigInteger
in interfaceMemoryState
- Parameters:
reg
- the register location to be read- Returns:
- the unsigned value read from the register location
-
getBigInteger
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.- Specified by:
getBigInteger
in interfaceMemoryState
- Parameters:
nm
- is the name of the register- Returns:
- the unsigned value associated with that register
-
getBigInteger
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.- Specified by:
getBigInteger
in interfaceMemoryState
- 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
-