Ghidra Decompiler Analysis Engine
loadimage_xml.hh
Go to the documentation of this file.
1 /* ###
2  * IP: GHIDRA
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
18 
19 #ifndef __LOADIMAGE_XML__
20 #define __LOADIMAGE_XML__
21 
22 #include "loadimage.hh"
23 
28 class LoadImageXml : public LoadImage {
29  const Element *rootel;
30  string archtype;
31  const AddrSpaceManager *manage;
32  set<Address> readonlyset;
33  map<Address,vector<uint1> > chunk;
34  map<Address,string> addrtosymbol;
35  mutable map<Address,string>::const_iterator cursymbol;
36  void pad(void);
37 public:
38  LoadImageXml(const string &f,const Element *el);
39  void open(const AddrSpaceManager *m);
40  void clear(void);
41  void saveXml(ostream &s) const;
42  virtual ~LoadImageXml(void) { clear(); }
43  virtual void loadFill(uint1 *ptr,int4 size,const Address &addr);
44  virtual void openSymbols(void) const;
45  virtual bool getNextSymbol(LoadImageFunc &record) const;
46  virtual void getReadonly(RangeList &list) const;
47  virtual string getArchType(void) const { return archtype; }
48  virtual void adjustVma(long adjust);
49 };
50 
51 #endif
LoadImageXml::loadFill
virtual void loadFill(uint1 *ptr, int4 size, const Address &addr)
Get data from the LoadImage.
Definition: loadimage_xml.cc:192
LoadImageXml::getArchType
virtual string getArchType(void) const
Get a string indicating the architecture type.
Definition: loadimage_xml.hh:47
loadimage.hh
Classes and API for accessing a binary load image.
LoadImageXml::clear
void clear(void)
Clear out all the caches.
Definition: loadimage_xml.cc:134
LoadImageXml::saveXml
void saveXml(ostream &s) const
Save the image back out to an XML stream.
Definition: loadimage_xml.cc:35
Element
An XML element. A node in the DOM tree.
Definition: xml.hh:150
LoadImage
An interface into a particular binary executable image.
Definition: loadimage.hh:71
LoadImageXml::openSymbols
virtual void openSymbols(void) const
Prepare to read symbols.
Definition: loadimage_xml.cc:230
RangeList
A disjoint set of Ranges, possibly across multiple address spaces.
Definition: address.hh:203
LoadImageFunc
A record indicating a function symbol.
Definition: loadimage.hh:36
LoadImageXml::LoadImageXml
LoadImageXml(const string &f, const Element *el)
Constructor.
Definition: loadimage_xml.cc:21
Address
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
LoadImageXml::adjustVma
virtual void adjustVma(long adjust)
Adjust load addresses with a global offset.
Definition: loadimage_xml.cc:262
LoadImageXml::getReadonly
virtual void getReadonly(RangeList &list) const
Return list of readonly address ranges.
Definition: loadimage_xml.cc:246
LoadImageXml
Implementation of the LoadImage interface using underlying data stored in an XML format.
Definition: loadimage_xml.hh:28
LoadImageXml::getNextSymbol
virtual bool getNextSymbol(LoadImageFunc &record) const
Get the next symbol record.
Definition: loadimage_xml.cc:236
LoadImageXml::open
void open(const AddrSpaceManager *m)
Read XML tags into the containers.
Definition: loadimage_xml.cc:67
AddrSpaceManager
A manager for different address spaces.
Definition: translate.hh:218