Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
19 #ifndef __STRING_MANAGE__
20 #define __STRING_MANAGE__
63 static int4
readUtf16(
const uint1 *buf,
bool bigend);
64 static void writeUtf8(ostream &s,int4 codepoint);
65 static int4
getCodepoint(
const uint1 *buf,int4 charsize,
bool bigend,int4 &skip);
75 int4 checkCharacters(
const uint1 *buf,int4 size,int4 charsize)
const;
81 bool writeUnicode(ostream &s,uint1 *buffer,int4 size,int4 charsize);
bool writeUnicode(ostream &s, uint1 *buffer, int4 size, int4 charsize)
Translate/copy unicode to UTF8.
Definition: stringmanage.cc:374
bool isString(const Address &addr, Datatype *charType)
Definition: stringmanage.cc:78
StringManager(int4 max)
Constructor.
Definition: stringmanage.cc:20
void saveXml(ostream &s) const
Save cached strings to a stream as XML.
Definition: stringmanage.cc:88
bool isTruncated
true if the the string is truncated
Definition: stringmanage.hh:36
StringManagerUnicode(Architecture *g, int4 max)
Constructor.
Definition: stringmanage.cc:263
An XML element. A node in the DOM tree.
Definition: xml.hh:150
static int4 getCodepoint(const uint1 *buf, int4 charsize, bool bigend, int4 &skip)
Extract next unicode codepoint.
Definition: stringmanage.cc:200
An implementation of StringManager that understands terminated unicode strings.
Definition: stringmanage.hh:72
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
String data (a sequence of bytes) stored by StringManager.
Definition: stringmanage.hh:34
vector< uint1 > byteData
UTF8 encoded string data.
Definition: stringmanage.hh:37
static int4 readUtf16(const uint1 *buf, bool bigend)
Read a UTF16 code point from a byte array.
Definition: stringmanage.cc:177
virtual const vector< uint1 > & getStringData(const Address &addr, Datatype *charType, bool &isTrunc)
Retrieve string data at the given address as a UTF8 byte array.
Definition: stringmanage.cc:276
virtual const vector< uint1 > & getStringData(const Address &addr, Datatype *charType, bool &isTrunc)=0
Retrieve string data at the given address as a UTF8 byte array.
void restoreXml(const Element *el, const AddrSpaceManager *m)
Restore string cache from XML.
Definition: stringmanage.cc:114
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
The base datatype class for the decompiler.
Definition: type.hh:62
Classes for describing and printing data-types.
static bool hasCharTerminator(const uint1 *buffer, int4 size, int4 charsize)
Check for a unicode string terminator.
Definition: stringmanage.cc:157
A manager for different address spaces.
Definition: translate.hh:218
int4 maximumChars
Maximum characters in a string before truncating.
Definition: stringmanage.hh:40
virtual ~StringManager(void)
Destructor.
Definition: stringmanage.cc:26
map< Address, StringData > stringMap
Map from address to string data.
Definition: stringmanage.hh:39
static void writeUtf8(ostream &s, int4 codepoint)
Write unicode character to stream in UTF8 encoding.
Definition: stringmanage.cc:36
Storage for decoding and storing strings associated with an address.
Definition: stringmanage.hh:31