From: Christoph Egger Date: Thu, 18 Dec 2014 11:21:33 +0000 (+0100) Subject: Only disassemble the text segment X-Git-Tag: v0.1~153 X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=cc7580dd344851907ef3003b838da0aa41f6aaf2;p=frida%2Ffrida.git Only disassemble the text segment --- diff --git a/src/disassembler/llvm/LLVMDisassembler.cxx b/src/disassembler/llvm/LLVMDisassembler.cxx index 3642c5e..6b3402e 100644 --- a/src/disassembler/llvm/LLVMDisassembler.cxx +++ b/src/disassembler/llvm/LLVMDisassembler.cxx @@ -129,6 +129,16 @@ LLVMDisassembler::~LLVMDisassembler() { } Function* LLVMDisassembler::disassembleFunctionAt(uint64_t address, const std::string& name) { + SectionRef text_section = sections[".text"]; + uint64_t base_address, size; + text_section.getAddress(base_address); + text_section.getSize(size); + + if (address < base_address || + address >= base_address + size) { + return NULL; + } + if (functions.find(address) != functions.end()) { return functions[address]; }