mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-2767 Structured pieces
This commit is contained in:
parent
b707c2ea6b
commit
535ac7c08d
29 changed files with 834 additions and 210 deletions
|
@ -940,16 +940,6 @@ public:
|
|||
virtual void getOpList(vector<uint4> &oplist) const;
|
||||
virtual int4 applyOp(PcodeOp *op,Funcdata &data);
|
||||
};
|
||||
class RuleEmbed : public Rule {
|
||||
public:
|
||||
RuleEmbed(const string &g) : Rule(g, 0, "embed") {} ///< Constructor
|
||||
virtual Rule *clone(const ActionGroupList &grouplist) const {
|
||||
if (!grouplist.contains(getGroup())) return (Rule *)0;
|
||||
return new RuleEmbed(getGroup());
|
||||
}
|
||||
virtual void getOpList(vector<uint4> &oplist) const;
|
||||
virtual int4 applyOp(PcodeOp *op,Funcdata &data);
|
||||
};
|
||||
class RuleSwitchSingle : public Rule {
|
||||
public:
|
||||
RuleSwitchSingle(const string &g) : Rule(g,0,"switchsingle") {} ///< Constructor
|
||||
|
@ -1155,6 +1145,23 @@ public:
|
|||
virtual int4 applyOp(PcodeOp *op,Funcdata &data);
|
||||
};
|
||||
|
||||
class RulePieceStructure : public Rule {
|
||||
/// \brief Markup for Varnodes pieced together into structure/array
|
||||
static Datatype *determineDatatype(Varnode *vn,int4 &baseOffset);
|
||||
static bool spanningRange(Datatype *ct,int4 off,int4 size);
|
||||
static bool convertZextToPiece(PcodeOp *zext,Datatype *structuredType,int4 offset,Funcdata &data);
|
||||
static bool findReplaceZext(vector<PieceNode> &stack,Datatype *structuredType,Funcdata &data);
|
||||
static bool separateSymbol(Varnode *root,Varnode *leaf);
|
||||
public:
|
||||
RulePieceStructure(const string &g) : Rule( g, 0, "piecestructure") {} ///< Constructor
|
||||
virtual Rule *clone(const ActionGroupList &grouplist) const {
|
||||
if (!grouplist.contains(getGroup())) return (Rule *)0;
|
||||
return new RulePieceStructure(getGroup());
|
||||
}
|
||||
virtual void getOpList(vector<uint4> &oplist) const;
|
||||
virtual int4 applyOp(PcodeOp *op,Funcdata &data);
|
||||
};
|
||||
|
||||
class RuleSubNormal : public Rule {
|
||||
public:
|
||||
RuleSubNormal(const string &g) : Rule( g, 0, "subnormal") {} ///< Constructor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue