]> git.siccegge.de Git - frida/frida.git/commitdiff
Include absolute branch address
authorChristoph Egger <siccegge@cs.fau.de>
Tue, 3 Jun 2014 17:04:37 +0000 (19:04 +0200)
committerChristoph Egger <siccegge@cs.fau.de>
Tue, 3 Jun 2014 17:04:37 +0000 (19:04 +0200)
src/disassembler/llvm/LLVMDisassembler.cxx

index 240e5c560952b35a1de3719aead77058775a7de8..76b313de3bf996d0d355bc69e9b004c47d476efb 100644 (file)
@@ -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);