decompiler  1.0.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ghidra::TransformVar Class Reference

Placeholder node for Varnode that will exist after a transform is applied to a function. More...

#include <transform.hh>

Public Types

enum  {
  piece = 1, preexisting = 2, normal_temp = 3, piece_temp = 4,
  constant = 5, constant_iop = 6
}
 Types of replacement Varnodes. More...
 
enum  { split_terminator = 1, input_duplicate = 2 }
 Flags for a TransformVar. More...
 

Public Member Functions

VarnodegetOriginal (void) const
 Get the original Varnode this placeholder models.
 
TransformOpgetDef (void) const
 Get the operator that defines this placeholder variable.
 

Private Member Functions

void createReplacement (Funcdata *fd)
 Create the new/modified variable this placeholder represents. More...
 
void initialize (uint4 tp, Varnode *v, int4 bits, int4 bytes, uintb value)
 Initialize this variable from raw data. More...
 

Private Attributes

Varnodevn
 Original big Varnode of which this is a component.
 
Varnodereplacement
 The new explicit lane Varnode.
 
uint4 type
 Type of new Varnode.
 
uint4 flags
 Boolean properties of the placeholder.
 
int4 byteSize
 Size of the lane Varnode in bytes.
 
int4 bitSize
 Size of the logical value in bits.
 
uintb val
 Value of constant or (bit) position within the original big Varnode.
 
TransformOpdef
 Defining op for new Varnode.
 

Friends

class TransformManager
 
class TransformOp
 

Detailed Description

Placeholder node for Varnode that will exist after a transform is applied to a function.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Types of replacement Varnodes.

Enumerator
piece 

New Varnode is a piece of an original Varnode.

preexisting 

Varnode preexisted in the original data-flow.

normal_temp 

A new temporary (unique space) Varnode.

piece_temp 

A temporary representing a piece of an original Varnode.

constant 

A new constant Varnode.

constant_iop 

Special iop constant encoding a PcodeOp reference.

◆ anonymous enum

anonymous enum

Flags for a TransformVar.

Enumerator
split_terminator 

The last (most significant piece) of a split array.

input_duplicate 

This is a piece of an input that has already been visited.

Member Function Documentation

◆ createReplacement()

void ghidra::TransformVar::createReplacement ( Funcdata fd)
private

Create the new/modified variable this placeholder represents.

Create the Varnode object (constant, unique, vector piece) described by the given placeholder. If the Varnode is an output, assume the op already exists and create the Varnode as an output. Set the replacement field with the new Varnode.

Parameters
fdis the function in which to create the replacement

References constant, constant_iop, ghidra::Funcdata::getArch(), ghidra::AddrSpaceManager::getIopSpace(), ghidra::PcodeOp::getOpFromConst(), ghidra::Funcdata::newConstant(), ghidra::Funcdata::newUnique(), ghidra::Funcdata::newUniqueOut(), ghidra::Funcdata::newVarnode(), ghidra::Funcdata::newVarnodeIop(), ghidra::Funcdata::newVarnodeOut(), normal_temp, piece, piece_temp, preexisting, ghidra::Address::renormalize(), and ghidra::Funcdata::transferVarnodeProperties().

Referenced by ghidra::TransformManager::createVarnodes().

◆ initialize()

void ghidra::TransformVar::initialize ( uint4  tp,
Varnode v,
int4  bits,
int4  bytes,
uintb  value 
)
inlineprivate

Initialize this variable from raw data.

Parameters
tpis the type of variable to create
vis the underlying Varnode of which this is a piece (may be null)
bitsis the number of bits in the variable
bytesis the number of bytes in the variable
valueis the associated value

References bitSize, byteSize, def, flags, replacement, type, val, and vn.

Referenced by ghidra::TransformManager::newConstant(), ghidra::TransformManager::newIop(), ghidra::TransformManager::newPiece(), ghidra::TransformManager::newPreexistingVarnode(), ghidra::TransformManager::newSplit(), and ghidra::TransformManager::newUnique().


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