1#ifndef ROSE_BinaryAnalysis_ByteCode_Analysis_H
2#define ROSE_BinaryAnalysis_ByteCode_Analysis_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/Disassembler/BasicTypes.h>
7#include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
8#include <Rose/Progress.h>
13namespace BinaryAnalysis {
16namespace P2 = Partitioner2;
42 virtual std::string name()
const = 0;
62 const std::string& name()
const;
68 virtual bool isStatic()
const = 0;
69 virtual bool isSystemReserved(
const std::string &name)
const = 0;
74 virtual std::string descriptor()
const = 0;
77 virtual void annotate() = 0;
80 std::set<Address> targets()
const;
83 Class* declaringClass()
const;
84 void declaringClass(
Class *declaringClass);
91 const std::vector<BasicBlockPtr>& blocks()
const;
106 Class* class_ =
nullptr;
108 std::vector<BasicBlockPtr> blocks_;
109 InstructionMap instructionMap_;
124 virtual std::string name()
const = 0;
142 virtual std::string name()
const = 0;
165 const std::string& name()
const;
166 const std::string& baseClassName()
const;
169 virtual std::string typeSeparator()
const = 0;
170 virtual const std::vector<std::string>& strings();
172 const std::vector<Field::Ptr>& fields()
const;
173 const std::vector<Method::Ptr>& methods()
const;
174 const std::vector<Attribute::Ptr>& attributes()
const;
175 const std::vector<Interface::Ptr>& interfaces()
const;
180 virtual void partition(
const PartitionerPtr &partitioner, std::map<std::string,Address> &discoveredFunctions,
182 virtual void digraph()
const;
183 virtual void dump() = 0;
195 std::string baseClassName_;
197 std::vector<Field::Ptr> fields_;
198 std::vector<Method::Ptr> methods_;
199 std::vector<Attribute::Ptr> attributes_;
200 std::vector<Interface::Ptr> interfaces_;
201 std::vector<std::string> strings_;
219 virtual std::string name()
const;
221 std::map<std::string,Address> &discoveredFunctions);
225 const std::vector<ByteCode::Class::Ptr>& classes()
const;
229 std::vector<ByteCode::Class::Ptr> classes_;
245 static Address nextSystemReservedVa();
248 virtual std::string name()
const = 0;
249 virtual bool isSystemReserved(
const std::string &name)
const = 0;
252 const std::vector<Namespace::Ptr>& namespaces()
const;
256 std::vector<Namespace::Ptr> namespaces_;
259 static Address nextSystemReservedVa_;
Base class for ByteCode Attribute.
Base class for ByteCode Class.
void finalize()
Complete initialization of the class once partitioning is done.
Base class for ByteCode Container.
Base class for ByteCode Fields.
Base class for ByteCode Interface.
Base class for ByteCode Methods.
void finalize()
Complete initialization of the method once decoding is done.
Base class for ByteCode Namespace.
static Ptr instance()
Allocating constructor.
Creates SharedPointer from this.
Base class for reference counted objects.
Reference-counting intrusive smart pointer.
List of SgAsmInstruction nodes.
Base class for machine instructions.
Sawyer::SharedPointer< Partitioner > PartitionerPtr
Shared-ownership pointer for Partitioner.
Sawyer::SharedPointer< BasicBlock > BasicBlockPtr
Shared-ownersip pointer for BasicBlock.
Map< Address, SgAsmInstruction * > InstructionMap
Mapping from instruction addresses to instructions.
std::uint64_t Address
Address.