53 std::string inst_dist;
64 if (
const csh *curr_handle =
currHandle(
pc); curr_handle !=
nullptr) {
65 size_t count = cs_disasm(*curr_handle, (uint8_t*)&mach_inst,
66 inst->
size(), 0, 0, &insn);
72 for (
int idx = 0; idx <
count; idx++) {
73 inst_dist +=
csprintf(
" %s %s", insn[idx].mnemonic, insn[idx].op_str);
77 inst_dist +=
" capstone failure";
virtual uint64_t getEMI() const
std::string disassemble(StaticInstPtr inst, const PCStateBase &pc, const loader::SymbolTable *symtab) const override
CapstoneDisassembler(const Params &p)
virtual const csh * currHandle(const PCStateBase &pc) const =0
Return a pointer to the current capstone handle (csh).
The base InstDisassembler class provides a one-API interface to disassemble the instruction passed as...
virtual std::string disassemble(StaticInstPtr inst, const PCStateBase &pc, const loader::SymbolTable *symtab) const
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::string csprintf(const char *format, const Args &...args)