1 #ifndef INCLUDE__Binary_hxx
2 #define INCLUDE__Binary_hxx
4 #include "include_llvm.hxx"
11 using llvm::OwningPtr;
15 Binary(const std::string& filename);
19 void disassemble_functions();
21 void disassemble_cfg();
23 std::vector<std::string> getSymbols();
25 std::vector<std::string> getFunctions();
26 void for_each_instruction(const std::string& function, std::function<void (long, std::string, std::string)> callback);
30 const llvm::Target * target;
31 llvm::object::ObjectFile * o;
33 llvm::object::Binary* binary;
34 OwningPtr<const llvm::MCRegisterInfo> MRI;
35 OwningPtr<const llvm::MCAsmInfo> AsmInfo;
36 OwningPtr<llvm::MCModule> Mod;
37 OwningPtr<llvm::MCInstPrinter> IP;
38 OwningPtr<llvm::MCDisassembler> DisAsm;
39 OwningPtr<const llvm::MCObjectFileInfo> MOFI;
40 OwningPtr<llvm::MCContext> Ctx;
41 OwningPtr<const llvm::MCInstrAnalysis> MIA;
42 OwningPtr<const llvm::MCSubtargetInfo> STI;
43 OwningPtr<const llvm::MCInstrInfo> MII;
44 OwningPtr<llvm::MCRelocationInfo> RelInfo;
45 OwningPtr<llvm::MCSymbolizer> Symzer;
47 std::map<std::string, llvm::object::SectionRef> sections;
48 std::map<std::string, llvm::object::SymbolRef> symbols;