X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2FBinary.hxx;h=725c6a18a859d1098ec16c49a50aee622615a085;hp=aa5460e408e075ee9c91133ae8aa5a4d52e05a59;hb=0454d885d5994f4d6b765864b77998137dad7204;hpb=988726af7276c31122cd2e27adae87aa8b4049ad diff --git a/src/Binary.hxx b/src/Binary.hxx index aa5460e..725c6a1 100644 --- a/src/Binary.hxx +++ b/src/Binary.hxx @@ -1,32 +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(); -}; +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