Ghidra Decompiler Analysis Engine
ifacedecomp.hh
Go to the documentation of this file.
1 /* ###
2  * IP: GHIDRA
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
18 
19 #ifndef __IFACE_DECOMP__
20 #define __IFACE_DECOMP__
21 
22 #include "ifaceterm.hh"
23 #include "graph.hh"
24 #include "grammar.hh"
25 #include "callgraph.hh"
26 #include "paramid.hh"
27 #ifdef CPUI_RULECOMPILE
28 #include "rulecompile.hh"
29 #endif
30 
33  static IfaceDecompCapability ifaceDecompCapability;
34  IfaceDecompCapability(void);
36  IfaceDecompCapability &operator=(const IfaceDecompCapability &op2);
37 public:
38  virtual void registerCommands(IfaceStatus *status);
39 };
40 
42 class IfaceDecompData : public IfaceData {
43 public:
47 
48  map<Funcdata*,PrototypePieces> prototypePieces;
49  void storePrototypePieces( Funcdata *fd_in, PrototypePieces pp_in ) { prototypePieces.insert(pair<Funcdata*,PrototypePieces>(fd_in,pp_in)); }
50  PrototypePieces findPrototypePieces( Funcdata *fd_in ) { return (*prototypePieces.find(fd_in)).second; }
51 
52 #ifdef CPUI_RULECOMPILE
53  string experimental_file; // File containing experimental rules
54 #endif
55 #ifdef OPACTION_DEBUG
56  bool jumptabledebug;
57 #endif
58  IfaceDecompData(void);
59  virtual ~IfaceDecompData(void);
60  void allocateCallGraph(void);
61  void abortFunction(ostream &s);
62  void clearArchitecture(void);
63  void followFlow(ostream &s,int4 size);
64  Varnode *readVarnode(istream &s);
65 };
66 
72  int4 mnemonicpad;
73  ostream *s;
74 public:
75  IfaceAssemblyEmit(ostream *val,int4 mp) { s = val; mnemonicpad=mp; }
76  virtual void dump(const Address &addr,const string &mnem,const string &body) {
77  addr.printRaw(*s);
78  *s << ": " << mnem;
79  for(int4 i=mnem.size();i<mnemonicpad;++i) *s << ' ';
80  *s << body << endl;
81  }
82 };
83 
84 extern void execute(IfaceStatus *status,IfaceDecompData *dcp);
85 extern void mainloop(IfaceStatus *status);
86 
92 protected:
95  void iterateScopesRecursive(Scope *scope);
96  void iterateFunctionsAddrOrder(Scope *scope);
97 public:
98  virtual void setData(IfaceStatus *root,IfaceData *data) { status = root; dcp = (IfaceDecompData *)data; }
99  virtual string getModule(void) const { return "decompile"; }
100  virtual IfaceData *createData(void) { return new IfaceDecompData(); }
101 
105  virtual void iterationCallback(Funcdata *fd) {}
106 
107  void iterateFunctionsAddrOrder(void);
108  void iterateFunctionsLeafOrder(void);
109 };
110 
112 public:
113  virtual void execute(istream &s);
114 };
115 
117 public:
118  virtual void execute(istream &s);
119 };
120 
122 public:
123  virtual void execute(istream &s);
124 };
125 
127 public:
128  virtual void execute(istream &s);
129 };
130 
132 public:
133  virtual void execute(istream &s);
134 };
135 
137 public:
138  virtual void execute(istream &s);
139 };
140 
142 public:
143  virtual void execute(istream &s);
144 };
145 
147 public:
148  virtual void execute(istream &s);
149 };
150 
152 public:
153  virtual void execute(istream &s);
154 };
155 
157 public:
158  virtual void execute(istream &s);
159 };
160 
162 public:
163  virtual void execute(istream &s);
164 };
165 
167 public:
168  virtual void execute(istream &s);
169 };
170 
172 public:
173  virtual void execute(istream &s);
174 };
175 
177 public:
178  virtual void execute(istream &s);
179 };
180 
182 public:
183  virtual void execute(istream &s);
184 };
185 
186 class IfcDump : public IfaceDecompCommand {
187 public:
188  virtual void execute(istream &s);
189 };
190 
192 public:
193  virtual void execute(istream &s);
194 };
195 
197 public:
198  virtual void execute(istream &s);
199 };
200 
202 public:
203  virtual void execute(istream &s);
204 };
205 
207 public:
208  virtual void execute(istream &s);
209 };
210 
212 public:
213  virtual void execute(istream &s);
214 };
215 
217 public:
218  virtual void execute(istream &s);
219 };
220 
222 public:
223  virtual void execute(istream &s);
224 };
225 
227 public:
228  virtual void execute(istream &s);
229 };
230 
232 public:
233  virtual void execute(istream &s);
234  virtual void iterationCallback(Funcdata *fd);
235 };
236 
238 public:
239  virtual void execute(istream &s);
240  virtual void iterationCallback(Funcdata *fd);
241 };
242 
244 public:
245  virtual void execute(istream &s);
246 };
247 
249 public:
250  virtual void execute(istream &s);
251 };
252 
254 public:
255  virtual void execute(istream &s);
256 };
257 
259 public:
260  virtual void execute(istream &s);
261 };
262 
264 public:
265  virtual void execute(istream &s);
266 };
267 
269 public:
270  virtual void execute(istream &s);
271 };
272 
274 public:
275  virtual void execute(istream &s);
276 };
277 
279 public:
280  virtual void execute(istream &s);
281 };
282 
284 public:
285  virtual void execute(istream &s);
286 };
287 
289 public:
290  virtual void execute(istream &s);
291 };
292 
294 public:
295  virtual void execute(istream &s);
296 };
297 
299 public:
300  virtual void execute(istream &s);
301 };
302 
304 public:
305  virtual void execute(istream &s);
306 };
307 
309 public:
310  virtual void execute(istream &s);
311 };
312 
314 public:
315  virtual void execute(istream &s);
316 };
317 
319 public:
320  virtual void execute(istream &s);
321 };
322 
324 public:
325  virtual void execute(istream &s);
326 };
327 
329 public:
330  virtual void execute(istream &s);
331 };
332 
334 public:
335  virtual void execute(istream &s);
336 };
337 
339 public:
340  virtual void execute(istream &s);
341 };
342 
344 public:
345  virtual void execute(istream &s);
346 };
347 
349 public:
350  virtual void execute(istream &s);
351 };
352 
354 public:
355  virtual void execute(istream &s);
356 };
357 
359 public:
360  virtual void execute(istream &s);
361 };
362 
364 public:
365  virtual void execute(istream &s);
366 };
367 
369 public:
370  virtual void execute(istream &s);
371 };
372 
374 public:
375  virtual void execute(istream &s);
376 };
377 
379 public:
380  virtual void execute(istream &s);
381 };
382 
384 public:
385  virtual void execute(istream &s);
386 };
387 
389 public:
390  virtual void execute(istream &s);
391 };
392 
394 public:
395  virtual void execute(istream &s);
396 };
397 
399 public:
400  virtual void execute(istream &s);
401 };
402 
404 public:
405  virtual void execute(istream &s);
406 };
407 
409 public:
410  virtual void execute(istream &s);
411  static bool nonTrivialUse(Varnode *vn);
412  static int4 checkRestore(Varnode *vn);
413  static bool findRestore(Varnode *vn,Funcdata *fd);
414  static void print(Funcdata *fd,ostream &s);
415 };
416 
418 public:
419  virtual void execute(istream &s);
420  virtual void iterationCallback(Funcdata *fd);
421 };
422 
424 public:
425  virtual void execute(istream &s);
426 };
427 
429 public:
430  virtual void execute(istream &s);
431 };
432 
434 public:
435  virtual void execute(istream &s);
436 };
437 
439 public:
440  virtual void execute(istream &s);
441 };
442 
444 public:
445  virtual void execute(istream &s);
446 };
447 
449 public:
450  virtual void execute(istream &s);
451 };
452 
454 public:
455  virtual void execute(istream &s);
456 };
457 
459 public:
460  virtual void execute(istream &s);
461 };
462 
464 public:
465  virtual void execute(istream &s);
466 };
467 
469 public:
470  virtual void execute(istream &s);
471 };
472 
474 public:
475  virtual void execute(istream &s);
476  virtual void iterationCallback(Funcdata *fd);
477  static void check(Funcdata *fd,ostream &s);
478 
479 };
480 
482 public:
483  virtual void execute(istream &s);
484 };
485 
487 protected:
488  bool quick;
489 public:
490  virtual void execute(istream &s);
491  virtual void iterationCallback(Funcdata *fd);
492 };
493 
495  virtual void execute(istream &s);
496 };
497 
499 public:
500  virtual void execute(istream &s);
501 };
502 
504 public:
505  virtual void execute(istream &s);
506  virtual void iterationCallback(Funcdata *fd);
507 };
508 
510 public:
511  virtual void execute(istream &s);
512 };
513 
515 public:
516  virtual void execute(istream &s);
517  static void readPcodeSnippet(istream &s,string &name,string &outname,vector<string> &inname,
518  string &pcodestring);
519 };
520 
522 public:
523  virtual void execute(istream &s);
524 };
525 
527 public:
528  virtual void execute(istream &s);
529 };
530 
532 public:
533  virtual void execute(istream &s);
534 };
535 
537 public:
538  virtual void execute(istream &s);
539 };
540 
542 public:
543  virtual void execute(istream &s);
544 };
545 
547 public:
548  virtual void execute(istream &s);
549 };
550 
552 public:
553  virtual void execute(istream &s);
554 };
555 
557 public:
558  virtual void execute(istream &s);
559 };
560 
562 public:
563  virtual void execute(istream &s);
564 };
565 
566 #ifdef CPUI_RULECOMPILE
567 class IfcParseRule : public IfaceDecompCommand {
568 public:
569  virtual void execute(istream &s);
570 };
571 
572 class IfcExperimentalRules : public IfaceDecompCommand {
573 public:
574  virtual void execute(istream &s);
575 };
576 #endif
577 
578 #ifdef OPACTION_DEBUG
579 class IfcDebugAction : public IfaceDecompCommand {
580 public:
581  virtual void execute(istream &s);
582 };
583 
584 class IfcTraceBreak : public IfaceDecompCommand {
585 public:
586  virtual void execute(istream &s);
587 };
588 
589 class IfcTraceAddress : public IfaceDecompCommand {
590 public:
591  virtual void execute(istream &s);
592 };
593 
594 class IfcTraceEnable : public IfaceDecompCommand {
595 public:
596  virtual void execute(istream &s);
597 };
598 
599 class IfcTraceDisable : public IfaceDecompCommand {
600 public:
601  virtual void execute(istream &s);
602 };
603 
604 class IfcTraceClear : public IfaceDecompCommand {
605 public:
606  virtual void execute(istream &s);
607 };
608 
609 class IfcTraceList : public IfaceDecompCommand {
610 public:
611  virtual void execute(istream &s);
612 };
613 
614 class IfcBreakjump : public IfaceDecompCommand {
615 public:
616  virtual void execute(istream &s);
617 };
618 
619 #endif
620 
621 #endif
IfcPrintLocalrange::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2157
IfcPrintCFlat
Print current function without control-flow: print C flat
Definition: ifacedecomp.hh:211
IfcRename::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1197
IfcGraphDom
Write the forward dominance graph to a file: graph dom <filename>
Definition: ifacedecomp.hh:463
IfcCallGraphBuild::quick
bool quick
Set to true if a quick analysis is desired.
Definition: ifacedecomp.hh:488
IfcPrintInputs::findRestore
static bool findRestore(Varnode *vn, Funcdata *fd)
Check if storage is restored.
Definition: ifacedecomp.cc:2026
IfcProducePrototypes::iterationCallback
virtual void iterationCallback(Funcdata *fd)
Perform the per-function aspect of this command.
Definition: ifacedecomp.cc:2277
IfcPrintLanguage::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:858
IfcGlobalRemove::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1854
IfcPrintRaw
Print the raw p-code for the current function: print raw
Definition: ifacedecomp.hh:448
IfcOption::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:286
IfcNameVarnode::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1531
IfcParseFile::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:329
IfcPrintInputs::checkRestore
static int4 checkRestore(Varnode *vn)
Check if a Varnode is restored to its original input value.
Definition: ifacedecomp.cc:1965
IfcForceDec
Mark a constant to be printed in decimal format: force dec <varnode>
Definition: ifacedecomp.hh:358
IfcProtooverride
Override the prototype of a called function: override prototype <address> <declaration>
Definition: ifacedecomp.hh:368
IfcGraphDataflow::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2350
IfcAnalyzeRange::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:3056
IfaceDecompCommand::createData
virtual IfaceData * createData(void)
Create a specialized data object for this command (and its module)
Definition: ifacedecomp.hh:100
IfcGlobalAdd
Add a memory range as discoverable global variables: global add <address+size>
Definition: ifacedecomp.hh:388
IfcGraphDataflow
Write a graph representation of data-flow to a file: graph dataflow <filename>
Definition: ifacedecomp.hh:453
IfcJumpOverride
Provide an overriding jump-table for an indirect branch: override jumptable ...
Definition: ifacedecomp.hh:373
IfcParseLine::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:366
IfcProducePrototypes
Determine the prototype model for all functions: produce prototypes
Definition: ifacedecomp.hh:237
IfcGlobalRegisters
Name global registers: global registers
Definition: ifacedecomp.hh:403
IfcPrintCTypes::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:816
AssemblyEmit
Abstract class for emitting disassembly to an application.
Definition: translate.hh:118
IfcReadonly
Mark a memory range as read-only: readonly <address+size>
Definition: ifacedecomp.hh:546
ifaceterm.hh
Add some terminal capabilities to the command-line interface (IfaceStatus)
IfcPrintActionstats
Print transform statistics for the decompiler engine: print actionstats
Definition: ifacedecomp.hh:531
IfcCallGraphLoad::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2657
IfcMaphash
Add a dynamic symbol to the current function: map hash <address> <hash> <typedeclaration>
Definition: ifacedecomp.hh:161
IfaceDecompCommand::status
IfaceStatus * status
The console owning this command.
Definition: ifacedecomp.hh:93
execute
void execute(IfaceStatus *status, IfaceDecompData *dcp)
Execute one command for the console.
Definition: ifacedecomp.cc:3273
IfcPrintCFlat::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:790
IfcMapexternalref
Create an external ref symbol map externalref <address> <refaddress> [<name>]
Definition: ifacedecomp.hh:171
IfcMapfunction
Create a new function: map function <address> [<functionname>] [nocode]
Definition: ifacedecomp.hh:166
IfcCleararch
Clear the current architecture/program: clear architecture
Definition: ifacedecomp.hh:146
IfcMaplabel
Create a code label: map label <name> <address>
Definition: ifacedecomp.hh:176
IfcPrintExtrapop::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1437
IfcForceHex::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1605
IfcStructureBlocks
Structure an external control-flow graph: structure blocks <infile> <outfile>
Definition: ifacedecomp.hh:556
IfcCleararch::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:500
IfcPrintCTypes
Print any known type definitions: print C types
Definition: ifacedecomp.hh:226
IfaceDecompCommand::iterationCallback
virtual void iterationCallback(Funcdata *fd)
Perform the per-function aspect of this command.
Definition: ifacedecomp.hh:105
IfcAddrrangeLoad::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:478
IfcCallGraphList::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2704
IfcPreferSplit
Mark a storage location to be split: prefersplit <address+size> <splitsize>
Definition: ifacedecomp.hh:551
IfcPrintBlocktree
Print a description of the current functions control-flow: print tree block
Definition: ifacedecomp.hh:283
IfcLockPrototype
Lock in the current function's prototype: prototype lock
Definition: ifacedecomp.hh:423
IfcListprototypes::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:926
IfcFuncload
Make a specific function current: load function <functionname>
Definition: ifacedecomp.hh:136
IfcPrintVarnode::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1376
IfcFuncload::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:448
IfcGraphDom::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2402
IfcGlobalify
Treat all normal memory as discoverable global variables: global spaces
Definition: ifacedecomp.hh:398
IfcCountPcode::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:3027
IfaceDecompData::readVarnode
Varnode * readVarnode(istream &s)
Read a varnode from the given stream.
Definition: ifacedecomp.cc:1320
IfcListaction::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:894
IfcRetype
Change the data-type of a symbol: retype <varname> <typedeclaration>
Definition: ifacedecomp.hh:308
IfcCallGraphList
List all functions in leaf order: callgraph list
Definition: ifacedecomp.hh:503
IfcPrintCGlobals::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:804
IfcSource
Execute a command script : source <filename>
Definition: ifacedecomp.hh:111
IfcDuplicateHash
Check for duplicate hashes in functions: duplicate hash
Definition: ifacedecomp.hh:473
IfcPrintCXml::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:830
IfcVarnodeCover
Print cover information about a Varnode: print cover varnode <varnode>
Definition: ifacedecomp.hh:338
Scope
A collection of Symbol objects within a single (namespace or functional) scope.
Definition: database.hh:402
IfcPrintParamMeasures::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1181
IfcListOverride::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:910
IfcPrintInputs::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2081
IfcPrintBlocktree::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1110
IfcProduceC::iterationCallback
virtual void iterationCallback(Funcdata *fd)
Perform the per-function aspect of this command.
Definition: ifacedecomp.cc:2219
IfcBreakstart::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1073
IfcCallGraphBuild::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2562
CallGraph
Definition: callgraph.hh:91
IfaceStatus
A generic console mode interface and command executor.
Definition: interface.hh:195
IfcPrintTree
Print all Varnodes in the current function: print tree varnode
Definition: ifacedecomp.hh:278
IfcComment
A comment within a command script: % A comment in a script
Definition: ifacedecomp.hh:509
IfcNameVarnode
Attach a named symbol to a specific Varnode: name varnode <varnode> <name>
Definition: ifacedecomp.hh:343
IfaceDecompData
Common data shared by decompiler commands.
Definition: ifacedecomp.hh:42
IfaceDecompCapability
Interface capability point for all decompiler commands.
Definition: ifacedecomp.hh:32
IfcProduceC
Write decompilation for all functions to a file: produce C <filename>
Definition: ifacedecomp.hh:231
Architecture
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
IfcUnlockPrototype::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2142
IfcCallFixup::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2764
IfcDuplicateHash::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2520
IfcCallGraphDump
Write the current call-graph to a file: callgraph dump <filename>
Definition: ifacedecomp.hh:481
IfcDumpbinary::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:727
IfcPrintCStruct
Print the current function using C syntax:print C
Definition: ifacedecomp.hh:216
IfcFlowOverride::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1773
IfcDumpbinary
Dump a memory to file: binary <address+size> <filename>
Definition: ifacedecomp.hh:191
IfcDump::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:710
IfcSetcontextrange::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:952
IfcDecompile
Decompile the current function: decompile
Definition: ifacedecomp.hh:196
IfcCountPcode
Count p-code in the current function: count pcode
Definition: ifacedecomp.hh:526
IfcPrintInputsAll::iterationCallback
virtual void iterationCallback(Funcdata *fd)
Perform the per-function aspect of this command.
Definition: ifacedecomp.cc:2103
IfcCommentInstr
Attach a comment to an address: comment <address> comment text...
Definition: ifacedecomp.hh:468
IfcCallFixup::readPcodeSnippet
static void readPcodeSnippet(istream &s, string &name, string &outname, vector< string > &inname, string &pcodestring)
Scan a single-line p-code snippet declaration from the given stream.
Definition: ifacedecomp.cc:2730
IfcMapaddress
Map a new symbol into the program: map address <address> <typedeclaration>
Definition: ifacedecomp.hh:156
IfcVolatile
Mark a memory range as volatile: volatile <address+size>
Definition: ifacedecomp.hh:541
IfcPrintSpaces
Print all address spaces: print spaces
Definition: ifacedecomp.hh:288
IfcDeadcodedelay
Change when dead code elimination starts: deadcode delay <name> <delay>
Definition: ifacedecomp.hh:383
IfcPrintInputsAll::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2094
IfaceDecompCommand::iterateFunctionsLeafOrder
void iterateFunctionsLeafOrder(void)
Iterate command over all functions in a call-graph traversal.
Definition: ifacedecomp.cc:194
Varnode
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
IfcPrintTree::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1096
IfaceAssemblyEmit
Disassembly emitter that prints to a console stream.
Definition: ifacedecomp.hh:71
IfcGlobalRemove
Remove a memory range from discoverable global variables: global remove <address+size>
Definition: ifacedecomp.hh:393
IfcPrintRaw::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:883
IfcDuplicateHash::check
static void check(Funcdata *fd, ostream &s)
Check for duplicate hashes in given function.
Definition: ifacedecomp.cc:2457
IfcPrintdisasm::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:673
IfcPrintMap::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2171
IfcPrintInputs::nonTrivialUse
static bool nonTrivialUse(Varnode *vn)
Check for non-trivial use of given Varnode.
Definition: ifacedecomp.cc:1926
IfcRemove::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1233
IfcPrintHigh::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1161
IfcPrintInputs::print
static void print(Funcdata *fd, ostream &s)
Print information about function inputs.
Definition: ifacedecomp.cc:2052
IfcFlowOverride
Create a control-flow override: override flow <address> branch|call|callreturn|return
Definition: ifacedecomp.hh:378
IfcResetActionstats
Reset transform statistics for the decompiler engine: reset actionstats
Definition: ifacedecomp.hh:536
IfcListaction
List all current actions and rules for the decompiler: list action
Definition: ifacedecomp.hh:243
IfcSetcontextrange
Set a context variable: set context <name> <value> [<startaddress> <endaddress>]
Definition: ifacedecomp.hh:258
IfcProduceC::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2201
IfcCommentInstr::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2430
IfcProtooverride::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1681
IfcCallOtherFixup::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2791
IfcListOverride
Display any overrides for the current function: list override
Definition: ifacedecomp.hh:248
IfcAdjustVma
Change the base address of the load image: adjust vma 0xabcd0123
Definition: ifacedecomp.hh:131
IfcBreakstart
Set a break point at the start of an Action: break start <actionname>
Definition: ifacedecomp.hh:268
IfcListprototypes
List known prototype models: list prototypes
Definition: ifacedecomp.hh:253
IfaceDecompCommand::iterateScopesRecursive
void iterateScopesRecursive(Scope *scope)
Iterate recursively over all functions in given scope.
Definition: ifacedecomp.cc:152
Address
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
IfcVarnodeCover::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1513
IfcAdjustVma::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:391
PrototypePieces
Raw components of a function prototype (obtained from parsing source code)
Definition: fspec.hh:1144
IfcPrintMap
Print info about a scope/namespace: print map <name>
Definition: ifacedecomp.hh:438
IfcCallGraphList::iterationCallback
virtual void iterationCallback(Funcdata *fd)
Perform the per-function aspect of this command.
Definition: ifacedecomp.cc:2713
Funcdata
Container for data structures associated with a single function.
Definition: funcdata.hh:45
IfcPrintParamMeasures
Perform parameter-id analysis on the current function: print parammeasures
Definition: ifacedecomp.hh:298
IfcPrintLanguage
Print current output using a specific language: print language <langname>
Definition: ifacedecomp.hh:201
IfcRemove
Remove a symbol by name: remove <varname>
Definition: ifacedecomp.hh:313
IfcReadSymbols
Read in symbols from the load image: read symbols
Definition: ifacedecomp.hh:151
IfcPrintSpaces::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1124
IfaceDecompData::IfaceDecompData
IfaceDecompData(void)
Constructor.
Definition: ifacedecomp.cc:214
IfcTypeVarnode::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1570
IfaceDecompCommand::getModule
virtual string getModule(void) const
Get the formal module name to which this command belongs.
Definition: ifacedecomp.hh:99
IfcGraphControlflow::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2376
IfcUnlockPrototype
Unlock the current function's prototype: prototype unlock
Definition: ifacedecomp.hh:428
IfaceDecompCapability::registerCommands
virtual void registerCommands(IfaceStatus *status)
Register commands for this grouping.
Definition: ifacedecomp.cc:32
IfcDeadcodedelay::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1803
IfaceDecompCommand::iterateFunctionsAddrOrder
void iterateFunctionsAddrOrder(void)
Iterate command over all functions in all scopes.
Definition: ifacedecomp.cc:184
IfcPrintCStruct::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:844
IfcRetype::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1261
IfcContinue::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2316
IfcGlobalRegisters::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1887
IfaceDecompData::abortFunction
void abortFunction(ostream &s)
Clear references to current function.
Definition: ifacedecomp.cc:247
IfaceCommand
A command that can be executed from the command line.
Definition: interface.hh:97
IfaceCapability
Groups of console commands that are discovered by the loader.
Definition: interface.hh:161
IfcMapexternalref::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:629
IfcParseLine
Parse a line of C syntax: parse line ...
Definition: ifacedecomp.hh:121
IfcReadonly::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2830
IfcMaphash::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:570
IfcDump
Display bytes in the load image: dump <address+size>
Definition: ifacedecomp.hh:186
IfcVarnodehighCover::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1417
IfcCallGraphBuild
Build the call-graph for the architecture/program: callgraph build
Definition: ifacedecomp.hh:486
IfcCallOtherFixup
Add a new callother fix-up to the program: fixup callother ...
Definition: ifacedecomp.hh:521
Address::printRaw
void printRaw(ostream &s) const
Write a raw version of the address to a stream.
Definition: address.hh:276
IfcJumpOverride::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1723
IfcPrintCGlobals
Print declarations for any known global variables: print C globals
Definition: ifacedecomp.hh:221
IfcSource::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:3331
IfcPrintdisasm
Print disassembly of a memory range: disassemble [<address1> <address2>]
Definition: ifacedecomp.hh:181
IfaceDecompData::allocateCallGraph
void allocateCallGraph(void)
Allocate the call-graph object.
Definition: ifacedecomp.cc:235
IfcPrintHigh
Display all Varnodes in a HighVariable: print high <name>
Definition: ifacedecomp.hh:293
IfcBreakaction::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1047
IfaceCommand::execute
virtual void execute(istream &s)=0
IfcCallGraphBuild::iterationCallback
virtual void iterationCallback(Funcdata *fd)
Perform the per-function aspect of this command.
Definition: ifacedecomp.cc:2573
IfcMapaddress::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:532
IfcBreakaction
Set a breakpoint when a Rule or Action executes: break action <actionname>
Definition: ifacedecomp.hh:273
IfaceDecompData::fd
Funcdata * fd
Current function active in the console.
Definition: ifacedecomp.hh:44
IfcForcegoto::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1659
IfcSettrackedrange
Set the value of a register: set track <name> <value> [<startaddress> <endaddress>]
Definition: ifacedecomp.hh:263
IfcComment::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:274
IfcStructureBlocks::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2887
IfaceDecompData::conf
Architecture * conf
Current architecture/program active in the console.
Definition: ifacedecomp.hh:45
IfcGlobalify::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1874
IfcOption
Adjust a decompiler option: option <optionname> [<param1>] [<param2>] [<param3>]
Definition: ifacedecomp.hh:116
IfcCallGraphBuildQuick
Build the call-graph using quick analysis: callgraph build quick
Definition: ifacedecomp.hh:494
IfaceDecompData::cgraph
CallGraph * cgraph
Call-graph information for the program.
Definition: ifacedecomp.hh:46
IfcAddrrangeLoad
Create a new function at an address: load addr <address> [<funcname>]
Definition: ifacedecomp.hh:141
IfcPreferSplit::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2854
IfaceDecompCommand
Root class for all decompiler specific commands.
Definition: ifacedecomp.hh:91
IfcVolatile::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2808
IfcVarnodehighCover
Print cover info about a HighVariable: print cover varnodehigh <varnode>
Definition: ifacedecomp.hh:328
IfcPrintCover::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1393
IfaceAssemblyEmit::dump
virtual void dump(const Address &addr, const string &mnem, const string &body)
The main disassembly emitting method.
Definition: ifacedecomp.hh:76
IfcPrintVarnode
Print information about a Varnode: print varnode <varnode>
Definition: ifacedecomp.hh:318
IfcCallFixup
Add a new call fix-up to the program: fixup call ...
Definition: ifacedecomp.hh:514
IfaceData
Data specialized for a particular command module.
Definition: interface.hh:85
IfcForceDec::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1631
IfcPrintInputs
Print info about the current function's input Varnodes: print inputs
Definition: ifacedecomp.hh:408
IfcDecompile::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:756
IfcReadSymbols::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:511
IfcParseFile
Parse a file with C declarations: parse file <filename>
Definition: ifacedecomp.hh:126
IfcPrintActionstats::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2996
IfcPrintCXml
Print the current function with C syntax and XML markup:print C xml
Definition: ifacedecomp.hh:206
IfcMaplabel::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:648
IfcMapfunction::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:598
IfaceDecompCommand::dcp
IfaceDecompData * dcp
Data common to decompiler commands.
Definition: ifacedecomp.hh:94
IfcContinue
Continue decompilation after a break point: continue
Definition: ifacedecomp.hh:443
IfcPrintLocalrange
Print range of locals on the stack: print localrange
Definition: ifacedecomp.hh:433
IfcAnalyzeRange
Run value-set analysis on the current function: analyze range full|partial <varnode>
Definition: ifacedecomp.hh:561
IfcGlobalAdd::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:1834
IfaceDecompData::followFlow
void followFlow(ostream &s, int4 size)
Generate raw p-code for the current function.
Definition: ifacedecomp.cc:418
IfcLockPrototype::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2127
IfcRename
Rename a variable: rename <oldname> <newname>
Definition: ifacedecomp.hh:303
IfcSettrackedrange::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:996
IfcCallGraphLoad
Load the call-graph from a file: callgraph load <filename>
Definition: ifacedecomp.hh:498
IfcForcegoto
Force a branch to be an unstructured goto: force goto <branchaddr> <targetaddr>
Definition: ifacedecomp.hh:363
IfcPrintInputsAll
Print info about input Varnodes for all functions: print inputs all
Definition: ifacedecomp.hh:417
IfcPrintCover
Print cover info about a HighVariable: print cover high <name>
Definition: ifacedecomp.hh:323
IfaceDecompData::clearArchitecture
void clearArchitecture(void)
Free all resources for the current architecture/program.
Definition: ifacedecomp.cc:256
IfcCallGraphDump::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2630
IfaceDecompCommand::setData
virtual void setData(IfaceStatus *root, IfaceData *data)
Associate a specific data object with this command.
Definition: ifacedecomp.hh:98
IfcProducePrototypes::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:2253
IfcGraphControlflow
Write a graph representation of control-flow to a file: graph controlflow <filename>
Definition: ifacedecomp.hh:458
mainloop
void mainloop(IfaceStatus *status)
Execute commands as they become available.
Definition: ifacedecomp.cc:3310
IfcTypeVarnode
Attach a typed symbol to a specific Varnode: type varnode <varnode> <typedeclaration>
Definition: ifacedecomp.hh:348
IfcForceHex
Mark a constant to be printed in hex format: force hex <varnode>
Definition: ifacedecomp.hh:353
IfcResetActionstats::execute
virtual void execute(istream &s)
Definition: ifacedecomp.cc:3011
IfcPrintExtrapop
Print change to stack pointer for called function: print extrapop [<functionname>]
Definition: ifacedecomp.hh:333
IfcDuplicateHash::iterationCallback
virtual void iterationCallback(Funcdata *fd)
Perform the per-function aspect of this command.
Definition: ifacedecomp.cc:2526