decompiler  1.0.0
Classes | Functions
ifacedecomp.hh File Reference

Console interface commands for the decompiler engine. More...

#include "graph.hh"
#include "grammar.hh"
#include "callgraph.hh"
#include "paramid.hh"
#include "testfunction.hh"

Classes

class  ghidra::IfaceDecompCapability
 Interface capability point for all decompiler commands. More...
 
class  ghidra::IfaceDecompData
 Common data shared by decompiler commands. More...
 
class  ghidra::IfaceAssemblyEmit
 Disassembly emitter that prints to a console stream. More...
 
class  ghidra::IfaceDecompCommand
 Root class for all decompiler specific commands. More...
 
class  ghidra::IfcSource
 Execute a command script : source <filename> More...
 
class  ghidra::IfcOption
 Adjust a decompiler option: option <optionname> [<param1>] [<param2>] [<param3>] More...
 
class  ghidra::IfcParseLine
 Parse a line of C syntax: parse line ... More...
 
class  ghidra::IfcParseFile
 Parse a file with C declarations: parse file <filename> More...
 
class  ghidra::IfcAdjustVma
 Change the base address of the load image: adjust vma 0xabcd0123 More...
 
class  ghidra::IfcFuncload
 Make a specific function current: load function <functionname> More...
 
class  ghidra::IfcAddrrangeLoad
 Create a new function at an address: load addr <address> [<funcname>] More...
 
class  ghidra::IfcCleararch
 Clear the current architecture/program: clear architecture More...
 
class  ghidra::IfcReadSymbols
 Read in symbols from the load image: read symbols More...
 
class  ghidra::IfcMapaddress
 Map a new symbol into the program: map address <address> <typedeclaration> More...
 
class  ghidra::IfcMaphash
 Add a dynamic symbol to the current function: map hash <address> <hash> <typedeclaration> More...
 
class  ghidra::IfcMapfunction
 Create a new function: map function <address> [<functionname>] [nocode] More...
 
class  ghidra::IfcMapexternalref
 Create an external ref symbol map externalref <address> <refaddress> [<name>] More...
 
class  ghidra::IfcMaplabel
 Create a code label: map label <name> <address> More...
 
class  ghidra::IfcMapconvert
 Create an convert directive: map convert <format> <value> <address> <hash> More...
 
class  ghidra::IfcMapunionfacet
 Create a union field forcing directive: map facet <union> <fieldnum> <address> <hash> More...
 
class  ghidra::IfcPrintdisasm
 Print disassembly of a memory range: disassemble [<address1> <address2>] More...
 
class  ghidra::IfcDump
 Display bytes in the load image: dump <address+size> More...
 
class  ghidra::IfcDumpbinary
 Dump a memory to file: binary <address+size> <filename> More...
 
class  ghidra::IfcDecompile
 Decompile the current function: decompile More...
 
class  ghidra::IfcPrintLanguage
 Print current output using a specific language: print language <langname> More...
 
class  ghidra::IfcPrintCXml
 Print the current function with C syntax and XML markup:print C xml More...
 
class  ghidra::IfcPrintCFlat
 Print current function without control-flow: print C flat More...
 
class  ghidra::IfcPrintCStruct
 Print the current function using C syntax:print C More...
 
class  ghidra::IfcPrintCGlobals
 Print declarations for any known global variables: print C globals More...
 
class  ghidra::IfcPrintCTypes
 Print any known type definitions: print C types More...
 
class  ghidra::IfcProduceC
 Write decompilation for all functions to a file: produce C <filename> More...
 
class  ghidra::IfcProducePrototypes
 Determine the prototype model for all functions: produce prototypes More...
 
class  ghidra::IfcListaction
 List all current actions and rules for the decompiler: list action More...
 
class  ghidra::IfcListOverride
 Display any overrides for the current function: list override More...
 
class  ghidra::IfcListprototypes
 List known prototype models: list prototypes More...
 
class  ghidra::IfcSetcontextrange
 Set a context variable: set context <name> <value> [<startaddress> <endaddress>] More...
 
