ROSE  0.11.97.0
DisassemblerJvm.h
1 #ifndef ROSE_BinaryAnalysis_DisassemblerJvm_H
2 #define ROSE_BinaryAnalysis_DisassemblerJvm_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 
18 public:
21 
22 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
23 private:
24  friend class boost::serialization::access;
25 
26  template<class S>
27  void serialize(S &s, const unsigned /*version*/) {
28  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Disassembler::Base);
29  }
30 #endif
31 
32 protected:
34 
35 public:
37  static Ptr instance();
38 
39  virtual ~DisassemblerJvm();
40  virtual Base::Ptr clone() const override;
41  virtual bool canDisassemble(SgAsmGenericHeader*) const override;
42  virtual Unparser::BasePtr unparser() const override;
44  virtual SgAsmInstruction* disassembleOne(const MemoryMap::Ptr&, rose_addr_t va, AddressSet *successors = NULL) override;
45 
46 private:
47  size_t append_tableswitch(const MemoryMap::Ptr &map, rose_addr_t start,
48  SgUnsignedCharList &chars, SgAsmOperandList* operands);
49  template <class T>
50  size_t append_operand(const MemoryMap::Ptr &map, rose_addr_t va,
51  SgUnsignedCharList &chars, SgAsmOperandList* operands);
52 
53  /* beginning offset to code segment being processed */
54  rose_addr_t code_offset_;
55 public:
56  rose_addr_t code_offset() {return code_offset_;}
57  void code_offset(rose_addr_t offset) {code_offset_ = offset;}
58 };
59 
60 } // namespace
61 } // namespace
62 
63 #endif
64 #endif
Base class for machine instructions.
virtual SgAsmInstruction * makeUnknownInstruction(const Disassembler::Exception &) override
Makes an unknown instruction from an exception.
Main namespace for the ROSE library.
virtual Base::Ptr clone() const override
Creates a new copy of a disassembler.
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
Sawyer::SharedPointer< DisassemblerJvm > Ptr
Reference counting pointer.
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.
Base class for container file headers.
List of operands for an instruction.
static Ptr instance()
Allocating constructor.
Binary analysis.
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...
Virtual base class for instruction disassemblers.