]> git.siccegge.de Git - frida/frida.git/blob - src/disassembler/Disassembler.hxx
9986ac8e3a0fd4f61f94c25b3da364b36d1a901b
[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 class BasicBlock {};
8
9 class Disassembler {
10 public:
11 Disassembler(const std::string& filename) {}
12 virtual ~Disassembler() {}
13
14 void getSymbols();
15 uint64_t entryAddress();
16
17 virtual void forEachInstruction(const std::string& name, std::function<void (long, std::string, std::string)> callback) = 0;
18
19 // http://llvm.org/docs/doxygen/html/MCObjectDisassembler_8cpp_source.html +197
20 BasicBlock * generateControlFlowGraph(const std::string& name);
21 BasicBlock * generateControlFlowGraph(uint64_t address);
22
23 protected:
24 virtual bool isFunctionCall(uint64_t address) = 0;
25 virtual bool isJump(uint64_t address) = 0;
26 };
27
28 #endif