Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
19 #ifndef __GHIDRA_ARCH__
20 #define __GHIDRA_ARCH__
63 mutable string warnings;
70 bool sendParamMeasures;
81 virtual void modifySpaces(
Translate *trans) {}
82 virtual void postSpecFile(
void);
83 virtual void resolveArchitecture(
void);
85 ArchitectureGhidra(
const string &pspec,
const string &cspec,
const string &tspec,
const string &corespec,istream &i,ostream &o);
86 const string &getWarnings(
void)
const {
return warnings; }
87 void clearWarnings(
void) { warnings.clear(); }
96 bool isNameUsed(
const string &nm,uint8 startId,uint8 stopId);
111 bool getSendSyntaxTree(
void)
const {
return sendsyntaxtree; }
119 bool getSendCCode(
void)
const {
return sendCcode; }
128 bool getSendParamMeasures(
void)
const {
return sendParamMeasures; }
static int4 readToAnyBurst(istream &s)
Read the next message protocol marker.
Definition: ghidra_arch.cc:63
Document * getCPoolRef(const vector< uintb > &refs)
Resolve a constant pool reference.
Definition: ghidra_arch.cc:791
static bool readBoolStream(istream &s)
Read a boolean value from the client.
Definition: ghidra_arch.cc:88
static void segvHandler(int4 sig)
Handler for a segment violation (SIGSEGV) signal.
Definition: ghidra_arch.cc:28
void setSendParamMeasures(bool val)
Toggle whether recovered parameter information is emitted as part of the main decompile action.
Definition: ghidra_arch.hh:126
The lowest level error generated by the decompiler.
Definition: error.hh:44
Document * getRegister(const string ®name)
Retrieve a register description given a name.
Definition: ghidra_arch.cc:405
string type
The name of the Java exception class.
Definition: ghidra_arch.hh:34
Document * getTrackedRegisters(const Address &addr)
Retrieve tracked register values at the given address.
Definition: ghidra_arch.cc:447
string getUserOpName(int4 index)
Get the name of a user-defined p-code op.
Definition: ghidra_arch.cc:465
string getCodeLabel(const Address &addr)
Retrieve a label at the given address.
Definition: ghidra_arch.cc:590
static uint1 * readPackedStream(istream &s)
Read packed p-code op information.
Definition: ghidra_arch.cc:167
A complete in-memory XML document.
Definition: xml.hh:206
static Document * readXMLAll(istream &s)
Read a whole response as an XML document.
Definition: ghidra_arch.cc:237
A collection of p-code injection payloads.
Definition: pcodeinject.hh:162
A collection of Symbol objects within a single (namespace or functional) scope.
Definition: database.hh:402
static void readStringStream(istream &s, string &res)
Receive a string from the client.
Definition: ghidra_arch.cc:117
Exception that mirrors exceptions thrown by the Ghidra client.
Definition: ghidra_arch.hh:33
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
bool isNameUsed(const string &nm, uint8 startId, uint8 stopId)
Is given name used along namespace path.
Definition: ghidra_arch.cc:563
Context needed to emit a p-code injection as a full set of p-code operations.
Definition: pcodeinject.hh:56
static void readResponseEnd(istream &s)
Read the ending query response protocol marker.
Definition: ghidra_arch.cc:225
Document * getPcodeInject(const string &name, int4 type, const InjectContext &con)
Retrieve p-code to inject for a specific context.
Definition: ghidra_arch.cc:763
Document * getNamespacePath(uint8 id)
Get a description of a namespace path.
Definition: ghidra_arch.cc:549
uint1 * getPcodePacked(const Address &addr)
Get p-code for a single instruction.
Definition: ghidra_arch.cc:488
static void writeStringStream(ostream &s, const string &msg)
Send a string to the client.
Definition: ghidra_arch.cc:196
Architecture and associated classes that help manage a single processor architecture and load image.
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
Document * getComments(const Address &fad, uint4 flags)
Retrieve comments for a particular function.
Definition: ghidra_arch.cc:635
The base datatype class for the decompiler.
Definition: type.hh:62
static void passJavaException(ostream &s, const string &tp, const string &msg)
Send an exception message to the Ghidra client.
Definition: ghidra_arch.cc:268
Document * getExternalRefXML(const Address &addr)
Retrieve a description of an external function.
Definition: ghidra_arch.cc:530
static bool isDynamicSymbolName(const string &nm)
Check if name is of form FUN_.. or DAT_..
Definition: ghidra_arch.cc:856
Document * getMappedSymbolsXML(const Address &addr)
Get symbols associated with the given address.
Definition: ghidra_arch.cc:508
The interface to a translation engine for a processor.
Definition: translate.hh:294
virtual void printMessage(const string &message) const
Print an error message to console.
Definition: ghidra_arch.cc:826
Data defining a specific memory location.
Definition: pcoderaw.hh:33
An implementation of the Architecture interface and connection to a Ghidra client.
Definition: ghidra_arch.hh:60
void getStringData(vector< uint1 > &buffer, const Address &addr, Datatype *ct, int4 maxBytes, bool &isTrunc)
Get string data at a specific address.
Definition: ghidra_arch.cc:705
Document * getType(const string &name, uint8 id)
Retrieve a data-type description for the given name and id.
Definition: ghidra_arch.cc:613
void getBytes(uint1 *buf, int4 size, const Address &inaddr)
Retrieve bytes in the LoadImage at the given address.
Definition: ghidra_arch.cc:658
A container for parsed XML documents.
Definition: xml.hh:249
void setSendCCode(bool val)
Toggle whether the recovered source code is emitted as part of the main decompile action.
Definition: ghidra_arch.hh:117
static void readToResponse(istream &s)
Read the query response protocol marker.
Definition: ghidra_arch.cc:207
static Document * readXMLStream(istream &s)
Receive an XML document from the client.
Definition: ghidra_arch.cc:145
string getRegisterName(const VarnodeData &vndata)
Retrieve a register name given its storage location.
Definition: ghidra_arch.cc:422
static uint1 * readPackedAll(istream &s)
Read a whole response as packed p-code op information.
Definition: ghidra_arch.cc:251
void setSendSyntaxTree(bool val)
Toggle whether the data-flow and control-flow is emitted as part of the main decompile action.
Definition: ghidra_arch.hh:109
ArchitectureGhidra(const string &pspec, const string &cspec, const string &tspec, const string &corespec, istream &i, ostream &o)
Construct given specification files and i/o streams.
Definition: ghidra_arch.cc:840