Ghidra Decompiler Analysis Engine
|
#include <fspec.hh>
Public Types | |
enum | { p_standard, p_standard_out, p_register, p_merged } |
Public Member Functions | |
virtual uint4 | getType (void) const =0 |
Get the type of parameter list. | |
virtual void | assignMap (const vector< Datatype * > &proto, bool isinput, TypeFactory &typefactory, vector< ParameterPieces > &res) const =0 |
Given list of data-types, map the list positions to storage locations. More... | |
virtual void | fillinMap (ParamActive *active) const =0 |
Given an unordered list of storage locations, calculate a function prototype. More... | |
virtual bool | checkJoin (const Address &hiaddr, int4 hisize, const Address &loaddr, int4 losize) const =0 |
Check if the given two storage locations can represent a single logical parameter. More... | |
virtual bool | checkSplit (const Address &loc, int4 size, int4 splitpoint) const =0 |
Check if it makes sense to split a single storage location into two parameters. More... | |
virtual int4 | characterizeAsParam (const Address &loc, int4 size) const =0 |
Characterize whether the given range overlaps parameter storage. More... | |
virtual bool | possibleParam (const Address &loc, int4 size) const =0 |
Does the given storage location make sense as a parameter. More... | |
virtual bool | possibleParamWithSlot (const Address &loc, int4 size, int4 &slot, int4 &slotsize) const =0 |
Pass-back the slot and slot size for the given storage location as a parameter. More... | |
virtual bool | getBiggestContainedParam (const Address &loc, int4 size, VarnodeData &res) const =0 |
Pass-back the biggest parameter contained within the given range. More... | |
virtual bool | unjustifiedContainer (const Address &loc, int4 size, VarnodeData &res) const =0 |
Check if the given storage location looks like an unjustified parameter. More... | |
virtual OpCode | assumedExtension (const Address &addr, int4 size, VarnodeData &res) const =0 |
Get the type of extension and containing parameter for the given storage. More... | |
virtual AddrSpace * | getSpacebase (void) const =0 |
Get the address space associated with any stack based parameters in this list. More... | |
virtual void | getRangeList (AddrSpace *spc, RangeList &res) const =0 |
For a given address space, collect all the parameter locations within that space. More... | |
virtual int4 | getMaxDelay (void) const =0 |
Return the maximum heritage delay across all possible parameters. More... | |
virtual void | restoreXml (const Element *el, const AddrSpaceManager *manage, vector< EffectRecord > &effectlist, bool normalstack)=0 |
Restore the model from an XML stream. More... | |
virtual ParamList * | clone (void) const =0 |
Clone this parameter list model. | |
A group of ParamEntry objects that form a complete set for passing parameters in one direction (either input or output). The main tasks this class must perform are:
anonymous enum |
|
pure virtual |
Given list of data-types, map the list positions to storage locations.
If we know the function prototype, recover how parameters are actually stored using the model.
proto | is the ordered list of data-types |
isinput | is true for the input prototype, false for output prototype |
typefactory | is the TypeFactory (for constructing pointers) |
res | will contain the storage locations corresponding to the datatypes |
Implemented in ParamListMerged, ParamListStandardOut, and ParamListStandard.
|
pure virtual |
Get the type of extension and containing parameter for the given storage.
If the given storage is properly contained within a normal parameter and the model typically extends a small value into the full container, pass back the full container and the type of extension.
addr | is the starting address of the given storage |
size | is the number of bytes in the given storage |
res | is the parameter storage to pass back |
Implemented in ParamListStandard.
|
pure virtual |
Characterize whether the given range overlaps parameter storage.
Does the range naturally fit inside a potential parameter entry from this list or does it contain a parameter entry. Return one of three values indicating this characterization:
loc | is the starting address of the given range |
size | is the number of bytes in the given range |
Implemented in ParamListStandard.
|
pure virtual |
Check if the given two storage locations can represent a single logical parameter.
Within the conventions of this model, do the two (hi/lo) locations represent consecutive parameter locations that can be replaced by a single logical parameter.
hiaddr | is the address of the most significant part of the value |
hisize | is the size of the most significant part in bytes |
loaddr | is the address of the least significant part of the value |
losize | is the size of the least significant part in bytes |
Implemented in ParamListStandard.
|
pure virtual |
Check if it makes sense to split a single storage location into two parameters.
A storage location and split point is provided, implying two new storage locations. Does this model allow these locations to be considered parameters.
loc | is the starting address of provided storage location |
size | is the size of the location in bytes |
splitpoint | is the number of bytes to consider in the first (in address order) piece |
Implemented in ParamListStandard.
|
pure virtual |
Given an unordered list of storage locations, calculate a function prototype.
A list of input (or output) trials is given, which may have holes, invalid inputs etc. Decide on the formal ordered parameter list. Trials within the ParamActive are added, removed, or reordered as needed.
active | is the given list of trials |
Implemented in ParamListMerged, ParamListRegister, ParamListStandardOut, and ParamListStandard.
|
pure virtual |
Pass-back the biggest parameter contained within the given range.
loc | is the starting address of the given range |
size | is the number of bytes in the range |
res | will hold the parameter storage description being passed back |
Implemented in ParamListStandard.
|
pure virtual |
Return the maximum heritage delay across all possible parameters.
Depending on the address space, data-flow for a parameter may not be available until extra transform passes have completed. This method returns the number of passes that must occur before we can guarantee that all parameters have data-flow info.
Implemented in ParamListStandard.
For a given address space, collect all the parameter locations within that space.
Pass back the memory ranges for any parameter that is stored in the given address space.
spc | is the given address space |
res | will hold the set of matching memory ranges |
Implemented in ParamListStandard.
|
pure virtual |
Get the address space associated with any stack based parameters in this list.
Implemented in ParamListStandard.
|
pure virtual |
Does the given storage location make sense as a parameter.
Within this model, decide if the storage location can be considered a parameter.
loc | is the starting address of the storage location |
size | is the number of bytes in the storage location |
Implemented in ParamListStandardOut, and ParamListStandard.
|
pure virtual |
Pass-back the slot and slot size for the given storage location as a parameter.
This checks if the given storage location acts as a parameter in this model and passes back the number of slots that it occupies.
loc | is the starting address of the storage location |
size | is the number of bytes in the storage location |
slot | if the slot number to pass back |
slotsize | is the number of consumed slots to pass back |
Implemented in ParamListStandard.
|
pure virtual |
Restore the model from an XML stream.
el | is the root <input> or <output> element |
manage | is used to resolve references to address spaces |
effectlist | is a container collecting EffectRecords across all parameters |
normalstack | is true if parameters are pushed on the stack in the normal order |
Implemented in ParamListStandardOut, and ParamListStandard.
|
pure virtual |
Check if the given storage location looks like an unjustified parameter.
The storage for a value may be contained in a normal parameter location but be unjustified within that container, i.e. the least significant bytes are not being used. If this is the case, pass back the full parameter location and return true.
loc | is the starting address of the given storage |
size | is the number of bytes in the given storage |
res | is the full parameter storage to pass back |
Implemented in ParamListStandard.