Recursive disassembler
[frida/frida.git] / src / disassembler / Disassembler.hxx
1 #ifndef INCLUDE__Disassembler_hxx
2 #define INCLUDE__Disassembler_hxx
3
4 #include <string>
5 #include <functional>
6
7 #include "disassembler/BasicBlock.hxx"
8
9
10 class Disassembler {
11 public:
12 Disassembler(const std::string& filename) {}
13 virtual ~Disassembler() {}
14
15 void getSymbols();
16 uint64_t entryAddress();
17
18 virtual void forEachInstruction(const std::string& name, std::function<void (long, std::string, std::string)> callback) = 0;
19
20 // http://llvm.org/docs/doxygen/html/MCObjectDisassembler_8cpp_source.html +197
21 BasicBlock * generateControlFlowGraph(const std::string& name);
22 BasicBlock * generateControlFlowGraph(uint64_t address);
23
24 protected:
25 virtual bool isFunctionCall(uint64_t address) = 0;
26 virtual bool isJump(uint64_t address) = 0;
27 };
28
29 #endif