Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
19 #ifndef __CPUI_USEROP__
20 #define __CPUI_USEROP__
44 const string &getName(
void)
const {
return name; }
88 uint4 getInjectId(
void)
const {
return injectid; }
101 static string appendSize(
const string &base,int4 size);
161 virtual uintb
execute(
const vector<uintb> &input)
const=0;
204 bool supportsfarpointer;
208 AddrSpace *getSpace(
void)
const {
return spc; }
209 bool hasFarPointerSupport(
void)
const {
return supportsfarpointer; }
210 int4 getBaseSize(
void)
const {
return baseinsize; }
211 int4 getInnerSize(
void)
const {
return innerinsize; }
212 const VarnodeData &getResolve(
void)
const {
return constresolve; }
215 virtual uintb
execute(
const vector<uintb> &input)
const;
236 int4 getIndex2Case(
void)
const {
return index2case; }
237 int4 getIndex2Addr(
void)
const {
return index2addr; }
238 int4 getDefaultAddr(
void)
const {
return defaultaddr; }
239 int4 getCalcSize(
void)
const {
return calcsize; }
251 vector<UserPcodeOp *> useroplist;
252 map<string,UserPcodeOp *> useropmap;
253 vector<SegmentOp *> segmentop;
262 int4 numSegmentOps(
void)
const {
return segmentop.size(); }
269 return useroplist[i];
278 if (i>=segmentop.size())
return (
SegmentOp *)0;
289 const vector<string> &inname,
const string &snippet,
Architecture *glb);
virtual int4 getNumVariableTerms(void) const
Get the number of input Varnodes expected.
Definition: userop.hh:213
A region where processor data is stored.
Definition: space.hh:73
string name
Low-level name of p-code operator.
Definition: userop.hh:38
void setDefaults(Architecture *glb)
Create any required operations if they weren't explicitly defined.
Definition: userop.cc:333
void parseCallOtherFixup(const Element *el, Architecture *glb)
Parse a <callotherfixup> XML tag.
Definition: userop.cc:467
void restoreXml(const Element *el)
Restore this node from an XML stream.
Definition: userop.cc:84
void manualCallOtherFixup(const string &useropname, const string &outname, const vector< string > &inname, const string &snippet, Architecture *glb)
Manually install an InjectedUserOp given just names of the user defined op and the p-code snippet.
Definition: userop.cc:506
virtual void restoreXml(const Element *el)
Restore the detailed description from an XML stream.
Definition: userop.cc:75
A user defined p-code op with no specialization.
Definition: userop.hh:70
SegmentOp(Architecture *g, const string &nm, int4 ind)
Constructor.
Definition: userop.cc:121
virtual uintb execute(const vector< uintb > &input) const =0
Compute the output value of this operation, given constant inputs.
void initialize(Architecture *glb)
Initialize description objects for all user defined ops.
Definition: userop.cc:318
A base class for operations that access volatile memory.
Definition: userop.hh:99
UserPcodeOp * getOp(int4 i) const
Definition: userop.hh:267
Data-type and behavior information associated with specific p-code op-codes.
virtual string getOperatorName(const PcodeOp *op) const
Get the symbol representing this operation in decompiled code.
Definition: userop.hh:54
virtual void restoreXml(const Element *el)
Restore the detailed description from an XML stream.
Definition: userop.cc:19
An XML element. A node in the DOM tree.
Definition: xml.hh:150
virtual bool unify(Funcdata &data, PcodeOp *op, vector< Varnode * > &bindlist) const
Gather the formal input Varnode objects given the root PcodeOp.
Definition: userop.cc:127
Lowest level operation of the p-code language.
Definition: op.hh:58
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
uintb val
A possible constant second input.
Definition: userop.hh:171
Manager/container for description objects (UserPcodeOp) of user defined p-code ops.
Definition: userop.hh:250
virtual bool unify(Funcdata &data, PcodeOp *op, vector< Varnode * > &bindlist) const =0
Gather the formal input Varnode objects given the root PcodeOp.
A simple node used to dynamically define a sequence of operations.
Definition: userop.hh:169
UserOpManage(void)
Construct an empty manager.
Definition: userop.cc:296
virtual void restoreXml(const Element *el)
Restore the detailed description from an XML stream.
Definition: userop.cc:62
The base class for a detailed definition of a user-defined p-code operation.
Definition: userop.hh:36
virtual string getOperatorName(const PcodeOp *op) const
Get the symbol representing this operation in decompiled code.
Definition: userop.cc:68
void parseJumpAssist(const Element *el, Architecture *glb)
Parse a <jumpassist> XML tag.
Definition: userop.cc:484
static string appendSize(const string &base, int4 size)
Append a suffix to a string encoding a specific size.
Definition: userop.cc:39
~UserOpManage(void)
Destructor.
Definition: userop.cc:303
void parseSegmentOp(const Element *el, Architecture *glb)
Parse a <segmentop> XML tag.
Definition: userop.cc:417
OpCode opc
The particular p-code operation.
Definition: userop.hh:170
virtual uintb execute(const vector< uintb > &input) const
Compute the output value of this operation, given constant inputs.
Definition: userop.cc:156
virtual void restoreXml(const Element *el)
Restore the detailed description from an XML stream.
Definition: userop.cc:244
Container for data structures associated with a single function.
Definition: funcdata.hh:45
A user defined operation that is injected with other p-code.
Definition: userop.hh:83
An operation that reads from volatile memory.
Definition: userop.hh:112
A user defined p-code op that has a dynamically defined procedure.
Definition: userop.hh:144
A user defined p-code op for assisting the recovery of jump tables.
Definition: userop.hh:229
SegmentOp * getSegmentOp(int4 i) const
Definition: userop.hh:277
OpCode
The op-code defining a specific p-code operation (PcodeOp)
Definition: opcodes.hh:35
int4 slot
Slot to follow.
Definition: userop.hh:172
virtual int4 getNumVariableTerms(void) const =0
Get the number of input Varnodes expected.
void parseVolatile(const Element *el, Architecture *glb)
Parse a <volatile> XML tag.
Definition: userop.cc:435
An operation that writes to volatile memory.
Definition: userop.hh:126
Architecture * glb
Architecture owning the user defined op.
Definition: userop.hh:40
Data defining a specific memory location.
Definition: pcoderaw.hh:33
virtual void restoreXml(const Element *el)
Restore the detailed description from an XML stream.
Definition: userop.hh:74
int4 useropindex
Index passed in the CALLOTHER op.
Definition: userop.hh:39
virtual string getOperatorName(const PcodeOp *op) const
Get the symbol representing this operation in decompiled code.
Definition: userop.cc:55
JumpAssistOp(Architecture *g)
Constructor.
Definition: userop.cc:235
The segmented address operator.
Definition: userop.hh:199
virtual void restoreXml(const Element *el)
Restore the detailed description from an XML stream.
Definition: userop.cc:163
virtual void restoreXml(const Element *el)=0
Restore the detailed description from an XML stream.