Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
19 #ifndef __CPUI_JUMPTABLE__
20 #define __CPUI_JUMPTABLE__
49 LoadTable(
const Address &ad,int4 sz,int4 nm) { addr = ad; size = sz; num = nm; }
50 bool operator<(
const LoadTable &op2)
const {
return (addr < op2.addr); }
71 RootedOp(
PcodeOp *o,int4 root) { op = o; rootVn = root; }
73 vector<Varnode *> commonVn;
74 vector<RootedOp> opMeld;
75 void internalIntersect(vector<int4> &parentMap);
76 int4 meldOps(
const vector<PcodeOpNode> &path,int4 cutOff,
const vector<int4> &parentMap);
77 void truncatePaths(int4 cutPoint);
80 void set(
const vector<PcodeOpNode> &path);
84 void meld(vector<PcodeOpNode> &path);
85 void markPaths(
bool val,int4 startVarnode);
86 int4 numCommonVarnode(
void)
const {
return commonVn.size(); }
87 int4 numOps(
void)
const {
return opMeld.size(); }
88 Varnode *getVarnode(int4 i)
const {
return commonVn[i]; }
89 Varnode *getOpParent(int4 i)
const {
return commonVn[ opMeld[i].rootVn ]; }
90 PcodeOp *getOp(int4 i)
const {
return opMeld[i].op; }
92 bool empty(
void)
const {
return commonVn.empty(); }
102 map<Varnode *,uintb> varnodeMap;
104 vector<LoadTable> loadpoints;
105 virtual void executeLoad(
void);
106 virtual void executeBranch(
void);
107 virtual void executeBranchind(
void);
108 virtual void executeCall(
void);
109 virtual void executeCallind(
void);
110 virtual void executeCallother(
void);
111 virtual void fallthruOp(
void);
114 void setLoadCollect(
bool val) { collectloads = val; }
140 PcodeOp *getBranch(
void)
const {
return cbranch; }
141 PcodeOp *getReadOp(
void)
const {
return readOp; }
142 int4 getPath(
void)
const {
return indpath; }
143 const CircleRange &getRange(
void)
const {
return range; }
144 void clear(
void) { cbranch = (
PcodeOp *)0; }
160 virtual uintb
getSize(
void)
const=0;
161 virtual bool contains(uintb val)
const=0;
168 virtual bool next(
void)
const=0;
169 virtual uintb
getValue(
void)
const=0;
188 virtual uintb
getSize(
void)
const;
189 virtual bool contains(uintb val)
const;
191 virtual bool next(
void)
const;
207 mutable bool lastvalue;
209 void setExtraValue(uintb val) { extravalue = val; }
210 void setDefaultVn(
Varnode *vn) { extravn = vn; }
211 void setDefaultOp(
PcodeOp *op) { extraop = op; }
212 virtual uintb
getSize(
void)
const;
213 virtual bool contains(uintb val)
const;
215 virtual bool next(
void)
const;
268 virtual void findUnnormalized(uint4 maxaddsub,uint4 maxleftright,uint4 maxext)=0;
311 virtual void clear(
void) {}
312 virtual void saveXml(ostream &s)
const {}
384 virtual void findUnnormalized(uint4 maxaddsub,uint4 maxleftright,uint4 maxext);
390 virtual void clear(
void);
408 bool checkNormalDominance(
void)
const;
414 virtual void findUnnormalized(uint4 maxaddsub,uint4 maxleftright,uint4 maxext);
416 virtual void clear(
void);
427 vector<uintb> values;
428 vector<Address> addrtable;
435 void setupTrivial(
void);
437 void clearCopySpecific(
void);
441 void setNorm(
const Address &addr,uintb h) { normaddress = addr; hash = h; }
442 void setStartingValue(uintb val) { startingvalue = val; }
453 virtual void clear(
void);
454 virtual void saveXml(ostream &s)
const;
490 virtual void clear(
void) { assistOp = (
PcodeOp *)0; switchvn = (
Varnode *)0; }
504 IndexPair(int4 pos,int4 index) { blockPosition = pos; addressIndex = index; }
505 bool operator<(
const IndexPair &op2)
const;
506 static bool compareByPosition(
const IndexPair &op1,
const IndexPair &op2);
511 vector<Address> addresstable;
512 vector<IndexPair> block2addr;
514 vector<LoadTable> loadpoints;
517 uintb switchVarConsume;
527 void trivialSwitchOver(
void);
529 int4 block2Position(
const FlowBlock *bl)
const;
530 static bool isReachable(
PcodeOp *op);
535 bool isRecovered(
void)
const {
return !addresstable.empty(); }
536 bool isLabelled(
void)
const {
return !label.empty(); }
538 bool isPossibleMultistage(
void)
const {
return (addresstable.size()==1); }
539 int4 getStage(
void)
const {
return recoverystage; }
540 int4 numEntries(
void)
const {
return addresstable.size(); }
541 uintb getSwitchVarConsume(
void)
const {
return switchVarConsume; }
542 int4 getDefaultBlock(
void)
const {
return defaultBlock; }
543 const Address &getOpAddress(
void)
const {
return opaddress; }
544 PcodeOp *getIndirectOp(
void)
const {
return indirect; }
545 void setIndirectOp(
PcodeOp *ind) { opaddress = ind->getAddr(); indirect = ind; }
546 void setMaxTableSize(uint4 val) { maxtablesize = val; }
547 void setNormMax(uint4 maddsub,uint4 mleftright,uint4 mext) {
548 maxaddsub = maddsub; maxleftright = mleftright; maxext = mext; }
549 void setOverride(
const vector<Address> &addrtable,
const Address &naddr,uintb h,uintb sv);
552 Address getAddressByIndex(int4 i)
const {
return addresstable[i]; }
554 void setDefaultBlock(int4 bl) { defaultBlock = bl; }
555 void setLoadCollect(
bool val) { collectloads = val; }
558 uintb getLabelByIndex(int4 index)
const {
return label[index]; }
566 void saveXml(ostream &s)
const;
572 inline bool JumpTable::IndexPair::operator<(
const IndexPair &op2)
const
575 if (blockPosition != op2.blockPosition)
return (blockPosition < op2.blockPosition);
576 return (addressIndex < op2.addressIndex);
582 inline bool JumpTable::IndexPair::compareByPosition(
const IndexPair &op1,
const IndexPair &op2)
585 return (op1.blockPosition < op2.blockPosition);
void clear(void)
Clear this to be an empty container.
Definition: jumptable.cc:907
PcodeOp * getEarliestOp(int4 pos) const
Find earliest PcodeOp that has a specific common Varnode as input.
Definition: jumptable.cc:973
Documentation for the CircleRange class.
virtual void buildAddresses(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable, vector< LoadTable > *loadpoints) const =0
Construct the explicit list of target addresses (the Address Table) from this model.
void setAddresses(const vector< Address > &adtable)
Manually set the address table for this model.
Definition: jumptable.cc:1649
Architecture * glb
The underlying Architecture for the program being emulated.
Definition: emulateutil.hh:43
virtual JumpValues * clone(void) const
Clone this iterator.
Definition: jumptable.cc:312
static int4 oneOffMatch(PcodeOp *op1, PcodeOp *op2)
Return 1 if the two given PcodeOps produce exactly the same value, 0 if otherwise.
Definition: jumptable.cc:634
A (putative) switch variable Varnode and a constraint imposed by a CBRANCH.
Definition: jumptable.hh:130
virtual void setExecuteAddress(const Address &addr)
Set the address of the next instruction to emulate.
Definition: jumptable.cc:131
virtual int4 getTableSize(void) const
Return the number of entries in the address table.
Definition: jumptable.hh:444
virtual void buildLabels(Funcdata *fd, vector< Address > &addresstable, vector< uintb > &label, const JumpModel *orig) const
Recover case labels associated with the Address table.
Definition: jumptable.cc:399
bool isOverride(void) const
Return true if this table was manually overridden.
Definition: jumptable.cc:2277
virtual bool isOverride(void) const
Return true if this model was manually overridden.
Definition: jumptable.hh:326
Description of a control-flow block containing PcodeOps.
Definition: block.hh:60
virtual void findUnnormalized(uint4 maxaddsub, uint4 maxleftright, uint4 maxext)
Recover the unnormalized switch variable.
Definition: jumptable.cc:1603
The lowest level error generated by the decompiler.
Definition: error.hh:44
virtual bool sanityCheck(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable)
Perform a sanity check on recovered addresses.
Definition: jumptable.hh:488
virtual JumpModel * clone(JumpTable *jt) const
Clone this model.
Definition: jumptable.cc:2078
void switchOver(const FlowInfo &flow)
Convert absolute addresses to block indices.
Definition: jumptable.cc:2358
virtual PcodeOp * getStartOp(void) const
Get the PcodeOp associated with the current value.
Definition: jumptable.cc:362
void clear(void)
Clear instance specific data for this jump-table.
Definition: jumptable.cc:2574
virtual bool isReversible(void) const
Return true if the current value can be reversed to get a label.
Definition: jumptable.hh:195
virtual void findUnnormalized(uint4 maxaddsub, uint4 maxleftright, uint4 maxext)=0
Recover the unnormalized switch variable.
virtual uintb getSize(void) const
Return the number of values the variables can take.
Definition: jumptable.cc:322
Emulation based on (existing) PcodeOps and Varnodes.
Definition: emulateutil.hh:41
CircleRange range
Acceptable range of values for the normalized switch variable.
Definition: jumptable.hh:179
A map from values to control-flow targets within a function.
Definition: jumptable.hh:499
virtual int4 getTableSize(void) const =0
Return the number of entries in the address table.
void saveXml(ostream &s) const
Save this jump-table as a <jumptable> XML tag.
Definition: jumptable.cc:2600
virtual Varnode * getStartVarnode(void) const
Get the Varnode associated with the current value.
Definition: jumptable.cc:300
virtual bool isReversible(void) const
Return true if the current value can be reversed to get a label.
Definition: jumptable.hh:218
The basic switch model.
Definition: jumptable.hh:344
virtual void buildLabels(Funcdata *fd, vector< Address > &addresstable, vector< uintb > &label, const JumpModel *orig) const
Recover case labels associated with the Address table.
Definition: jumptable.cc:2028
virtual bool contains(uintb val) const =0
Return true if the given value is in the set of possible values.
void findSmallestNormal(uint4 matchsize)
Find the putative switch variable with the smallest range of values reaching the switch.
Definition: jumptable.cc:1120
virtual int4 getTableSize(void) const
Return the number of entries in the address table.
Definition: jumptable.hh:327
virtual bool contains(uintb val) const
Return true if the given value is in the set of possible values.
Definition: jumptable.cc:274
virtual bool foldInGuards(Funcdata *fd, JumpTable *jump)
Eliminate any guard code involved in computing the switch destination.
Definition: jumptable.hh:333
static bool isprune(Varnode *vn)
Do we prune in here in our depth-first search for the normalized switch variable.
Definition: jumptable.cc:416
void restoreXml(const Element *el, Architecture *glb)
Read in this table from a <loadtable> XML description.
Definition: jumptable.cc:34
virtual void buildAddresses(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable, vector< LoadTable > *loadpoints) const
Construct the explicit list of target addresses (the Address Table) from this model.
Definition: jumptable.cc:1850
virtual int4 getTableSize(void) const
Return the number of entries in the address table.
Definition: jumptable.hh:381
virtual void buildAddresses(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable, vector< LoadTable > *loadpoints) const
Construct the explicit list of target addresses (the Address Table) from this model.
Definition: jumptable.cc:1993
virtual bool contains(uintb val) const
Return true if the given value is in the set of possible values.
Definition: jumptable.cc:328
virtual bool initializeForReading(void) const
Initialize this for iterating over the set of possible values.
Definition: jumptable.cc:336
int4 varnodeIndex
Position of the normalized switch Varnode within PathMeld.
Definition: jumptable.hh:349
virtual bool isOverride(void) const
Return true if this model was manually overridden.
Definition: jumptable.hh:380
virtual void findUnnormalized(uint4 maxaddsub, uint4 maxleftright, uint4 maxext)
Recover the unnormalized switch variable.
Definition: jumptable.hh:484
A class for generating the control-flow structure for a single function.
Definition: flow.hh:56
virtual Varnode * foldInNormalization(Funcdata *fd, PcodeOp *indop)
Do normalization of the given switch specific to this model.
Definition: jumptable.hh:332
An XML element. A node in the DOM tree.
Definition: xml.hh:150
static Varnode * quasiCopy(Varnode *vn, int4 &bitsPreserved)
Compute the source of a quasi-COPY chain for the given Varnode.
Definition: jumptable.cc:669
virtual JumpValues * clone(void) const
Clone this iterator.
Definition: jumptable.cc:368
A basic block for p-code operations.
Definition: block.hh:365
JumpTable(Architecture *g, Address ad=Address())
Constructor.
Definition: jumptable.cc:2210
void analyzeGuards(BlockBasic *bl, int4 pathout)
Analyze CBRANCHs leading up to the given basic-block as a potential switch guard.
Definition: jumptable.cc:996
virtual bool foldInGuards(Funcdata *fd, JumpTable *jump)
Eliminate any guard code involved in computing the switch destination.
Definition: jumptable.cc:2070
Lowest level operation of the p-code language.
Definition: op.hh:58
virtual bool sanityCheck(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable)
Perform a sanity check on recovered addresses.
Definition: jumptable.hh:451
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
virtual bool sanityCheck(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable)
Perform a sanity check on recovered addresses.
Definition: jumptable.cc:1445
virtual uintb getValue(void) const
Get the current value.
Definition: jumptable.cc:294
Varnode * normqvn
Varnode representing the normalized switch variable.
Definition: jumptable.hh:180
virtual bool isReversible(void) const =0
Return true if the current value can be reversed to get a label.
Exception thrown for a thunk mechanism that looks like a jump-table.
Definition: jumptable.hh:28
All paths from a (putative) switch variable to the CPUI_BRANCHIND.
Definition: jumptable.hh:63
PathMeld pathMeld
Set of PcodeOps and Varnodes producing the final target addresses.
Definition: jumptable.hh:347
void setOverride(const vector< Address > &addrtable, const Address &naddr, uintb h, uintb sv)
Force manual override information on this jump-table.
Definition: jumptable.cc:2296
virtual bool isOverride(void) const
Return true if this model was manually overridden.
Definition: jumptable.hh:480
virtual uintb getSize(void) const =0
Return the number of values the variables can take.
virtual bool isOverride(void) const
Return true if this model was manually overridden.
Definition: jumptable.hh:443
virtual void findUnnormalized(uint4 maxaddsub, uint4 maxleftright, uint4 maxext)
Recover the unnormalized switch variable.
Definition: jumptable.hh:330
A description where and how data was loaded from memory.
Definition: jumptable.hh:41
bool recoverLabels(Funcdata *fd)
Recover the case labels for this jump-table.
Definition: jumptable.cc:2522
virtual Varnode * foldInNormalization(Funcdata *fd, PcodeOp *indop)
Do normalization of the given switch specific to this model.
Definition: jumptable.cc:1419
static void collapseTable(vector< LoadTable > &table)
Collapse a sequence of table descriptions.
Definition: jumptable.cc:51
JumpTable * jumptable
The jump-table that is building this model.
Definition: jumptable.hh:234
virtual JumpModel * clone(JumpTable *jt) const
Clone this model.
Definition: jumptable.cc:406
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
void meld(vector< PcodeOpNode > &path)
Meld a new path into this container.
Definition: jumptable.cc:918
void recoverMultistage(Funcdata *fd)
Recover jump-table addresses keeping track of a possible previous stage.
Definition: jumptable.cc:2478
void saveXml(ostream &s) const
Save a description of this as an <loadtable> XML tag.
Definition: jumptable.cc:21
A basic jump-table model with an added default address path.
Definition: jumptable.hh:405
virtual void buildLabels(Funcdata *fd, vector< Address > &addresstable, vector< uintb > &label, const JumpModel *orig) const
Recover case labels associated with the Address table.
Definition: jumptable.cc:1379
void addBlockToSwitch(BlockBasic *bl, uintb lab)
Force a given basic-block to be a switch destination.
Definition: jumptable.cc:2343
uintb emulatePath(uintb val, const PathMeld &pathMeld, PcodeOp *startop, Varnode *startvn)
Execute from a given starting point and value to the common end-point of the path set.
Definition: jumptable.cc:180
JumpValuesRange * jrange
Range of values for the (normalized) switch variable.
Definition: jumptable.hh:346
static uintb backup2Switch(Funcdata *fd, uintb output, Varnode *outvn, Varnode *invn)
Back up the constant value in the output Varnode to the value in the input Varnode.
Definition: jumptable.cc:464
(Lightweight) emulation interface for executing PcodeOp objects within a syntax tree or for executing...
virtual bool isOverride(void) const =0
Return true if this model was manually overridden.
int4 numIndicesByBlock(const FlowBlock *bl) const
Return the number of address table entries that target the given basic-block.
Definition: jumptable.cc:2268
Varnode * normalvn
Normalized switch Varnode.
Definition: jumptable.hh:350
static bool ispoint(Varnode *vn)
Is it possible for the given Varnode to be a switch variable?
Definition: jumptable.cc:428
virtual uintb getVarnodeValue(Varnode *vn) const
Given a specific Varnode, retrieve the current value for it from the machine state.
Definition: jumptable.cc:143
void markModel(bool val)
Mark (or unmark) all PcodeOps involved in the model.
Definition: jumptable.cc:1208
virtual uintb getValue(void) const =0
Get the current value.
A jump-table execution model.
Definition: jumptable.hh:232
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
virtual uintb getSize(void) const
Return the number of values the variables can take.
Definition: jumptable.cc:268
int4 valueMatch(Varnode *vn2, Varnode *baseVn2, int4 bitsPreserved2) const
Determine if this guard applies to the given Varnode.
Definition: jumptable.cc:587
void setLastAsMostCommon(void)
Set the most common jump-table target to be the last address in the table.
Definition: jumptable.cc:2332
virtual void findUnnormalized(uint4 maxaddsub, uint4 maxleftright, uint4 maxext)
Recover the unnormalized switch variable.
Definition: jumptable.cc:1335
Container for data structures associated with a single function.
Definition: funcdata.hh:45
virtual PcodeOp * getStartOp(void) const =0
Get the PcodeOp associated with the current value.
EmulateFunction(Funcdata *f)
Constructor.
Definition: jumptable.cc:124
LowlevelError(const string &s)
Initialize the error with an explanatory string.
Definition: error.hh:47
single entry switch variable that can take a range of values
Definition: jumptable.hh:177
A light-weight emulator to calculate switch targets from switch variables.
Definition: jumptable.hh:100
A user defined p-code op for assisting the recovery of jump tables.
Definition: userop.hh:229
virtual void buildLabels(Funcdata *fd, vector< Address > &addresstable, vector< uintb > &label, const JumpModel *orig) const
Recover case labels associated with the Address table.
Definition: jumptable.cc:1856
virtual bool foldInGuards(Funcdata *fd, JumpTable *jump)
Eliminate any guard code involved in computing the switch destination.
Definition: jumptable.hh:450
virtual void truncate(int4 nm)=0
Truncate the number of values to the given number.
void markFoldableGuards()
Mark the guard CBRANCHs that are truly part of the model.
Definition: jumptable.cc:1194
virtual bool foldInOneGuard(Funcdata *fd, GuardRecord &guard, JumpTable *jump)
Eliminate the given guard to this switch.
Definition: jumptable.cc:1241
A trivial jump-table model, where the BRANCHIND input Varnode is the switch variable.
Definition: jumptable.hh:322
PcodeOp * startop
First PcodeOp in the jump-table calculation.
Definition: jumptable.hh:181
A class for manipulating integer value ranges.
Definition: rangeutil.hh:48
A basic jump-table model incorporating manual override information.
Definition: jumptable.hh:425
virtual bool recoverModel(Funcdata *fd, PcodeOp *indop, uint4 matchsize, uint4 maxtablesize)
Attempt to recover details of the model, given a specific BRANCHIND.
Definition: jumptable.cc:1822
Varnode * switchvn
Unnormalized switch Varnode.
Definition: jumptable.hh:351
virtual void buildAddresses(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable, vector< LoadTable > *loadpoints) const
Construct the explicit list of target addresses (the Address Table) from this model.
Definition: jumptable.cc:388
void collectLoadPoints(vector< LoadTable > &res) const
Recover any LOAD table descriptions.
Definition: jumptable.cc:223
int4 getIndexByBlock(const FlowBlock *bl, int4 i) const
Get the index of the i-th address table entry that corresponds to the given basic-block.
Definition: jumptable.cc:2315
virtual Varnode * getStartVarnode(void) const =0
Get the Varnode associated with the current value.
virtual bool initializeForReading(void) const
Initialize this for iterating over the set of possible values.
Definition: jumptable.cc:280
virtual bool sanityCheck(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable)
Perform a sanity check on recovered addresses.
Definition: jumptable.hh:334
virtual bool foldInGuards(Funcdata *fd, JumpTable *jump)=0
Eliminate any guard code involved in computing the switch destination.
void markPaths(bool val, int4 startVarnode)
Mark PcodeOps paths from the given start.
Definition: jumptable.cc:950
virtual bool recoverModel(Funcdata *fd, PcodeOp *indop, uint4 matchsize, uint4 maxtablesize)
Attempt to recover details of the model, given a specific BRANCHIND.
Definition: jumptable.cc:381
virtual bool initializeForReading(void) const =0
Initialize this for iterating over the set of possible values.
bool checkForMultistage(Funcdata *fd)
Check if this jump-table requires an additional recovery stage.
Definition: jumptable.cc:2685
virtual bool foldInGuards(Funcdata *fd, JumpTable *jump)
Eliminate any guard code involved in computing the switch destination.
Definition: jumptable.cc:1428
virtual void setVarnodeValue(Varnode *vn, uintb val)
Given a specific Varnode, set the given value for it in the current machine state.
Definition: jumptable.cc:158
static int4 getStride(Varnode *vn)
Get the step/stride associated with the Varnode.
Definition: jumptable.cc:441
void initializeStart(const PathMeld &pathMeld)
Pass in the prior PathMeld calculation.
Definition: jumptable.cc:1521
virtual void buildLabels(Funcdata *fd, vector< Address > &addresstable, vector< uintb > &label, const JumpModel *orig) const =0
Recover case labels associated with the Address table.
void append(const PathMeld &op2)
Append a new set of paths to this set of paths.
Definition: jumptable.cc:897
virtual bool recoverModel(Funcdata *fd, PcodeOp *indop, uint4 matchsize, uint4 maxtablesize)
Attempt to recover details of the model, given a specific BRANCHIND.
Definition: jumptable.cc:1290
virtual PcodeOp * getStartOp(void) const
Get the PcodeOp associated with the current value.
Definition: jumptable.cc:306
virtual bool next(void) const =0
Advance the iterator, return true if there is another value.
virtual bool next(void) const
Advance the iterator, return true if there is another value.
Definition: jumptable.cc:288
void restoreXml(const Element *el)
Recover this jump-table from a <jumptable> XML tag.
Definition: jumptable.cc:2633
virtual bool sanityCheck(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable)=0
Perform a sanity check on recovered addresses.
virtual void truncate(int4 nm)
Definition: jumptable.cc:257
void foldInNormalization(Funcdata *fd)
Hide the normalization code for the switch.
Definition: jumptable.cc:2404
uintb curval
The current value pointed to be the iterator.
Definition: jumptable.hh:182
void calcRange(Varnode *vn, CircleRange &rng) const
Calculate the range of values in the given Varnode that direct control-flow to the switch.
Definition: jumptable.cc:1065
virtual JumpModel * clone(JumpTable *jt) const
Clone this model.
Definition: jumptable.cc:1623
vector< GuardRecord > selectguards
Any guards associated with model.
Definition: jumptable.hh:348
virtual int4 getTableSize(void) const
Return the number of entries in the address table.
Definition: jumptable.hh:481
Exception thrown is there are no legal flows to a switch.
Definition: jumptable.hh:33
virtual bool recoverModel(Funcdata *fd, PcodeOp *indop, uint4 matchsize, uint4 maxtablesize)=0
Attempt to recover details of the model, given a specific BRANCHIND.
virtual JumpModel * clone(JumpTable *jt) const
Clone this model.
Definition: jumptable.cc:1877
virtual JumpModel * clone(JumpTable *jt) const =0
Clone this model.
virtual JumpModel * clone(JumpTable *jt) const
Clone this model.
Definition: jumptable.cc:1483
A jump-table starting range with two possible execution paths.
Definition: jumptable.hh:203
bool flowsOnlyToModel(Varnode *vn, PcodeOp *trailOp)
Check if the given Varnode flows to anything other than this model.
Definition: jumptable.cc:1228
An iterator over values a switch variable can take.
Definition: jumptable.hh:156
virtual void buildAddresses(Funcdata *fd, PcodeOp *indop, vector< Address > &addresstable, vector< LoadTable > *loadpoints) const
Construct the explicit list of target addresses (the Address Table) from this model.
Definition: jumptable.cc:1306
void findDeterminingVarnodes(PcodeOp *op, int4 slot)
Calculate the initial set of Varnodes that might be switch variables.
Definition: jumptable.cc:506
virtual bool recoverModel(Funcdata *fd, PcodeOp *indop, uint4 matchsize, uint4 maxtablesize)
Attempt to recover details of the model, given a specific BRANCHIND.
Definition: jumptable.cc:1955
virtual JumpValues * clone(void) const =0
Clone this iterator.
GuardRecord(PcodeOp *bOp, PcodeOp *rOp, int4 path, const CircleRange &rng, Varnode *v)
Constructor.
Definition: jumptable.cc:564
void findNormalized(Funcdata *fd, BlockBasic *rootbl, int4 pathout, uint4 matchsize, uint4 maxtablesize)
Do all the work necessary to recover the normalized switch variable.
Definition: jumptable.cc:1159
virtual Varnode * foldInNormalization(Funcdata *fd, PcodeOp *indop)=0
Do normalization of the given switch specific to this model.
A jump-table model assisted by pseudo-op directives in the code.
Definition: jumptable.hh:472
virtual Varnode * foldInNormalization(Funcdata *fd, PcodeOp *indop)
Do normalization of the given switch specific to this model.
Definition: jumptable.cc:2055
void recoverAddresses(Funcdata *fd)
Recover the raw jump-table addresses (the address table)
Definition: jumptable.cc:2453
virtual bool recoverModel(Funcdata *fd, PcodeOp *indop, uint4 matchsize, uint4 maxtablesize)
Attempt to recover details of the model, given a specific BRANCHIND.
Definition: jumptable.cc:1533
virtual Varnode * getStartVarnode(void) const
Get the Varnode associated with the current value.
Definition: jumptable.cc:356
~JumpTable(void)
Destructor.
Definition: jumptable.cc:2255
virtual bool next(void) const
Advance the iterator, return true if there is another value.
Definition: jumptable.cc:345
void set(const PathMeld &op2)
Copy paths from another container.
Definition: jumptable.cc:863
JumpBasicOverride(JumpTable *jt)
Constructor.
Definition: jumptable.cc:1640