Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
19 #ifndef __SLEIGH_ARCH__
20 #define __SLEIGH_ARCH__
22 #include "filemanage.hh"
36 const string &getName(
void)
const {
return name; }
37 const string &getSpec(
void)
const {
return spec; }
38 const string &getId(
void)
const {
return id; }
60 vector<CompilerTag> compilers;
61 vector<TruncationTag> truncations;
65 const string &getProcessor(
void)
const {
return processor; }
66 bool isBigEndian(
void)
const {
return isbigendian; }
67 int4 getSize(
void)
const {
return size; }
68 const string &getVariant(
void)
const {
return variant; }
69 const string &getVersion(
void)
const {
return version; }
70 const string &getSlaFile(
void)
const {
return slafile; }
71 const string &getProcessorSpec(
void)
const {
return processorspec; }
72 const string &getId(
void)
const {
return id; }
73 const string &getDescription(
void)
const {
return description; }
74 bool isDeprecated(
void)
const {
return deprecated; }
76 int4 numTruncations(
void)
const {
return truncations.size(); }
77 const TruncationTag &getTruncation(int4 i)
const {
return truncations[i]; }
90 static Sleigh *last_sleigh;
91 static int4 last_languageindex;
92 static vector<LanguageDescription> description;
96 static void loadLanguageDescription(
const string &specfile,ostream &errs);
97 bool isTranslateReused(
void);
109 const string &getFilename(
void)
const {
return filename; }
110 const string &getTarget(
void)
const {
return target; }
115 virtual string getDescription(
void)
const;
void restoreXmlHeader(const Element *el)
Restore from XML basic attributes of an executable.
Definition: sleigh_arch.cc:322
virtual PcodeInjectLibrary * buildPcodeInjectLibrary(void)
Build the injection library.
Definition: sleigh_arch.cc:162
static void collectSpecFiles(ostream &errs)
Gather specification files in normal locations.
Definition: sleigh_arch.cc:301
static string normalizeEndian(const string &nm)
Try to recover a language id endianess field.
Definition: sleigh_arch.cc:345
static string normalizeArchitecture(const string &nm)
Try to recover a language id string.
Definition: sleigh_arch.cc:379
static void shutdown(void)
Shutdown this SleighArchitecture and free all resources.
Definition: sleigh_arch.cc:463
Definition: filemanage.hh:29
virtual void modifySpaces(Translate *trans)
Modify address spaces as required by this Architecture.
Definition: sleigh_arch.cc:273
A collection of p-code injection payloads.
Definition: pcodeinject.hh:162
An XML element. A node in the DOM tree.
Definition: xml.hh:150
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
Contents of the <language> tag in a .ldefs file.
Definition: sleigh_arch.hh:49
A full SLEIGH engine.
Definition: sleigh.hh:158
static FileManage specpaths
Known directories that contain .ldefs files.
Definition: sleigh_arch.hh:123
Object for describing how a space should be truncated.
Definition: translate.hh:63
virtual void resolveArchitecture(void)
Figure out the processor and compiler of the target executable.
Definition: sleigh_arch.cc:171
void restoreXml(const Element *el)
Restore the record from an XML stream.
Definition: sleigh_arch.cc:27
Classes and utilities for the main SLEIGH engine.
virtual void buildSpecFile(DocumentStorage &store)
Load any relevant specification files.
Definition: sleigh_arch.cc:202
Architecture and associated classes that help manage a single processor architecture and load image.
An Architecture that uses the decompiler's native SLEIGH translation engine.
Definition: sleigh_arch.hh:89
virtual void printMessage(const string &message) const
Print an error message to console.
Definition: sleigh_arch.hh:113
The interface to a translation engine for a processor.
Definition: translate.hh:294
ostream * errorstream
Error stream associated with this SleighArchitecture.
Definition: sleigh_arch.hh:99
static void scanForSleighDirectories(const string &rootpath)
Scan directories for SLEIGH specification files.
Definition: sleigh_arch.cc:422
void restoreXml(const Element *el)
Read the XML tag from stream.
Definition: sleigh_arch.cc:37
const CompilerTag & getCompiler(const string &nm) const
Get compiler specification of the given name.
Definition: sleigh_arch.cc:75
A container for parsed XML documents.
Definition: xml.hh:249
static string normalizeProcessor(const string &nm)
Try to recover a language id processor field.
Definition: sleigh_arch.cc:333
SleighArchitecture(const string &fname, const string &targ, ostream *estream)
Construct given executable file.
Definition: sleigh_arch.cc:288
virtual Translate * buildTranslator(DocumentStorage &store)
Build the Translator object.
Definition: sleigh_arch.cc:148
void saveXmlHeader(ostream &s) const
Write out (as XML) basic attributes of the active executable.
Definition: sleigh_arch.cc:314
Contents of a <compiler> tag in a .ldefs file.
Definition: sleigh_arch.hh:29
static string normalizeSize(const string &nm)
Try to recover a language id size field.
Definition: sleigh_arch.cc:359