My Project
|
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 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 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 CapabilityPoint | |
static void | initializeAll (void) |
Finish initialization for all extension points. More... | |
Protected Attributes | |
string | name |
Identifier for this capability. | |
Additional Inherited Members | |
Protected Member Functions inherited from 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 BfdArchitectureCapability, RawBinaryArchitectureCapability, and XmlArchitectureCapability.
|
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 |
|
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 |
|
virtual |
Do specialized initialization.
This builds a list of just the ArchitectureCapability extensions.
Implements CapabilityPoint.
|
pure virtual |
Determine if this extension can handle this file.
filename | is the name of the file to examine |
Implemented in BfdArchitectureCapability, RawBinaryArchitectureCapability, and XmlArchitectureCapability.
|
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 BfdArchitectureCapability, RawBinaryArchitectureCapability, and XmlArchitectureCapability.
|
static |
Sort extensions.
Modify order that extensions are searched, to effect which gets a chance to run first. Right now all we need to do is make sure the raw architecture comes last