18 #ifndef __SUBVARIABLE_FLOW__ 19 #define __SUBVARIABLE_FLOW__ 42 class ReplaceVarnode {
58 ReplaceVarnode *output;
59 vector<ReplaceVarnode *> input;
82 bool returnsTraversed;
84 bool sextrestrictions;
86 map<Varnode *,ReplaceVarnode> varmap;
87 list<ReplaceVarnode> newvarlist;
88 list<ReplaceOp> oplist;
89 list<PatchRecord> patchlist;
90 vector<ReplaceVarnode *> worklist;
92 static int4 doesOrSet(
PcodeOp *orop,uintb mask);
93 static int4 doesAndClear(
PcodeOp *andop,uintb mask);
94 Address getReplacementAddress(ReplaceVarnode *rvn)
const;
95 ReplaceVarnode *setReplacement(
Varnode *vn,uintb mask,
bool &inworklist);
96 ReplaceOp *createOp(
OpCode opc,int4 numparam,ReplaceVarnode *outrvn);
97 ReplaceOp *createOpDown(
OpCode opc,int4 numparam,
PcodeOp *op,ReplaceVarnode *inrvn,int4 slot);
98 bool tryCallPull(
PcodeOp *op,ReplaceVarnode *rvn,int4 slot);
99 bool tryReturnPull(
PcodeOp *op,ReplaceVarnode *rvn,int4 slot);
100 bool tryCallReturnPush(
PcodeOp *op,ReplaceVarnode *rvn);
101 bool trySwitchPull(
PcodeOp *op,ReplaceVarnode *rvn);
102 bool traceForward(ReplaceVarnode *rvn);
103 bool traceBackward(ReplaceVarnode *rvn);
104 bool traceForwardSext(ReplaceVarnode *rvn);
105 bool traceBackwardSext(ReplaceVarnode *rvn);
106 bool createLink(ReplaceOp *rop,uintb mask,int4 slot,
Varnode *vn);
107 bool createCompareBridge(
PcodeOp *op,ReplaceVarnode *inrvn,int4 slot,
Varnode *othervn);
108 void addPush(
PcodeOp *pushOp,ReplaceVarnode *rvn);
109 void addTerminalPatch(
PcodeOp *pullop,ReplaceVarnode *rvn);
110 void addTerminalPatchSameOp(
PcodeOp *pullop,ReplaceVarnode *rvn,int4 slot);
111 void addBooleanPatch(
PcodeOp *pullop,ReplaceVarnode *rvn,int4 slot);
112 void addSuggestedPatch(ReplaceVarnode *rvn,
PcodeOp *pushop,int4 sa);
113 void addComparePatch(ReplaceVarnode *in1,ReplaceVarnode *in2,
PcodeOp *op);
114 ReplaceVarnode *addConstant(ReplaceOp *rop,uintb mask,uint4 slot,uintb val);
115 void createNewOut(ReplaceOp *rop,uintb mask);
116 void replaceInput(ReplaceVarnode *rvn);
117 bool useSameAddress(ReplaceVarnode *rvn);
118 Varnode *getReplaceVarnode(ReplaceVarnode *rvn);
119 bool processNextWork(
void);
134 vector<TransformVar *> worklist;
139 bool processNextWork(
void);
152 int4 terminatorCount;
154 vector<TransformVar *> worklist;
158 bool processNextWork(
void);
161 virtual bool preserveAddress(
Varnode *vn,int4 bitSize,int4 lsbOffset)
const;
176 vector<WorkNode> workList;
177 bool allowSubpieceTerminator;
184 bool buildStore(
PcodeOp *op,int4 numLanes,int4 skipLanes);
187 bool traceForward(
TransformVar *rvn,int4 numLanes,int4 skipLanes);
188 bool traceBackward(
TransformVar *rvn,int4 numLanes,int4 skipLanes);
189 bool processNextWork(
void);
OpCode
The op-code defining a specific p-code operation (PcodeOp)
Definition: opcodes.hh:35
Definition: subflow.hh:165
Container for data structures associated with a single function.
Definition: funcdata.hh:45
Class for tracing changes of precision in floating point variables.
Definition: subflow.hh:150
Utilities for processing data structures associated with a single function.
Lowest level operation of the p-code language.
Definition: op.hh:58
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
Class for shrinking big Varnodes carrying smaller logical values.
Definition: subflow.hh:39
LaneDivide(Funcdata *f, Varnode *root, const LaneDescription &desc, bool allowDowncast)
Constructor.
Definition: subflow.cc:2469
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
bool doTrace(void)
Trace logical value through data-flow, constructing transform.
Definition: subflow.cc:1302
Description of logical lanes within a big Varnode.
Definition: transform.hh:126
Class for splitting up Varnodes that hold 2 logical variables.
Definition: subflow.hh:132
void doReplacement(void)
Perform the discovered transform, making logical values explicit.
Definition: subflow.cc:1327
SubvariableFlow(Funcdata *f, Varnode *root, uintb mask, bool aggr, bool sext, bool big)
Constructor.
Definition: subflow.cc:1264