decompiler
1.0.0
|
Command to decompile a specific function. More...
#include <ghidra_process.hh>
Public Member Functions | |
virtual void | rawAction (void) |
Perform the action of the command. More... | |
Public Member Functions inherited from GhidraCommand | |
GhidraCommand (void) | |
Construct given i/o streams. | |
virtual | ~GhidraCommand (void) |
Destructor. | |
int4 | doit (void) |
Configure and execute the command, then send back results. More... | |
Private Member Functions | |
virtual void | loadParameters (void) |
Read parameters directing command execution. More... | |
Private Attributes | |
Address | addr |
The entry point address of the function to decompile. | |
Additional Inherited Members | |
Protected Member Functions inherited from GhidraCommand | |
virtual void | sendResult (void) |
Send results of the command (if any) back to the Ghidra client. More... | |
Protected Attributes inherited from GhidraCommand | |
istream & | sin |
The input stream from the Ghidra client. | |
ostream & | sout |
The output stream to the Ghidra client. | |
ArchitectureGhidra * | ghidra |
The Architecture on which to perform the command. | |
int4 | status |
Meta-command to system (0=wait for next command, 1=terminate process) | |
Command to decompile a specific function.
The command expects 2 string parameters: the encoded integer id of the program, and an <addr> tag describing the entry point address of the function to decompile. The function follows flow from the entry point up to RETURN ops or other boundaries of the function. The control-flow and data-flow structures are built and transformed according to the current configuration of the Architecture and the active root Action. Symbols, data-types and p-code are fetched as needed from the client and cached in the Architecture object. XML Documents containing source code results, data-flow and control-flow structures, symbol information, etc., are sent back to the client.
|
privatevirtual |
Read parameters directing command execution.
This method reads an id selecting the Architecture to act on, but it can be overloaded to read any set of data from the Ghidra client to configure how the command is executed. Individual parameters are read using the method protocol.
Reimplemented from GhidraCommand.
References addr, GhidraCommand::ghidra, GhidraCommand::loadParameters(), ArchitectureGhidra::readXMLStream(), Address::restoreXml(), GhidraCommand::sin, and Address::toPhysical().
|
virtual |
Perform the action of the command.
Configuration is assumed to have happened, and this object can immediately begin examining and manipulating data under the active Architecture object to perform the command.
Implements GhidraCommand.
References addr, Architecture::allacts, PrintLanguage::docFunction(), ActionDatabase::getCurrent(), ActionDatabase::getCurrentName(), Database::getGlobalScope(), AddrSpace::getName(), ArchitectureGhidra::getSendCCode(), ArchitectureGhidra::getSendParamMeasures(), ArchitectureGhidra::getSendSyntaxTree(), Address::getShortcut(), Address::getSpace(), GhidraCommand::ghidra, Funcdata::isProcComplete(), Funcdata::isProcStarted(), Action::perform(), Architecture::print, Address::printRaw(), Scope::queryFunction(), Action::reset(), Funcdata::saveXml(), GhidraCommand::sout, and Architecture::symboltab.