|
| ContextGhidra (ArchitectureGhidra *g) |
| Construct with a specific client.
|
|
virtual const TrackedSet & | getTrackedSet (const Address &addr) const |
| Get the set of tracked register values associated with the given address. More...
|
|
virtual void | restoreXml (const Element *el, const AddrSpaceManager *manage) |
| Restore the state of this database object from a serialized XML stream. More...
|
|
virtual void | restoreFromSpec (const Element *el, const AddrSpaceManager *manage) |
| Add initial context state from XML tags in compiler/processor specifications. More...
|
|
virtual int | getContextSize (void) const |
| Retrieve the number of words (uintm) in a context blob. More...
|
|
virtual const uintm * | getContext (const Address &addr) const |
| Get the context blob of values associated with a given address. More...
|
|
virtual const uintm * | getContext (const Address &addr, uintb &first, uintb &last) const |
| Get the context blob of values associated with a given address and its bounding offsets. More...
|
|
virtual void | registerVariable (const string &nm, int4 sbit, int4 ebit) |
| Register a new named context variable (as a bit range) with the database. More...
|
|
virtual void | saveXml (ostream &s) const |
| Serialize the entire database to an XML stream. More...
|
|
virtual TrackedSet & | createSet (const Address &addr1, const Address &addr2) |
| Create a tracked register set that is valid over the given range. More...
|
|
virtual TrackedSet & | getTrackedDefault (void) |
| Get the set of default values for all tracked registers. More...
|
|
virtual | ~ContextDatabase () |
| Destructor.
|
|
void | setVariableDefault (const string &nm, uintm val) |
| Provide a default value for a context variable. More...
|
|
uintm | getDefaultValue (const string &nm) const |
| Retrieve the default value for a context variable. More...
|
|
void | setVariable (const string &nm, const Address &addr, uintm value) |
| Set a context value at the given address. More...
|
|
uintm | getVariable (const string &nm, const Address &addr) const |
| Retrieve a context value at the given address. More...
|
|
void | setContextChangePoint (const Address &addr, int4 num, uintm mask, uintm value) |
| Set a specific context value starting at the given address. More...
|
|
void | setContextRegion (const Address &addr1, const Address &addr2, int4 num, uintm mask, uintm value) |
| Set a context variable value over a given range of addresses. More...
|
|
void | setVariableRegion (const string &nm, const Address &begad, const Address &endad, uintm value) |
| Set a context variable by name over a given range of addresses. More...
|
|
uintb | getTrackedValue (const VarnodeData &mem, const Address &point) const |
| Get the value of a tracked register at a specific address. More...
|
|
An implementation of a ContextDatabase obtaining context information via a Ghidra client.
This only implements the tracked register parts of the interface. In fact, this only implements the single method getTrackedSet(). Other methods that get or set the low-level (disassembly) context variables will throw an exception. The low-level context is only needed by the Sleigh disassembly engine, which is being provided by the Ghidra client in this use case.
virtual void ContextGhidra::getRegionForSet |
( |
vector< uintm * > & |
res, |
|
|
const Address & |
addr1, |
|
|
const Address & |
addr2, |
|
|
int4 |
num, |
|
|
uintm |
mask |
|
) |
| |
|
inlineprivatevirtual |
Grab the context blob(s) for the given address range, marking bits that will be set.
This is an internal routine for obtaining the actual memory regions holding context values for the address range. This also informs the system which bits are getting set. A split is forced at the first address, and at least one memory region is passed back. The second address can be invalid in which case the memory region passed back is valid from the first address to whatever the next split point is.
- Parameters
-
res | will hold pointers to memory regions for the given range |
addr1 | is the starting address of the range |
addr2 | is (1 past) the last address of the range or is invalid |
num | is the word index for the context value that will be set |
mask | is a mask of the value being set (within its word) |
Implements ContextDatabase.
virtual void ContextGhidra::getRegionToChangePoint |
( |
vector< uintm * > & |
res, |
|
|
const Address & |
addr, |
|
|
int4 |
num, |
|
|
uintm |
mask |
|
) |
| |
|
inlineprivatevirtual |
Grab the context blob(s) starting at the given address up to the first point of change.
This is an internal routine for obtaining the actual memory regions holding context values starting at the given address. A specific context value is specified, and all memory regions are returned up to the first address where that particular context value changes.
- Parameters
-
res | will hold pointers to memory regions being passed back |
addr | is the starting address of the regions to fetch |
num | is the word index for the specific context value being set |
mask | is a mask of the context value being set (within its word) |
Implements ContextDatabase.
virtual void ContextGhidra::registerVariable |
( |
const string & |
nm, |
|
|
int4 |
sbit, |
|
|
int4 |
ebit |
|
) |
| |
|
inlinevirtual |
Register a new named context variable (as a bit range) with the database.
A new variable is registered by providing a name and the range of bits the value will occupy within the context blob. The full blob size is automatically increased if necessary. The variable must be contained within a single word, and all variables must be registered before any values can be set.
- Parameters
-
nm | is the name of the new variable |
sbit | is the position of the variable's most significant bit within the blob |
ebit | is the position of the variable's least significant bit within the blob |
Implements ContextDatabase.