Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
32 #ifdef __REMOTE_SOCKET__
41 basic_filebuf<char> *inbuf;
42 basic_filebuf<char> *outbuf;
48 ~RemoteSocket(
void) { close(); }
49 bool open(
const string &filename);
50 bool isSocketOpen(
void);
51 istream *getInputStream(
void) {
return inStream; }
52 ostream *getOutputStream(
void) {
return outStream; }
111 virtual void execute(istream &s)=0;
117 virtual string getModule(
void)
const=0;
128 void addWord(
const string &temp) { com.push_back(temp); }
130 void removeWord(
void) { com.pop_back(); }
131 const string &getCommandWord(int4 i)
const {
return com[i]; }
132 void addWords(
const vector<string> &wordlist);
133 int4 numWords(
void)
const {
return com.size(); }
134 void commandString(
string &res)
const;
143 virtual string getModule(
void)
const {
return "dummy"; }
162 static vector<IfaceCapability *> thelist;
166 const string &getName(
void)
const {
return name; }
167 virtual void initialize(
void);
168 virtual void registerCommands(
IfaceStatus *status)=0;
170 static void registerAllCommands(
IfaceStatus *status);
196 vector<string> promptstack;
197 vector<uint4> flagstack;
201 vector<string> history;
204 void restrictCom(vector<IfaceCommand *>::const_iterator &first,
205 vector<IfaceCommand *>::const_iterator &last,vector<string> &input);
210 virtual void readLine(
string &line)=0;
211 void saveHistory(
const string &line);
216 int4 expandCom(vector<string> &expand,istream &s,
217 vector<IfaceCommand *>::const_iterator &first,
218 vector<IfaceCommand *>::const_iterator &last);
224 IfaceStatus(
const string &prmpt,ostream &os,int4 mxhist=10);
226 void setErrorIsDone(
bool val) { errorisdone = val; }
227 virtual void pushScript(
const string &filename,
const string &newprompt);
228 virtual void popScript(
void);
230 int4 getNumInputStreamSize(
void)
const {
return promptstack.size(); }
231 void writePrompt(
void) { *optr << prompt; }
233 const char *nm2 = (
const char *)0,
234 const char *nm3 = (
const char *)0,
235 const char *nm4 = (
const char *)0,
236 const char *nm5 = (
const char *)0);
237 IfaceData *getData(
const string &nm)
const;
238 bool runCommand(
void);
239 void getHistory(
string &line,int4 i)
const;
240 int4 getHistorySize(
void)
const {
return history.size(); }
241 virtual bool isStreamFinished(
void)
const=0;
242 bool isInError(
void)
const {
return inerror; }
243 void evaluateError(
void);
244 static void wordsToString(
string &res,
const vector<string> &list);
262 virtual void execute(istream &s);
267 virtual void execute(istream &s);
272 virtual void execute(istream &s);
277 virtual void execute(istream &s);
282 virtual void execute(istream &s);
287 virtual void execute(istream &s);
virtual IfaceData * createData(void)
Create a specialized data object for this command (and its module)
Definition: interface.hh:144
bool compare_ifacecommand(const IfaceCommand *a, const IfaceCommand *b)
Compare to commands as pointers.
Definition: interface.hh:152
virtual void setData(IfaceStatus *root, IfaceData *data)
Associate a specific data object with this command.
Definition: interface.hh:141
Open file command to redirect bulk output to a specific file stream.
Definition: interface.hh:270
An exception describing a parsing error in a command line.
Definition: interface.hh:68
vector< IfaceCommand * > comlist
List of registered commands.
Definition: interface.hh:214
Quit command to terminate processing from the given interface.
Definition: interface.hh:260
Close command, closing the current bulk output file.
Definition: interface.hh:280
int4 compare(const IfaceCommand &op2) const
Order two commands by their command line strings.
Definition: interface.cc:467
string name
Identifying name for the capability.
Definition: interface.hh:164
A root class for a basic set of commands.
Definition: interface.hh:251
void execute(IfaceStatus *status, IfaceDecompData *dcp)
Execute one command for the console.
Definition: ifacedecomp.cc:3273
Echo command to echo the current command line to the bulk output stream.
Definition: interface.hh:285
ostream * optr
Where to put command line output.
Definition: interface.hh:221
void addWord(const string &temp)
Add a token to the command line string associated with this command.
Definition: interface.hh:128
string explain
Explanatory string.
Definition: interface.hh:60
A generic console mode interface and command executor.
Definition: interface.hh:195
Infrastructure for discovering code extensions to the decompiler.
An exception throw during the execution of a command.
Definition: interface.hh:75
virtual string getModule(void) const
Get the formal module name to which this command belongs.
Definition: interface.hh:256
ostream * fileoptr
Where to put bulk output.
Definition: interface.hh:222
An exception specific to the command line interface.
Definition: interface.hh:59
virtual string getModule(void) const
Get the formal module name to which this command belongs.
Definition: interface.hh:143
History command to list the most recent successful commands.
Definition: interface.hh:265
Class for automatically registering extension points to the decompiler.
Definition: capability.hh:36
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
Open file command directing bulk output to be appended to a specific file.
Definition: interface.hh:275
bool done
Set to true (by a command) to indicate processing is finished.
Definition: interface.hh:220
bool inerror
Set to true if last command did not succeed.
Definition: interface.hh:213
virtual void setData(IfaceStatus *root, IfaceData *data)
Associate a specific data object with this command.
Definition: interface.hh:255
virtual void execute(istream &s)
Definition: interface.hh:142
Data specialized for a particular command module.
Definition: interface.hh:85
A dummy command used during parsing.
Definition: interface.hh:139
virtual IfaceData * createData(void)
Create a specialized data object for this command (and its module)
Definition: interface.hh:257
map< string, IfaceData * > datamap
Data associated with particular modules.
Definition: interface.hh:215
IfaceStatus * status
The interface owning this command instance.
Definition: interface.hh:253