Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
83 vector<FuncCallSpecs *> &qlst;
85 vector<Address> unprocessed;
86 vector<Address> addrlist;
87 vector<PcodeOp *> tablelist;
88 vector<PcodeOp *> injectlist;
89 map<Address,VisitStat> visited;
90 list<PcodeOp *> block_edge1;
91 list<PcodeOp *> block_edge2;
98 bool flowoverride_present;
101 set<Address> *inline_recursion;
102 set<Address> inline_base;
105 void clearProperties(
void);
106 bool seenInstruction(
const Address &addr)
const {
107 return (visited.find(addr) != visited.end()); }
110 void deleteRemainingOps(list<PcodeOp *>::const_iterator oiter);
111 PcodeOp *xrefControlFlow(list<PcodeOp *>::const_iterator oiter,
bool &startbasic,
bool &isfallthru,
FuncCallSpecs *fc);
112 bool processInstruction(
const Address &curaddr,
bool &startbasic);
115 void findUnprocessed(
void);
116 void dedupUnprocessed(
void);
117 void fillinBranchStubs(
void);
118 void collectEdges(
void);
119 void splitBasic(
void);
120 void connectBasic(
void);
121 bool setFallthruBound(
Address &bound);
122 void handleOutOfBounds(
const Address &fromaddr,
const Address &toaddr);
124 void reinterpreted(
const Address &addr);
129 void xrefInlinedBranch(
PcodeOp *op);
131 void injectUserOp(
PcodeOp *op);
134 void checkContainedCall(
void);
135 void checkMultistageJumptables(
void);
137 void truncateIndirectJump(
PcodeOp *op,int4 failuremode);
138 static bool isInArray(vector<PcodeOp *> &array,
PcodeOp *op);
142 void setRange(
const Address &b,
const Address &e) { baddr = b; eaddr = e; }
143 void setMaximumInstructions(uint4 max) { insn_max = max; }
144 void setFlags(uint4 val) { flags |= val; }
145 void clearFlags(uint4 val) { flags &= ~val; }
156 int4 getSize(
void)
const {
return (int4)(maxaddr.
getOffset() - minaddr.
getOffset()); }
157 bool hasInject(
void)
const {
return !injectlist.empty(); }
163 bool isFlowForInline(
void)
const {
return ((flags &
flow_forinline)!=0); }
bool testHardInlineRestrictions(Funcdata *inlinefd, PcodeOp *op, Address &retaddr)
For in-lining using the hard model, make sure some restrictions are met.
Definition: flow.cc:1106
@ error_toomanyinstructions
Throw an exception if too many instructions are encountered.
Definition: flow.hh:63
A control-flow block built out of sub-components.
Definition: block.hh:271
void generateBlocks(void)
Generate basic blocks from the raw control-flow.
Definition: flow.cc:797
@ toomanyinstructions_present
Indicate the maximum instruction threshold was reached.
Definition: flow.hh:68
@ outofbounds_present
Indicate we have encountered flow out of the specified range.
Definition: flow.hh:66
PcodeOp * target(const Address &addr) const
Return first p-code op for instruction at given address.
Definition: flow.cc:113
A class for uniquely labelling and comparing PcodeOps.
Definition: address.hh:111
@ flow_forinline
Indicate flow is being generated to in-line (a function)
Definition: flow.hh:70
Container class for PcodeOps associated with a single function.
Definition: op.hh:253
void generateOps(void)
Generate raw control-flow from the function's base address.
Definition: flow.cc:749
@ error_outofbounds
Throw an exception for flow into addresses out of the specified range.
Definition: flow.hh:60
@ possible_unreachable
Indicate a CALL was converted to a BRANCH and some code may be unreachable.
Definition: flow.hh:69
A p-code emitter for building PcodeOp objects.
Definition: funcdata.hh:563
@ error_unimplemented
Throw an exception for flow into unimplemented instructions.
Definition: flow.hh:61
PcodeOp * branchTarget(PcodeOp *op) const
Find the target referred to by a given BRANCH or CBRANCH.
Definition: flow.cc:185
uintb getOffset(void) const
Get the address offset.
Definition: address.hh:300
@ record_jumploads
Indicate that any jump table recovery should record the table structure.
Definition: flow.hh:71
A class for generating the control-flow structure for a single function.
Definition: flow.hh:56
A class for analyzing parameters to a sub-function call.
Definition: fspec.hh:1449
Lowest level operation of the p-code language.
Definition: op.hh:58
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
Context needed to emit a p-code injection as a full set of p-code operations.
Definition: pcodeinject.hh:56
An active container for a set of p-code operations that can be injected into data-flow.
Definition: pcodeinject.hh:78
Utilities for processing data structures associated with a single function.
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
Container for data structures associated with a single function.
Definition: funcdata.hh:45
@ reinterpreted_present
Indicate we have encountered reinterpreted data.
Definition: flow.hh:67
@ baddata_present
Indicate we have encountered flow into unaccessible data.
Definition: flow.hh:65
@ error_reinterpreted
Throw an exception for flow into previously encountered data at a difference cut.
Definition: flow.hh:62
@ ignore_outofbounds
Ignore/truncate flow into addresses out of the specified range.
Definition: flow.hh:58
void injectPcode(void)
Perform substitution on any op that requires injection.
Definition: flow.cc:1290
@ ignore_unimplemented
Treat unimplemented instructions as a NOP (no operation)
Definition: flow.hh:59
FlowInfo(Funcdata &d, PcodeOpBank &o, BlockGraph &b, vector< FuncCallSpecs * > &q)
Constructor.
Definition: flow.cc:24
void inlineClone(const FlowInfo &inlineflow, const Address &retaddr)
Clone the given in-line flow into this flow using the hard model.
Definition: flow.cc:1047
void forwardRecursion(const FlowInfo &op2)
Pull in-lining recursion information from another flow.
Definition: flow.cc:1016
bool checkEZModel(void) const
Check if this flow matches the EX in-lining model.
Definition: flow.cc:1138
void inlineEZClone(const FlowInfo &inlineflow, const Address &calladdr)
Clone the given in-line flow into this flow using the EZ model.
Definition: flow.cc:1081
@ unimplemented_present
Indicate we have encountered unimplemented instructions.
Definition: flow.hh:64