X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2FBinary.hxx;h=725c6a18a859d1098ec16c49a50aee622615a085;hp=31d7485b8fd6ea8d6706f0764131cf3b2c94a8a1;hb=0454d885d5994f4d6b765864b77998137dad7204;hpb=9023eb3885faa52eb9729b61b401e5b131199c0d diff --git a/src/Binary.hxx b/src/Binary.hxx index 31d7485..725c6a1 100644 --- a/src/Binary.hxx +++ b/src/Binary.hxx @@ -1,34 +1,52 @@ -#include "include.hxx" +#ifndef INCLUDE__Binary_hxx +#define INCLUDE__Binary_hxx + +#include "include_llvm.hxx" +#include "Section.hxx" #include +#include +#include using llvm::OwningPtr; -class Binary { -private: - llvm::Triple triple; - const llvm::Target * target; - llvm::object::ObjectFile * o; - - OwningPtr binary; - OwningPtr MRI; - OwningPtr AsmInfo; - OwningPtr Mod; - OwningPtr IP; - OwningPtr DisAsm; - OwningPtr MOFI; - OwningPtr Ctx; - OwningPtr MIA; - OwningPtr STI; - OwningPtr MII; - OwningPtr RelInfo; - OwningPtr Symzer; -public: - Binary(const std::string& filename); - - void disassemble(); - - void disassemble_functions(); - - void disassemble_cfg(); -}; +namespace qtlldb { + class Binary { + public: + Binary(const std::string& filename); + + void disassemble(); + + void disassemble_functions(); + + void disassemble_cfg(); + + std::vector getSymbols(); + + std::vector getFunctions(); + void for_each_instruction(const std::string& function, std::function callback); + + private: + llvm::Triple triple; + const llvm::Target * target; + llvm::object::ObjectFile * o; + + llvm::object::Binary* binary; + OwningPtr MRI; + OwningPtr AsmInfo; + OwningPtr Mod; + OwningPtr IP; + OwningPtr DisAsm; + OwningPtr MOFI; + OwningPtr Ctx; + OwningPtr MIA; + OwningPtr STI; + OwningPtr MII; + OwningPtr RelInfo; + OwningPtr Symzer; + + std::map sections; + std::map symbols; + }; +} +#endif