ROSE  0.11.98.0
Rose/BinaryAnalysis/Disassembler/Jvm.h
1 #ifndef ROSE_BinaryAnalysis_Disassembler_Jvm_H
2 #define ROSE_BinaryAnalysis_Disassembler_Jvm_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #include <Rose/BinaryAnalysis/Disassembler/Base.h>
7 #include <boost/serialization/access.hpp>
8 #include <boost/serialization/base_object.hpp>
9 
10 namespace Rose {
11 namespace BinaryAnalysis {
12 namespace Disassembler {
13 
18 class Jvm: public Base {
19 public:
22 
23 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
24 private:
25  friend class boost::serialization::access;
26 
27  template<class S>
28  void serialize(S &s, const unsigned /*version*/) {
29  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Disassembler::Base);
30  }
31 #endif
32 
33 protected:
34  Jvm();
35 
36 public:
38  static Ptr instance();
39 
40  virtual ~Jvm();
41  virtual Base::Ptr clone() const override;
42  virtual bool canDisassemble(SgAsmGenericHeader*) const override;
43  virtual Unparser::BasePtr unparser() const override;
45  virtual SgAsmInstruction* disassembleOne(const MemoryMap::Ptr&, rose_addr_t va, AddressSet *successors = NULL) override;
46 
47 private:
48  size_t append_tableswitch(const MemoryMap::Ptr &map, rose_addr_t start,
49  SgUnsignedCharList &chars, SgAsmOperandList* operands);
50  template <class T>
51  size_t append_operand(const MemoryMap::Ptr &map, rose_addr_t va,
52  SgUnsignedCharList &chars, SgAsmOperandList* operands);
53 
54  /* beginning offset to code segment being processed */
55  rose_addr_t code_offset_;
56 public:
57  rose_addr_t code_offset() {return code_offset_;}
58  void code_offset(rose_addr_t offset) {code_offset_ = offset;}
59 };
60 
61 } // namespace
62 } // namespace
63 } // namespace
64 
65 #endif
66 #endif
static Ptr instance()
Allocating constructor.
Base class for machine instructions.
Sawyer::SharedPointer< Jvm > Ptr
Reference counting pointer.
virtual Base::Ptr clone() const override
Creates a new copy of a disassembler.
virtual SgAsmInstruction * disassembleOne(const MemoryMap::Ptr &, rose_addr_t va, AddressSet *successors=NULL) override
This is the lowest level disassembly function and is implemented in the architecture-specific subclas...
Main namespace for the ROSE library.
Base class for container file headers.
List of operands for an instruction.
Binary analysis.
virtual Unparser::BasePtr unparser() const override
Unparser.
virtual bool canDisassemble(SgAsmGenericHeader *) const override
Predicate determining the suitability of a disassembler for a specific file header.
Virtual base class for instruction disassemblers.
virtual SgAsmInstruction * makeUnknownInstruction(const Disassembler::Exception &) override
Makes an unknown instruction from an exception.