Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::DatatypeUserOp Class Reference

Generic user defined operation that provides input/output data-types. More...

#include <userop.hh>

Inheritance diagram for ghidra::DatatypeUserOp:
[legend]
Collaboration diagram for ghidra::DatatypeUserOp:
[legend]

Public Member Functions

 DatatypeUserOp (const string &nm, Architecture *g, int4 ind, Datatype *out, Datatype *in0=(Datatype *) 0, Datatype *in1=(Datatype *) 0, Datatype *in2=(Datatype *) 0, Datatype *in3=(Datatype *) 0)
 Constructor given specific input/output data-types.
 
virtual DatatypegetOutputLocal (const PcodeOp *op) const
 Return the output data-type of the user-op if specified.
 
virtual DatatypegetInputLocal (const PcodeOp *op, int4 slot) const
 Return the input data-type to the user-op in the given slot.
 
virtual void decode (Decoder &decoder)
 Restore the detailed description from a stream element.
 
- Public Member Functions inherited from ghidra::UserPcodeOp
 UserPcodeOp (const string &nm, Architecture *g, uint4 tp, int4 ind)
 Construct from name and index.
 
const string & getName (void) const
 Get the low-level name of the p-code op.
 
uint4 getType (void) const
 Get the encoded class type.
 
int4 getIndex (void) const
 Get the constant id of the op.
 
uint4 getDisplay (void) const
 Get display type (0=functional)
 
virtual ~UserPcodeOp (void)
 Destructor.
 
virtual string getOperatorName (const PcodeOp *op) const
 Get the symbol representing this operation in decompiled code.
 
virtual int4 extractAnnotationSize (const Varnode *vn, const PcodeOp *op)
 Assign a size to an annotation input to this userop.
 

Private Attributes

DatatypeoutType
 Data-type of the output.
 
vector< Datatype * > inTypes
 Data-type of the input(s)
 

Additional Inherited Members

- Public Types inherited from ghidra::UserPcodeOp
enum  userop_flags { annotation_assignment = 1 , no_operator = 2 , display_string = 4 }
 Enumeration of different boolean properties that can be assigned to a CALLOTHER. More...
 
enum  userop_type {
  unspecialized = 1 , injected = 2 , volatile_read = 3 , volatile_write = 4 ,
  segment = 5 , jumpassist = 6 , string_data = 7 , datatype = 8
}
 User-op class encoded as an enum. More...
 
- Static Public Attributes inherited from ghidra::UserPcodeOp
static const uint4 BUILTIN_STRINGDATA = 0x10000000
 Built-in id for the InternalStringOp.
 
static const uint4 BUILTIN_VOLATILE_READ = 0x10000001
 Built-in id for VolatileReadOp.
 
static const uint4 BUILTIN_VOLATILE_WRITE = 0x10000002
 Built-in id for VolatileWriteOp.
 
static const uint4 BUILTIN_MEMCPY = 0x10000003
 Built-in id for memcpy.
 
static const uint4 BUILTIN_STRNCPY = 0x10000004
 Built-in id for strcpy.
 
static const uint4 BUILTIN_WCSNCPY = 0x10000005
 Built-in id for wcsncpy.
 
- Protected Attributes inherited from ghidra::UserPcodeOp
string name
 Low-level name of p-code operator.
 
Architectureglb
 Architecture owning the user defined op.
 
uint4 type
 Encoded class type (userop_type)
 
int4 useropindex
 Index passed in the CALLOTHER op.
 
uint4 flags
 Boolean attributes of the CALLOTHER.
 

Detailed Description

Generic user defined operation that provides input/output data-types.

The CALLOTHER acts a source of data-type information within data-flow.

Constructor & Destructor Documentation

◆ DatatypeUserOp()

ghidra::DatatypeUserOp::DatatypeUserOp ( const string &  nm,
Architecture g,
int4  ind,
Datatype out,
Datatype in0 = (Datatype *)0,
Datatype in1 = (Datatype *)0,
Datatype in2 = (Datatype *)0,
Datatype in3 = (Datatype *)0 
)

Constructor given specific input/output data-types.

An optional output data-type for the CALLOTHER can be specified and up to 4 input data-types associated with the first 4 inputs to the CALLOTHER (after the userop id in slot 0).

Parameters
nmis the name to associate with the user-op
gis the Architecture owning the new user-op
indis the id associated with the user-op
outis the data-type to associate with the CALLOTHER output (may be null)
in0is the first input data-type (may be null)
in1is the second input data-type (may be null)
in2is the third input data-type (may be null)
in3is the fourth input data-type (may be null)

References inTypes, and outType.

Member Function Documentation

◆ decode()

virtual void ghidra::DatatypeUserOp::decode ( Decoder decoder)
inlinevirtual

Restore the detailed description from a stream element.

The details of how a user defined operation behaves are parsed from the element.

Parameters
decoderis the stream decoder

Implements ghidra::UserPcodeOp.

◆ getInputLocal()

Datatype * ghidra::DatatypeUserOp::getInputLocal ( const PcodeOp op,
int4  slot 
) const
virtual

Return the input data-type to the user-op in the given slot.

Parameters
opif the instantiation of the user-op
slotis the given input slot
Returns
the data-type or null to indicate the data-type is unspecified

Reimplemented from ghidra::UserPcodeOp.

References inTypes.

◆ getOutputLocal()

Datatype * ghidra::DatatypeUserOp::getOutputLocal ( const PcodeOp op) const
virtual

Return the output data-type of the user-op if specified.

Parameters
opis the instantiation of the user-op
Returns
the data-type or null to indicate the data-type is unspecified

Reimplemented from ghidra::UserPcodeOp.

References outType.


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