decompiler
1.0.0
|
Abstract extension point for building Architecture objects. More...
#include <architecture.hh>
Public Member Functions | |
const string & | getName (void) const |
Get the capability identifier. | |
virtual void | initialize (void) |
Do specialized initialization. More... | |
virtual Architecture * | buildArchitecture (const string &filename, const string &target, ostream *estream)=0 |
Build an Architecture given a raw file or data. More... | |
virtual bool | isFileMatch (const string &filename) const =0 |
Determine if this extension can handle this file. More... | |
virtual bool | isXmlMatch (Document *doc) const =0 |
Determine is this extension can handle this XML document. More... | |
Public Member Functions inherited from ghidra::CapabilityPoint | |
virtual | ~CapabilityPoint (void) |
Destructor. | |
Static Public Member Functions | |
static ArchitectureCapability * | findCapability (const string &filename) |
Find an extension to process a file. More... | |
static ArchitectureCapability * | findCapability (Document *doc) |
Find an extension to process an XML document. More... | |
static ArchitectureCapability * | getCapability (const string &name) |
Get a capability by name. More... | |
static void | sortCapabilities (void) |
Sort extensions. More... | |
static uint4 | getMajorVersion (void) |
Get major decompiler version. | |
static uint4 | getMinorVersion (void) |
Get minor decompiler version. | |
Static Public Member Functions inherited from ghidra::CapabilityPoint | |
static void | initializeAll (void) |
Finish initialization for all extension points. More... | |
Protected Attributes | |
string | name |
Identifier for this capability. | |
Static Private Attributes | |
static const uint4 | majorversion = 5 |
Current major version of decompiler. | |
static const uint4 | minorversion = 0 |
Current minor version of decompiler. | |
static vector< ArchitectureCapability * > | thelist |
The list of registered extensions. | |
Additional Inherited Members | |
Protected Member Functions inherited from ghidra::CapabilityPoint | |
CapabilityPoint (void) | |
Construct extension capability exactly once. More... | |
Abstract extension point for building Architecture objects.
Decompilation hinges on initially recognizing the format of code then bootstrapping into discovering the processor etc. This is the base class for the different extensions that perform this process. Each extension implements the buildArchitecture() method as the formal entry point for the bootstrapping process.
|
pure virtual |
Build an Architecture given a raw file or data.
This is implemented by each separate extension. The method is handed a filename and possibly external target information and must build the Architecture object, initializing all the major subcomponents, using just this info.
filename | is the path to the executable file to examine |
target | if non-empty is a language id string |
estream | is an output stream for error messages |
Implemented in ghidra::BfdArchitectureCapability, ghidra::RawBinaryArchitectureCapability, and ghidra::XmlArchitectureCapability.
Referenced by ghidra::FunctionTestCollection::buildProgram().
|
static |
Find an extension to process a file.
Given a specific file, find an ArchitectureCapability that can handle it.
filename | is the path to the file |
References isFileMatch(), and thelist.
|
static |
Find an extension to process an XML document.
Given a parsed XML document, find an ArchitectureCapability that can handle it.
doc | is the parsed XML document |
References isXmlMatch(), and thelist.
|
static |
Get a capability by name.
Return the ArchitectureCapability object with the matching name
name | is the name to match |
References getName(), name, and thelist.
Referenced by ghidra::FunctionTestCollection::buildProgram().
|
virtual |
Do specialized initialization.
This builds a list of just the ArchitectureCapability extensions.
Implements ghidra::CapabilityPoint.
References thelist.
|
pure virtual |
Determine if this extension can handle this file.
filename | is the name of the file to examine |
Implemented in ghidra::BfdArchitectureCapability, ghidra::RawBinaryArchitectureCapability, and ghidra::XmlArchitectureCapability.
Referenced by findCapability().
|
pure virtual |
Determine is this extension can handle this XML document.
If a file to analyze is XML based, this method examines the XML parse to determine if this extension can understand the document
doc | is the parsed XML document |
Implemented in ghidra::BfdArchitectureCapability, ghidra::RawBinaryArchitectureCapability, and ghidra::XmlArchitectureCapability.
Referenced by findCapability().
|
static |