Ghidra Decompiler Analysis Engine
|
16 #ifndef __CPUI_CODEDATA__
17 #define __CPUI_CODEDATA__
61 vector<Address> jumpaddr;
62 set<uintb> targetoffsets;
71 void addTarget(
const Address &addr) { targetoffsets.insert( addr.
getOffset() ); }
81 funcstart(func), codeaddr(code), thunkaddr(thunk) { mask = m; }
82 bool operator<(
const TargetHit &op2)
const {
return (funcstart < op2.funcstart); }
95 bool operator<(
const AddrLink &op2)
const {
96 if (a != op2.a)
return (a < op2.a);
107 map<Address,CodeUnit> codeunit;
108 map<AddrLink,uint4> fromto_crossref;
109 map<AddrLink,uint4> tofrom_crossref;
110 list<map<Address,CodeUnit>::iterator> taintlist;
111 list<Address> unlinkedstarts;
112 list<TargetHit> targethits;
113 map<Address,TargetFeature> targets;
116 void pushTaintAddress(
const Address &addr);
117 void processTaint(
void);
118 Address commitCodeVec(
const Address &addr,vector<CodeUnit> &codevec,map<AddrLink,uint4> &fromto_vec);
119 void clearHitBy(
void);
122 void addTarget(
const string &nm,
const Address &addr,uint4 mask);
123 int4 getNumTargets(
void)
const {
return targets.size(); }
125 void disassembleRange(
const Range &range);
126 void disassembleRangeList(
const RangeList &rangelist);
127 void findNotCodeUnits(
void);
128 void markFallthruHits(
void);
129 void markCrossHits(
void);
130 void addTargetHit(
const Address &codeaddr,uintb targethit);
131 void resolveThunkHit(
const Address &codeaddr,uintb targethit);
132 void findUnlinked(
void);
133 bool checkErrantStart(map<Address,CodeUnit>::iterator iter);
134 bool repairJump(
const Address &addr,int4 max);
135 void findOffCut(
void);
137 const list<TargetHit> &getTargetHits(
void)
const {
return targethits; }
138 void dumpModelHits(ostream &s)
const;
139 void dumpCrossRefs(ostream &s)
const;
140 void dumpFunctionStarts(ostream &s)
const;
141 void dumpUnlinked(ostream &s)
const;
142 void dumpTargetHits(ostream &s)
const;
153 virtual string getModule(
void)
const {
return "codedata"; }
159 virtual void execute(istream &s);
164 virtual void execute(istream &s);
169 virtual void execute(istream &s);
174 virtual void execute(istream &s);
179 virtual void execute(istream &s);
184 virtual void execute(istream &s);
189 virtual void execute(istream &s);
194 virtual void execute(istream &s);
virtual void execute(istream &s)
Definition: codedata.cc:760
virtual void registerCommands(IfaceStatus *status)
Register commands for this grouping.
Definition: codedata.cc:29
Definition: codedata.hh:162
Definition: codedata.hh:172
Abstract class for emitting pcode to an application.
Definition: translate.hh:76
virtual string getModule(void) const
Get the formal module name to which this command belongs.
Definition: codedata.hh:153
Definition: codedata.hh:177
Definition: codedata.hh:157
virtual void dump(const Address &addr, OpCode opc, VarnodeData *outvar, VarnodeData *vars, int4 isize)
The main pcode emit method.
Definition: codedata.cc:50
Definition: codedata.hh:101
Console interface commands for the decompiler engine.
Definition: codedata.hh:74
Definition: codedata.hh:21
Definition: codedata.hh:192
uintb getOffset(void) const
Get the address offset.
Definition: address.hh:300
virtual void execute(istream &s)
Definition: codedata.cc:730
A generic console mode interface and command executor.
Definition: interface.hh:195
Common data shared by decompiler commands.
Definition: ifacedecomp.hh:42
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
virtual void execute(istream &s)
Definition: codedata.cc:754
Definition: codedata.hh:59
Definition: codedata.hh:32
virtual void execute(istream &s)
Definition: codedata.cc:766
Definition: codedata.hh:90
A disjoint set of Ranges, possibly across multiple address spaces.
Definition: address.hh:203
Definition: codedata.hh:182
virtual void setData(IfaceStatus *root, IfaceData *data)
Associate a specific data object with this command.
Definition: codedata.cc:716
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
virtual IfaceData * createData(void)
Create a specialized data object for this command (and its module)
Definition: codedata.hh:154
The interface to a translation engine for a processor.
Definition: translate.hh:294
A command that can be executed from the command line.
Definition: interface.hh:97
Groups of console commands that are discovered by the loader.
Definition: interface.hh:161
virtual void execute(istream &s)
Definition: codedata.cc:772
A contiguous range of bytes in some address space.
Definition: address.hh:161
OpCode
The op-code defining a specific p-code operation (PcodeOp)
Definition: opcodes.hh:35
virtual void execute(istream &s)
Definition: codedata.cc:778
virtual void execute(istream &s)
Definition: codedata.cc:784
virtual void execute(istream &s)
Definition: codedata.cc:724
Data defining a specific memory location.
Definition: pcoderaw.hh:33
Definition: codedata.hh:85
Definition: codedata.hh:187
Data specialized for a particular command module.
Definition: interface.hh:85
Definition: codedata.hh:146
Definition: codedata.hh:50
Definition: codedata.hh:167