Package ghidra.pcode.exec
Class AbstractBytesPcodeExecutorStatePiece<S extends BytesPcodeExecutorStateSpace>
java.lang.Object
ghidra.pcode.exec.AbstractLongOffsetPcodeExecutorStatePiece<byte[],byte[],S>
ghidra.pcode.exec.AbstractBytesPcodeExecutorStatePiece<S>
- Type Parameters:
S- the type of an executor state space, internally associated with an address space
- All Implemented Interfaces:
PcodeExecutorStatePiece<byte[],byte[]>
- Direct Known Subclasses:
BytesPcodeExecutorStatePiece,JitBytesPcodeExecutorStatePiece
public abstract class AbstractBytesPcodeExecutorStatePiece<S extends BytesPcodeExecutorStateSpace>
extends AbstractLongOffsetPcodeExecutorStatePiece<byte[],byte[],S>
An abstract p-code executor state piece for storing and retrieving bytes as arrays
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA memory buffer bound to a given space in this stateNested classes/interfaces inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece
PcodeExecutorStatePiece.Reason -
Field Summary
FieldsFields inherited from class ghidra.pcode.exec.AbstractLongOffsetPcodeExecutorStatePiece
addressArithmetic, arithmetic, cb, language, uniqueSpace -
Constructor Summary
ConstructorsConstructorDescriptionAbstractBytesPcodeExecutorStatePiece(Language language, PcodeArithmetic<byte[]> arithmetic, PcodeStateCallbacks cb) Construct a state for the given languageAbstractBytesPcodeExecutorStatePiece(Language language, PcodeStateCallbacks cb) Construct a state for the given language -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Erase the entire state or piecegetConcreteBuffer(Address address, PcodeArithmetic.Purpose purpose) Bind a buffer of concrete bytes at the given start addressprotected SgetForSpace(AddressSpace space, boolean toWrite) Get the internal space for the given address spaceprotected byte[]getFromSpace(S space, long offset, int size, PcodeExecutorStatePiece.Reason reason, PcodeStateCallbacks cb) Get a value from the given spacegetRegisterValuesFromSpace(S s, List<Register> registers) Can the given space for register values, as inAbstractLongOffsetPcodeExecutorStatePiece.getRegisterValues()protected abstract SnewSpace(AddressSpace space) protected voidsetInSpace(S space, long offset, int size, byte[] val, PcodeStateCallbacks cb) Set a value in the given spaceMethods inherited from class ghidra.pcode.exec.AbstractLongOffsetPcodeExecutorStatePiece
checkSize, forkMap, getAddressArithmetic, getArithmetic, getFromNullSpace, getLanguage, getRegisterValues, getUnique, getVar, getVar, getVarInternal, getVarInternal, getVarInternal, setUnique, setVar, setVar, setVarInternal, setVarInternal, setVarInternal, streamPiecesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece
checkRange, fork, getNextEntryInternal, getNextEntryInternal, getVar, getVar, getVar, inspectBigInteger, inspectByte, inspectConcrete, inspectInt, inspectLong, inspectRegisterValue, inspectShort, quantizeOffset, setBigInteger, setByte, setConcrete, setInt, setLong, setRegisterValue, setRegisterValue, setShort, setVar, setVar, setVar
-
Field Details
-
spaceMap
-
-
Constructor Details
-
AbstractBytesPcodeExecutorStatePiece
public AbstractBytesPcodeExecutorStatePiece(Language language, PcodeArithmetic<byte[]> arithmetic, PcodeStateCallbacks cb) Construct a state for the given language- Parameters:
language- the language, used for its memory modelarithmetic- the arithmeticcb- callbacks to receive emulation events
-
AbstractBytesPcodeExecutorStatePiece
Construct a state for the given language- Parameters:
language- the language, used for its memory model and arithmeticcb- callbacks to receive emulation events
-
-
Method Details
-
newSpace
-
getForSpace
Description copied from class:AbstractLongOffsetPcodeExecutorStatePieceGet the internal space for the given address space- Specified by:
getForSpacein classAbstractLongOffsetPcodeExecutorStatePiece<byte[],byte[], S extends BytesPcodeExecutorStateSpace> - Parameters:
space- the address spacetoWrite- in case internal spaces are generated lazily, this indicates the space must be present, because it is going to be written to.- Returns:
- the space, or
null
-
setInSpace
Description copied from class:AbstractLongOffsetPcodeExecutorStatePieceSet a value in the given space- Specified by:
setInSpacein classAbstractLongOffsetPcodeExecutorStatePiece<byte[],byte[], S extends BytesPcodeExecutorStateSpace> - Parameters:
space- the address spaceoffset- the offset within the spacesize- the number of bytes to write (the size of the value)val- the value to storecb- callbacks to receive emulation events
-
getFromSpace
protected byte[] getFromSpace(S space, long offset, int size, PcodeExecutorStatePiece.Reason reason, PcodeStateCallbacks cb) Description copied from class:AbstractLongOffsetPcodeExecutorStatePieceGet a value from the given space- Specified by:
getFromSpacein classAbstractLongOffsetPcodeExecutorStatePiece<byte[],byte[], S extends BytesPcodeExecutorStateSpace> - Parameters:
space- the address spaceoffset- the offset within the spacesize- the number of bytes to read (the size of the value)reason- the reason for reading statecb- callbacks to receive emulation events- Returns:
- the read value
-
getRegisterValuesFromSpace
Description copied from class:AbstractLongOffsetPcodeExecutorStatePieceCan the given space for register values, as inAbstractLongOffsetPcodeExecutorStatePiece.getRegisterValues()- Specified by:
getRegisterValuesFromSpacein classAbstractLongOffsetPcodeExecutorStatePiece<byte[],byte[], S extends BytesPcodeExecutorStateSpace> - Parameters:
s- the space to scanregisters- the registers known to be in the corresponding address space- Returns:
- the map of registers to values
-
getConcreteBuffer
Description copied from interface:PcodeExecutorStatePieceBind a buffer of concrete bytes at the given start address- Parameters:
address- the start addresspurpose- the reason why the emulator needs a concrete value- Returns:
- a buffer
-
clear
public void clear()Description copied from interface:PcodeExecutorStatePieceErase the entire state or pieceThis is generally only useful when the state is itself a cache to another object. This will ensure the state is reading from that object rather than a stale cache. If this is not a cache, this could in fact clear the whole state, and the machine using it will be left in the dark.
-