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

Collapse two COPYs into contiguous address forced Varnodes. More...

#include <double.hh>

Collaboration diagram for ghidra::CopyForceForm:
[legend]

Public Member Functions

bool verify (Varnode *h, Varnode *l, Varnode *w, PcodeOp *cpy)
 Make sure the COPYs have the correct form.
 
bool applyRule (SplitVarnode &i, PcodeOp *cpy, bool workishi, Funcdata &data)
 

Private Attributes

SplitVarnode in
 Incoming pieces to COPY.
 
Varnodereslo
 Least significant result of global COPY.
 
Varnodereshi
 Most significant result of global COPY.
 
PcodeOpcopylo
 Partial COPY of least significant piece.
 
PcodeOpcopyhi
 Partial COPY of most significant piece.
 
Address addrOut
 Storage address.
 

Detailed Description

Collapse two COPYs into contiguous address forced Varnodes.

The inputs must be pieces of a logical whole and outputs must be address forced with no descendants. Take into account special form of COPYs holding global variables upto/past a RETURN.

Member Function Documentation

◆ applyRule()

bool ghidra::CopyForceForm::applyRule ( SplitVarnode i,
PcodeOp cpy,
bool  workishi,
Funcdata data 
)
Parameters
iis the putative input to the COPYs
cpyis a putative COPY
workishiis true if the COPY is of the most significant piece
datais the function

References addrOut, copyhi, copylo, ghidra::SplitVarnode::getHi(), ghidra::SplitVarnode::getLo(), ghidra::SplitVarnode::getWhole(), ghidra::SplitVarnode::hasBothPieces(), in, ghidra::SplitVarnode::replaceCopyForce(), and verify().

Referenced by ghidra::SplitVarnode::applyRuleIn().

◆ verify()

bool ghidra::CopyForceForm::verify ( Varnode h,
Varnode l,
Varnode w,
PcodeOp cpy 
)

Make sure the COPYs have the correct form.

Starting with the input pieces, identify the matching COPYs and verify that they act as a single address forced COPY with no descendants.

Parameters
his the most significant input piece
lis the least significant input piece
wis the preexisting logical whole
cpyis the COPY of the most significant piece

References addrOut, ghidra::Varnode::beginDescend(), ghidra::PcodeOp::code(), copyhi, copylo, ghidra::CPUI_COPY, ghidra::Varnode::endDescend(), ghidra::Varnode::getAddr(), ghidra::Varnode::getDef(), ghidra::PcodeOp::getIn(), ghidra::PcodeOp::getOut(), ghidra::PcodeOp::getParent(), ghidra::Varnode::hasNoDescend(), ghidra::Varnode::isAddrForce(), ghidra::SplitVarnode::isAddrTiedContiguous(), ghidra::PcodeOp::isReturnCopy(), ghidra::Varnode::isWritten(), ghidra::Varnode::loneDescend(), reshi, and reslo.

Referenced by applyRule().


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