From 9244195b13b1673757b4bc77d6306e7b2f21244a Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Tue, 3 Jun 2014 19:04:37 +0200 Subject: [PATCH] Include absolute branch address --- src/disassembler/llvm/LLVMDisassembler.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- 2.39.5