Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Functions | |
static SHParam | sh_op_get_param (ut16 opcode, SHParamBuilder shb) |
Get SHParam from opcode Make sure the opcode is passed in little-endian form. More... | |
static SHParam | sh_op_get_param_movl (ut16 opcode, bool m) |
Get params for mov.l instruction (0001NMD) A special function is required because the nibbles for the second param (@(disp:Rn)) (i.e. N and D) are separated by the nibble for the first param (Rm) (i.e. M), so sh_op_get_param cannot be used. More... | |
RZ_IPI RZ_OWN SHOp * | sh_disassembler (ut16 opcode) |
Disassemble opcode and return a SHOp. More... | |
RZ_IPI RZ_OWN char * | sh_op_param_to_str (SHParam param, SHScaling scaling, ut64 pc) |
Return string representation of disassembled param . More... | |
RZ_IPI RZ_OWN char * | sh_op_to_str (RZ_NONNULL const SHOp *op, ut64 pc) |
Return string representation of disassembled op . More... | |
Variables | |
const SHOpRaw | sh_op_lookup [] |
const ut32 | OPCODE_NUM |
Disassemble opcode
and return a SHOp.
opcode | 16 bit wide opcode |
Definition at line 130 of file disassembler.c.
References i, mask, sh_op_raw_t::mnemonic, MOVL, NULL, op, sh_op_raw_t::opcode, OPCODE_NUM, sh_op_raw_t::param_builder, RZ_LOG_DEBUG, RZ_NEW, sh_op_raw_t::scaling, sh_op_get_param(), sh_op_get_param_movl(), sh_op_lookup, and sh_op_raw_t::str_mnem.
Referenced by disassemble(), and sh_op().
|
static |
Get SHParam from opcode Make sure the opcode is passed in little-endian form.
opcode | instruction opcode (assumed to be in little-endian) |
shb | SHParamBuilder instance which contains the necessary info to find the param |
Definition at line 18 of file disassembler.c.
References sh_param_builder_t::addr, sh_param_builder_addr_t::bits, extract, sh_param_builder_t::is_param, len, sh_param_builder_addr_t::mode, sh_param_t::mode, sh_param_builder_t::param, sh_param_t::param, SH_ADDR_INVALID, SH_GBR_INDIRECT_DISP, SH_GBR_INDIRECT_INDEXED, SH_IMM_S, SH_IMM_U, SH_PC_RELATIVE12, SH_PC_RELATIVE8, SH_PC_RELATIVE_DISP, SH_PC_RELATIVE_REG, SH_REG_DIRECT, SH_REG_IND_R0B, SH_REG_INDIRECT, SH_REG_INDIRECT_D, SH_REG_INDIRECT_DISP, SH_REG_INDIRECT_I, SH_REG_INDIRECT_INDEXED, and sh_param_builder_addr_t::start.
Referenced by sh_disassembler().
Get params for mov.l instruction (0001NMD) A special function is required because the nibbles for the second param (@(disp:Rn)) (i.e. N and D) are separated by the nibble for the first param (Rm) (i.e. M), so sh_op_get_param cannot be used.
opcode | opcode |
m | if true, get Rm ; otherwise get @(disp:Rn) |
Definition at line 110 of file disassembler.c.
References d, regress::m, n, reg, SH_REG_DIRECT, and SH_REG_INDIRECT_DISP.
Referenced by sh_disassembler().
Return string representation of disassembled param
.
SHParam | to be disassembled |
SHScaling | of the instruction associated with the param |
Definition at line 166 of file disassembler.c.
References sh_param_t::mode, NULL, sh_param_t::param, pc, rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), rz_warn_if_reached, SH_ADDR_INVALID, SH_GBR_INDIRECT_DISP, SH_GBR_INDIRECT_INDEXED, SH_IMM_S, SH_IMM_U, SH_PC_RELATIVE12, SH_PC_RELATIVE8, SH_PC_RELATIVE_DISP, SH_PC_RELATIVE_REG, SH_REG_DIRECT, SH_REG_INDIRECT, SH_REG_INDIRECT_D, SH_REG_INDIRECT_DISP, SH_REG_INDIRECT_I, SH_REG_INDIRECT_INDEXED, sh_registers, sh_scaling_size, st32, and st8.
Referenced by sh_op_to_str().
Return string representation of disassembled op
.
SHOp | to be disassembled |
Definition at line 224 of file disassembler.c.
References free(), NULL, pc, rz_return_val_if_fail, rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), and sh_op_param_to_str().
Referenced by disassemble().
Definition at line 195 of file lookup.c.
Referenced by sh_disassembler().
Definition at line 7 of file lookup.c.
Referenced by sh_disassembler().