ROSE  0.11.98.0
ByteCode/Cil.h
1 #ifndef ROSE_BinaryAnalysis_ByteCode_Cil_H
2 #define ROSE_BinaryAnalysis_ByteCode_Cil_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #include <Rose/BinaryAnalysis/ByteCode/Analysis.h>
7 
8 namespace Rose {
9 namespace BinaryAnalysis {
10 namespace ByteCode {
11 
12 class CilCode : public Code {
13 public:
14  virtual const uint8_t* bytes() const {
15  return nullptr; // UNIMPLEMENTED
16  }
17  virtual const size_t size() const {
18  return 0; // UNIMPLEMENTED
19  }
20 
21  explicit CilCode(uint8_t* bytes, size_t size, rose_addr_t offset)
22  : bytes_{bytes}, size_{size}, offset_{offset} {
23  }
24 
25 private:
26  const uint8_t* bytes_;
27  size_t size_;
28  rose_addr_t offset_;
29 };
30 
31 class CilField : public Field {
32 public:
33  virtual const std::string name() const {
34  return "CilField::name():UNIMPLEMENTED";
35  }
36 
37  CilField() = delete;
38 
39 private:
40 };
41 
42 class CilMethod : public Method {
43 public:
44  virtual const std::string name() const {
45  return "CilMethod::name():UNIMPLEMENTED";
46  }
47  virtual const Code & code() const {
48  return code_;
49  }
50  virtual const void decode(Disassembler* disassembler) const {
51  // UNIMPLEMENTED
52  }
53  virtual const SgAsmInstructionList* instructions() const {
54  return nullptr; // UNIMPLEMENTED
55  }
56 
57  CilMethod() = delete;
58  explicit CilMethod(SgAsmCilMethodDef*);
59 
60 private:
61  SgAsmCilMethodDef* sgMethod_;
62  CilCode code_;
63 };
64 
65 class CilInterface : public Interface {
66 public:
67  virtual const std::string name() const {
68  return "CilInterface::name():UNIMPLEMENTED";
69  }
70 
71  CilInterface() = delete;
72 
73 private:
74 };
75 
76 class CilAttribute : public Attribute {
77 public:
78  virtual const std::string name() const {
79  return "CilAttribute::name():UNIMPLEMENTED";
80  }
81 
82  CilAttribute() = delete;
83 
84 private:
85 };
86 
87 class CilClass : public Class {
88 public:
89  virtual const std::string name() const {
90  return "CilClass::super_name():UNIMPLEMENTED";
91  }
92  virtual const std::string super_name() const {
93  return "CilClass::super_name():UNIMPLEMENTED";
94  }
95  virtual const std::vector<std::string> &strings() const {
96  return strings_
97  }
98  virtual const std::vector<const Interface*> &interfaces() const {
99  return interfaces_;
100  }
101  virtual const std::vector<const Field*> &fields() const {
102  return fields_;
103  }
104  virtual const std::vector<const Method*> &methods() const {
105  return methods_;
106  }
107  virtual const std::vector<const Attribute*> &attributes() const {
108  return attributes_;
109  }
110 
111  CilClass() = delete;
112  explicit CilClass(SgAsmCilTypeDef*);
113 
114 private:
115  std::vector<const Field*> fields_;
116  std::vector<const Method*> methods_;
117  std::vector<const Attribute*> attributes_;
118  std::vector<const Interface*> interfaces_;
119  std::vector<std::string> strings_;
120 };
121 
122 
123 } // namespace
124 } // namespace
125 } // namespace
126 
127 #endif
128 #endif
Main namespace for the ROSE library.
CIL TypeDef table.
Binary analysis.
CIL MethodDef table.
List of SgAsmInstruction nodes.