From: Christoph Egger Date: Tue, 3 Jun 2014 17:04:37 +0000 (+0200) Subject: Include absolute branch address X-Git-Tag: v0.1~174 X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=9244195b13b1673757b4bc77d6306e7b2f21244a;p=frida%2Ffrida.git Include absolute branch address --- diff --git a/src/disassembler/llvm/LLVMDisassembler.cxx b/src/disassembler/llvm/LLVMDisassembler.cxx index 240e5c5..76b313d 100644 --- a/src/disassembler/llvm/LLVMDisassembler.cxx +++ b/src/disassembler/llvm/LLVMDisassembler.cxx @@ -324,7 +324,14 @@ void LLVMDisassembler::printEachInstruction(uint64_t start, uint64_t end, uint8_t bytes[inst_size+2]; ref.readBytes(current_address, inst_size, bytes); - IP->printInst(&inst, s, ""); + uint64_t jmptarget; + if (MIA->evaluateBranch(inst, current_address, inst_size, jmptarget)) { + std::stringstream stream; + stream << std::hex << (base_address + jmptarget); + IP->printInst(&inst, s, stream.str()); + } else + IP->printInst(&inst, s, ""); + fun(bytes, inst_size, s.str()); } else { LOG4CXX_WARN(logger, "Invalid byte at" << std::hex << current_address + base_address);