Ghidra Decompiler Analysis Engine
Public Member Functions | List of all members
TermPatternOp Class Referenceabstract

A user defined p-code op that has a dynamically defined procedure. More...

#include <userop.hh>

Inheritance diagram for TermPatternOp:
Inheritance graph
[legend]
Collaboration diagram for TermPatternOp:
Collaboration graph
[legend]

Public Member Functions

virtual int4 getNumVariableTerms (void) const =0
 Get the number of input Varnodes expected.
 
virtual bool unify (Funcdata &data, PcodeOp *op, vector< Varnode * > &bindlist) const =0
 Gather the formal input Varnode objects given the root PcodeOp. More...
 
virtual uintb execute (const vector< uintb > &input) const =0
 Compute the output value of this operation, given constant inputs. More...
 
- Public Member Functions inherited from UserPcodeOp
virtual string getOperatorName (const PcodeOp *op) const
 Get the symbol representing this operation in decompiled code. More...
 
virtual void restoreXml (const Element *el)=0
 Restore the detailed description from an XML stream. More...
 

Additional Inherited Members

- Protected Attributes inherited from UserPcodeOp
string name
 Low-level name of p-code operator.
 
int4 useropindex
 Index passed in the CALLOTHER op.
 
Architectureglb
 Architecture owning the user defined op.
 

Detailed Description

A user defined p-code op that has a dynamically defined procedure.

The behavior of this op on constant inputs can be dynamically defined. This class defines a unify() method that picks out the input varnodes to the operation, given the root PcodeOp. The input varnodes would generally just be the input varnodes to the raw CALLOTHER after the constant id, but skipping, reordering, or other tree traversal is possible.

This class also defines an execute() method that computes the output given constant inputs (matching the format determined by unify()).

Member Function Documentation

◆ execute()

virtual uintb TermPatternOp::execute ( const vector< uintb > &  input) const
pure virtual

Compute the output value of this operation, given constant inputs.

Parameters
inputis the ordered list of constant inputs
Returns
the resulting value as a constant

Implemented in SegmentOp.

◆ unify()

virtual bool TermPatternOp::unify ( Funcdata data,
PcodeOp op,
vector< Varnode * > &  bindlist 
) const
pure virtual

Gather the formal input Varnode objects given the root PcodeOp.

Parameters
datais the function being analyzed
opis the root operation
bindlistwill hold the ordered list of input Varnodes
Returns
true if the requisite inputs were found

Implemented in SegmentOp.


The documentation for this class was generated from the following file: