Package ghidra.pcode.exec.trace
Class TraceEmulationIntegration.AbstractSimplePropertyBasedPieceHandler<A,T,P>
java.lang.Object
ghidra.pcode.exec.trace.TraceEmulationIntegration.AbstractPropertyBasedPieceHandler<A,T,P>
ghidra.pcode.exec.trace.TraceEmulationIntegration.AbstractSimplePropertyBasedPieceHandler<A,T,P>
- Type Parameters:
A- the address domain of the pieceT- the value domain of the pieceP- the type of the property map
- All Implemented Interfaces:
TraceEmulationIntegration.PieceHandler<A,T>
- Enclosing class:
TraceEmulationIntegration
public abstract static class TraceEmulationIntegration.AbstractSimplePropertyBasedPieceHandler<A,T,P>
extends TraceEmulationIntegration.AbstractPropertyBasedPieceHandler<A,T,P>
A misguided simplification of
TraceEmulationIntegration.AbstractPropertyBasedPieceHandler that reduces the
requirement to a simple codec.
For cases where subpiecing of variables is not of concern, this simplification may suffice.
This is usually okay for proofs of concept or very simplistic architectures. However, once
you introduce structured/aliased registers (e.g., EAX is the lower 32 bits of
RAX), or you're dealing with off-cut memory references, you have to deal with
subpiecing and this simplification is no longer viable.
-
Field Summary
Fields inherited from interface ghidra.pcode.exec.trace.TraceEmulationIntegration.PieceHandler
NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TDecode a state value from the given property valueprotected voiddecodeFrom(PcodeExecutorStatePiece<A, T> piece, AddressSetView limit, AddressRange range, P propertyValue) Decode a property entry and set appropriate variable(s) in the pieceprotected abstract PEncode a state value into a property valueprotected voidencodeInto(PcodeTracePropertyAccess<P> property, AddressRange range, T value) Encode a variable's value into a property entryMethods inherited from class ghidra.pcode.exec.trace.TraceEmulationIntegration.AbstractPropertyBasedPieceHandler
abstractReadUninit, abstractWritten, getPropertyName, getPropertyType, readUninitialized, writeDownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.pcode.exec.trace.TraceEmulationIntegration.PieceHandler
dataWritten, getAddressDomain, getValueDomain
-
Constructor Details
-
AbstractSimplePropertyBasedPieceHandler
public AbstractSimplePropertyBasedPieceHandler()
-
-
Method Details
-
decode
Decode a state value from the given property value- Parameters:
propertyValue- the property value- Returns:
- the decoded state value
-
decodeFrom
protected void decodeFrom(PcodeExecutorStatePiece<A, T> piece, AddressSetView limit, AddressRange range, P propertyValue) Description copied from class:TraceEmulationIntegration.AbstractPropertyBasedPieceHandlerDecode a property entry and set appropriate variable(s) in the pieceThe found property entry may cover more addresses than are actually required, either because they've not been requested or because the value has already been set. Writing a value that wasn't requested isn't too bad, but writing one that was already initialized could be catastrophic.
- Specified by:
decodeFromin classTraceEmulationIntegration.AbstractPropertyBasedPieceHandler<A,T, P> - Parameters:
piece- the piece with uninitialized variables to decode from a propertylimit- the portion that is requested and uninitialized. DO NOT initialize any address outside of this set.range- the range covered by the found property entrypropertyValue- the value of the property entry
-
encode
Encode a state value into a property value- Parameters:
value- the state value- Returns:
- the encoded property value
-
encodeInto
Description copied from class:TraceEmulationIntegration.AbstractPropertyBasedPieceHandlerEncode a variable's value into a property entry- Specified by:
encodeIntoin classTraceEmulationIntegration.AbstractPropertyBasedPieceHandler<A,T, P> - Parameters:
property- the property map (access shim)range- the variable's address range (this may optionally be coalesced from several variables by the piece's internals)value- the variable's value
-