X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fdisassembler%2Fllvm%2FLLVMDisassembler.cxx;h=a194d2144d459d407efa769596a2975e72ed0a44;hp=6e76c91bc27c8121f7088460401ae3c20d4faf47;hb=f47dd6b106b9ba1d6363277b47cdec2ac0448f6c;hpb=cd5fda05c80a6cd3c31a7884559d985ef79473f7 diff --git a/src/disassembler/llvm/LLVMDisassembler.cxx b/src/disassembler/llvm/LLVMDisassembler.cxx index 6e76c91..a194d21 100644 --- a/src/disassembler/llvm/LLVMDisassembler.cxx +++ b/src/disassembler/llvm/LLVMDisassembler.cxx @@ -283,7 +283,8 @@ void LLVMDisassembler::forEachFunction(std::function }); } -void LLVMDisassembler::printEachInstruction(uint64_t start, uint64_t end, std::function fun) { +void LLVMDisassembler::printEachInstruction(uint64_t start, uint64_t end, + std::function fun) { SectionRef text_section = sections[".text"]; uint64_t base_address; text_section.getAddress(base_address); @@ -304,16 +305,11 @@ void LLVMDisassembler::printEachInstruction(uint64_t start, uint64_t end, std::f uint8_t bytes[inst_size+2]; ref.readBytes(current_address, inst_size, bytes); - for(uint8_t* cur = bytes; cur < bytes + inst_size; ++cur) { - s.write_hex(*cur); - s << ' '; - } - s << '\t'; IP->printInst(&inst, s, ""); - fun(s.str()); + fun(bytes, inst_size, s.str()); } else { - fun("Invalid Byte"); + fun(NULL, 0, "Invalid Byte"); inst_size = 1; }