class  ghidra::IfcSettrackedrange
 Set the value of a register: set track <name> <value> [<startaddress> <endaddress>] More...
 
class  ghidra::IfcBreakstart
 Set a break point at the start of an Action: break start <actionname> More...
 
class  ghidra::IfcBreakaction
 Set a breakpoint when a Rule or Action executes: break action <actionname> More...
 
class  ghidra::IfcPrintTree
 Print all Varnodes in the current function: print tree varnode More...
 
class  ghidra::IfcPrintBlocktree
 Print a description of the current functions control-flow: print tree block More...
 
class  ghidra::IfcPrintSpaces
 Print all address spaces: print spaces More...
 
class  ghidra::IfcPrintHigh
 Display all Varnodes in a HighVariable: print high <name> More...
 
class  ghidra::IfcPrintParamMeasures
 Perform parameter-id analysis on the current function: print parammeasures More...
 
class  ghidra::IfcRename
 Rename a variable: rename <oldname> <newname> More...
 
class  ghidra::IfcRetype
 Change the data-type of a symbol: retype <symbolname> <typedeclaration> More...
 
class  ghidra::IfcRemove
 Remove a symbol by name: remove <symbolname> More...
 
class  ghidra::IfcIsolate
 Mark a symbol as isolated from speculative merging: isolate <name> More...
 
class  ghidra::IfcPrintVarnode
 Print information about a Varnode: print varnode <varnode> More...
 
class  ghidra::IfcPrintCover
 Print cover info about a HighVariable: print cover high <name> More...
 
class  ghidra::IfcVarnodehighCover
 Print cover info about a HighVariable: print cover varnodehigh <varnode> More...
 
class  ghidra::IfcPrintExtrapop
 Print change to stack pointer for called function: print extrapop [<functionname>] More...
 
class  ghidra::IfcVarnodeCover
 Print cover information about a Varnode: print cover varnode <varnode> More...
 
class  ghidra::IfcNameVarnode
 Attach a named symbol to a specific Varnode: name varnode <varnode> <name> More...
 
class  ghidra::IfcTypeVarnode
 Attach a typed symbol to a specific Varnode: type varnode <varnode> <typedeclaration> More...
 
class  ghidra::IfcForceFormat
 Mark a constant to be printed in a specific format: force varnode <varnode> [hex|dec|oct|bin|char] More...
 
class  ghidra::IfcForceDatatypeFormat
 Mark constants of a data-type to be printed in a specific format: force datatype <datatype> [hex|dec|oct|bin|char] More...
 
class  ghidra::IfcForcegoto
 Force a branch to be an unstructured goto: force goto <branchaddr> <targetaddr> More...
 
class  ghidra::IfcProtooverride
 Override the prototype of a called function: override prototype <address> <declaration> More...
 
class  ghidra::IfcJumpOverride
 Provide an overriding jump-table for an indirect branch: override jumptable ... More...
 
class  ghidra::IfcFlowOverride
 Create a control-flow override: override flow <address> branch|call|callreturn|return More...
 
class  ghidra::IfcDeadcodedelay
 Change when dead code elimination starts: deadcode delay <name> <delay> More...
 
class  ghidra::IfcGlobalAdd
 Add a memory range as discoverable global variables: global add <address+size> More...
 
class  ghidra::IfcGlobalRemove
 Remove a memory range from discoverable global variables: global remove <address+size> More...
 
class  ghidra::IfcGlobalify
 Treat all normal memory as discoverable global variables: global spaces More...
 
class  ghidra::IfcGlobalRegisters
 Name global registers: global registers More...
 
class  ghidra::IfcPrintInputs
 Print info about the current function's input Varnodes: print inputs More...
 
class  ghidra::IfcPrintInputsAll
 Print info about input Varnodes for all functions: print inputs all More...
 
class  ghidra::IfcLockPrototype
 Lock in the current function's prototype: prototype lock More...
 
class  ghidra::IfcUnlockPrototype
 Unlock the current function's prototype: prototype unlock More...
 
class  ghidra::IfcPrintLocalrange
 Print range of locals on the stack: print localrange More...
 
