Ghidra Decompiler Analysis Engine
bfd_arch.hh
Go to the documentation of this file.
1 /* ###
2  * IP: GHIDRA
3  * NOTE: Interface to GNU BFD library which is GPL 3
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
19 
20 #include "sleigh_arch.hh"
21 #include "loadimage_bfd.hh"
22 
25  static BfdArchitectureCapability bfdArchitectureCapability;
29 public:
30  virtual ~BfdArchitectureCapability(void);
31  virtual Architecture *buildArchitecture(const string &filename,const string &target,ostream *estream);
32  virtual bool isFileMatch(const string &filename) const;
33  virtual bool isXmlMatch(Document *doc) const;
34 };
35 
38  long adjustvma;
39  virtual void buildLoader(DocumentStorage &store);
40  virtual void resolveArchitecture(void);
41  virtual void postSpecFile(void);
42 public:
43  virtual void saveXml(ostream &s) const;
44  virtual void restoreXml(DocumentStorage &store);
45  BfdArchitecture(const string &fname,const string &targ,ostream *estream);
46  virtual ~BfdArchitecture(void) {}
47 };
BfdArchitecture::BfdArchitecture
BfdArchitecture(const string &fname, const string &targ, ostream *estream)
Constructor.
Definition: bfd_arch.cc:121
BfdArchitecture::saveXml
virtual void saveXml(ostream &s) const
Serialize this architecture to XML.
Definition: bfd_arch.cc:128
sleigh_arch.hh
Architecture objects that use a Translate object derived from Sleigh.
BfdArchitecture
Architecture that reads executable files using GNU BFD libraries.
Definition: bfd_arch.hh:37
BfdArchitectureCapability
Extension point for building a GNU BFD capable Architecture.
Definition: bfd_arch.hh:24
BfdArchitectureCapability::buildArchitecture
virtual Architecture * buildArchitecture(const string &filename, const string &target, ostream *estream)
Build an Architecture given a raw file or data.
Definition: bfd_arch.cc:34
Document
A complete in-memory XML document.
Definition: xml.hh:206
Architecture
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
BfdArchitecture::restoreXml
virtual void restoreXml(DocumentStorage &store)
Restore the Architecture state from an XML stream.
Definition: bfd_arch.cc:140
BfdArchitectureCapability::isFileMatch
virtual bool isFileMatch(const string &filename) const
Determine if this extension can handle this file.
Definition: bfd_arch.cc:40
SleighArchitecture
An Architecture that uses the decompiler's native SLEIGH translation engine.
Definition: sleigh_arch.hh:89
BfdArchitectureCapability::isXmlMatch
virtual bool isXmlMatch(Document *doc) const
Determine is this extension can handle this XML document.
Definition: bfd_arch.cc:57
DocumentStorage
A container for parsed XML documents.
Definition: xml.hh:249
ArchitectureCapability
Abstract extension point for building Architecture objects.
Definition: architecture.hh:71