class  ghidra::IfcPrintMap
 Print info about a scope/namespace: print map <name> More...
 
class  ghidra::IfcContinue
 Continue decompilation after a break point: continue More...
 
class  ghidra::IfcPrintRaw
 Print the raw p-code for the current function: print raw More...
 
class  ghidra::IfcGraphDataflow
 Write a graph representation of data-flow to a file: graph dataflow <filename> More...
 
class  ghidra::IfcGraphControlflow
 Write a graph representation of control-flow to a file: graph controlflow <filename> More...
 
class  ghidra::IfcGraphDom
 Write the forward dominance graph to a file: graph dom <filename> More...
 
class  ghidra::IfcCommentInstr
 Attach a comment to an address: comment <address> comment text... More...
 
class  ghidra::IfcDuplicateHash
 Check for duplicate hashes in functions: duplicate hash More...
 
class  ghidra::IfcCallGraphDump
 Write the current call-graph to a file: callgraph dump <filename> More...
 
class  ghidra::IfcCallGraphBuild
 Build the call-graph for the architecture/program: callgraph build More...
 
class  ghidra::IfcCallGraphBuildQuick
 Build the call-graph using quick analysis: callgraph build quick More...
 
class  ghidra::IfcCallGraphLoad
 Load the call-graph from a file: callgraph load <filename> More...
 
class  ghidra::IfcCallGraphList
 List all functions in leaf order: callgraph list More...
 
class  ghidra::IfcComment
 A comment within a command script: % A comment in a script More...
 
class  ghidra::IfcCallFixup
 Add a new call fix-up to the program: fixup call ... More...
 
class  ghidra::IfcCallOtherFixup
 Add a new callother fix-up to the program: fixup callother ... More...
 
class  ghidra::IfcFixupApply
 Apply a call-fixup to a particular function: fixup apply <fixup> <function> More...
 
class  ghidra::IfcCountPcode
 Count p-code in the current function: count pcode More...
 
class  ghidra::IfcPrintActionstats
 Print transform statistics for the decompiler engine: print actionstats More...
 
class  ghidra::IfcResetActionstats
 Reset transform statistics for the decompiler engine: reset actionstats More...
 
class  ghidra::IfcVolatile
 Mark a memory range as volatile: volatile <address+size> More...
 
class  ghidra::IfcReadonly
 Mark a memory range as read-only: readonly <address+size> More...
 
class  ghidra::IfcPointerSetting
 Create a pointer with additional settings: pointer setting <name> <basetype> offset <val> More...
 
class  ghidra::IfcPreferSplit
 Mark a storage location to be split: prefersplit <address+size> <splitsize> More...
 
class  ghidra::IfcStructureBlocks
 Structure an external control-flow graph: structure blocks <infile> <outfile> More...
 
class  ghidra::IfcAnalyzeRange
 Run value-set analysis on the current function: analyze range full|partial <varnode> More...
 
class  ghidra::IfcLoadTestFile
 Load a datatest environment file: load test <filename> More...
 
class  ghidra::IfcListTestCommands
 List all the script commands in the current test: list test commands More...
 
class  ghidra::IfcExecuteTestCommand
 Execute a specified range of the test script: `execute test command <#>-<#> More...
 

Functions

void ghidra::execute (IfaceStatus *status, IfaceDecompData *dcp)
 Execute one command for the console. More...
 
void ghidra::mainloop (IfaceStatus *status)
 Execute commands as they become available. More...
 

Detailed Description

Console interface commands for the decompiler engine.

Function Documentation

◆ execute()

void ghidra::execute ( IfaceStatus status,
IfaceDecompData dcp 
)

Execute one command for the console.

Execute one command and handle any exceptions. Error messages are printed to the console. For low-level errors, the current function is reset to null

Parameters
statusis the console interface
dcpis the shared program data

◆ mainloop()

void ghidra::mainloop ( IfaceStatus status)

Execute commands as they become available.

Execution loops until either the done field in the console is set or if all streams have ended. This handles popping script states pushed on by the IfcSource command.

Parameters
statusis the console interface