Rizin
unix-like reverse engineering framework and cli tools
|
#include <string.h>
#include <rz_types.h>
#include <rz_lib.h>
#include <rz_asm.h>
#include <rz_analysis.h>
#include <8051_ops.h>
#include "../asm/arch/8051/8051_disas.c"
Go to the source code of this file.
Classes | |
struct | i8051_cpu_model |
struct | i8051_map_entry |
struct | i8051_plugin_context |
Macros | |
#define | e(frag) rz_strbuf_append(&op->esil, frag) |
#define | ef(frag, ...) rz_strbuf_appendf(&op->esil, frag, __VA_ARGS__) |
#define | flag_c "7,$c,c,:=," |
#define | flag_b "8,$b,c,:=," |
#define | flag_ac "3,$c,ac,:=," |
#define | flag_ab "3,$b,ac,:=," |
#define | flag_ov "6,$c,ov,:=," |
#define | flag_ob "7,$b,6,$b,^,ov,:=," |
#define | flag_p "0xff,a,&=,$p,!,p,:=," |
#define | ev_a 0 |
#define | ev_bit bitindex[buf[1] >> 3] |
#define | ev_c 0 |
#define | ev_dir1 buf[1] |
#define | ev_dir2 buf[2] |
#define | ev_dp 0 |
#define | ev_dpx 0 |
#define | ev_imm1 buf[1] |
#define | ev_imm2 buf[2] |
#define | ev_imm16 op->val |
#define | ev_ri (1 & buf[0]) |
#define | ev_rix (1 & buf[0]) |
#define | ev_rn (7 & buf[0]) |
#define | ev_sp2 0 |
#define | ev_sp1 0 |
#define | xr(subject) exr_##subject(op, ev_##subject) |
#define | xw(subject) exw_##subject(op, ev_##subject) |
#define | xi(subject, operation) exi_##subject(op, ev_##subject, operation) |
#define | bit_set ef("%d,1,<<,", buf[1] & 7) |
#define | bit_mask |
#define | bit_r |
#define | bit_c ef("%d,c,<<,", buf[1] & 7); |
#define | jmp ef("%" PFMT64d ",pc,=", op->jump) |
#define | cjmp |
#define | call |
#define | alu_op(val, aluop, flags) |
#define | alu_op_c(val, aluop, flags) |
#define | alu_op_d(val, aluop) |
#define | template_alu4_c(base, aluop, flags) |
#define | template_alu2(base, aluop) |
#define | template_alu4(base, aluop, flags) |
Variables | |
static const i8051_cpu_model | cpu_models [] |
static const int | I8051_IDATA = 0 |
static const int | I8051_SFR = 1 |
static const int | I8051_XDATA = 2 |
static const i8051_map_entry | init_mem_map [3] |
static const ut8 | bitindex [] |
RzAnalysisPlugin | rz_analysis_plugin_8051 |
RZ_API RzLibStruct | rizin_plugin |
Definition at line 411 of file analysis_8051.c.
Definition at line 414 of file analysis_8051.c.
#define alu_op_d | ( | val, | |
aluop | |||
) |
Definition at line 418 of file analysis_8051.c.
Definition at line 399 of file analysis_8051.c.
#define bit_mask |
Definition at line 392 of file analysis_8051.c.
#define bit_r |
Definition at line 395 of file analysis_8051.c.
#define bit_set ef("%d,1,<<,", buf[1] & 7) |
Definition at line 391 of file analysis_8051.c.
#define call |
Definition at line 406 of file analysis_8051.c.
#define cjmp |
Definition at line 402 of file analysis_8051.c.
#define e | ( | frag | ) | rz_strbuf_append(&op->esil, frag) |
Definition at line 218 of file analysis_8051.c.
#define ef | ( | frag, | |
... | |||
) | rz_strbuf_appendf(&op->esil, frag, __VA_ARGS__) |
Definition at line 219 of file analysis_8051.c.
#define ev_a 0 |
Definition at line 229 of file analysis_8051.c.
Definition at line 230 of file analysis_8051.c.
#define ev_c 0 |
Definition at line 231 of file analysis_8051.c.
#define ev_dir1 buf[1] |
Definition at line 232 of file analysis_8051.c.
#define ev_dir2 buf[2] |
Definition at line 233 of file analysis_8051.c.
#define ev_dp 0 |
Definition at line 234 of file analysis_8051.c.
#define ev_dpx 0 |
Definition at line 235 of file analysis_8051.c.
#define ev_imm1 buf[1] |
Definition at line 236 of file analysis_8051.c.
Definition at line 238 of file analysis_8051.c.
#define ev_imm2 buf[2] |
Definition at line 237 of file analysis_8051.c.
#define ev_ri (1 & buf[0]) |
Definition at line 239 of file analysis_8051.c.
#define ev_rix (1 & buf[0]) |
Definition at line 240 of file analysis_8051.c.
#define ev_rn (7 & buf[0]) |
Definition at line 241 of file analysis_8051.c.
#define ev_sp1 0 |
Definition at line 243 of file analysis_8051.c.
#define ev_sp2 0 |
Definition at line 242 of file analysis_8051.c.
#define flag_ab "3,$b,ac,:=," |
Definition at line 224 of file analysis_8051.c.
#define flag_ac "3,$c,ac,:=," |
Definition at line 223 of file analysis_8051.c.
#define flag_b "8,$b,c,:=," |
Definition at line 222 of file analysis_8051.c.
#define flag_c "7,$c,c,:=," |
Definition at line 221 of file analysis_8051.c.
#define flag_ob "7,$b,6,$b,^,ov,:=," |
Definition at line 226 of file analysis_8051.c.
#define flag_ov "6,$c,ov,:=," |
Definition at line 225 of file analysis_8051.c.
Definition at line 227 of file analysis_8051.c.
Definition at line 401 of file analysis_8051.c.
#define template_alu2 | ( | base, | |
aluop | |||
) |
Definition at line 444 of file analysis_8051.c.
#define template_alu4 | ( | base, | |
aluop, | |||
flags | |||
) |
Definition at line 452 of file analysis_8051.c.
#define template_alu4_c | ( | base, | |
aluop, | |||
flags | |||
) |
Definition at line 422 of file analysis_8051.c.
#define xi | ( | subject, | |
operation | |||
) | exi_##subject(op, ev_##subject, operation) |
Definition at line 389 of file analysis_8051.c.
#define xr | ( | subject | ) | exr_##subject(op, ev_##subject) |
Definition at line 387 of file analysis_8051.c.
#define xw | ( | subject | ) | exw_##subject(op, ev_##subject) |
Definition at line 388 of file analysis_8051.c.
|
static |
Definition at line 474 of file analysis_8051.c.
References a, bit, bit_c, bit_mask, bit_r, bit_set, c, call, cjmp, e, flag_ab, flag_ac, flag_b, flag_c, flag_ob, flag_ov, flag_p, jmp, rz_strbuf_init(), rz_strbuf_set(), template_alu2, template_alu4, template_alu4_c, xi, xr, and xw.
Referenced by i8051_op().
|
static |
Definition at line 1037 of file analysis_8051.c.
References rz_analysis_esil_t::cb, RZ_FREE, and rz_analysis_esil_callbacks_t::user.
|
static |
Definition at line 1015 of file analysis_8051.c.
References rz_analysis_esil_t::analysis, rz_analysis_esil_t::cb, ocbs, RZ_NEW0, set_cpu_model(), and rz_analysis_esil_callbacks_t::user.
|
static |
Definition at line 355 of file analysis_8051.c.
References ef.
|
static |
Definition at line 375 of file analysis_8051.c.
References addr, and exi_dir1().
|
static |
Definition at line 359 of file analysis_8051.c.
References ef.
|
static |
|
static |
Definition at line 363 of file analysis_8051.c.
References ef.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 261 of file analysis_8051.c.
References e.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 289 of file analysis_8051.c.
References e.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 316 of file analysis_8051.c.
References addr, and exw_dir1().
|
static |
|
static |
Definition at line 328 of file analysis_8051.c.
References e.
|
static |
|
static |
|
static |
|
static |
Definition at line 344 of file analysis_8051.c.
References e.
|
static |
|
static |
Definition at line 1042 of file analysis_8051.c.
|
static |
|
static |
Definition at line 1271 of file analysis_8051.c.
References I8051_IDATA, I8051_SFR, I8051_XDATA, init_mem_map, and RZ_NEW0.
|
static |
Definition at line 1104 of file analysis_8051.c.
References _8051_ops, A_ADDR11, A_ADDR16, A_BIT, A_DIRECT, A_IMM16, A_IMMEDIATE, A_OFFSET, A_RI, A_RN, addr, analop_esil(), apply_bank(), _8051_op_t::arg1, _8051_op_t::arg2, arg_addr11(), arg_bit(), arg_offset(), _8051_op_t::cycles, i, i8051_reg_read(), len, _8051_op_t::len, map_direct_addr(), mask, memcpy(), OP_CALL, OP_CJNE, OP_DJNZ, OP_JB, OP_JBC, OP_JC, OP_JMP, OP_JNB, OP_JNC, OP_JNZ, OP_JZ, OP_POP, OP_PUSH, OP_RET, rz_analysis_t::reg, rz_8051_disas(), RZ_ANALYSIS_OP_FAMILY_CPU, RZ_ANALYSIS_OP_MASK_ESIL, RZ_ANALYSIS_OP_MASK_HINT, RZ_ANALYSIS_STACK_INC, RZ_TYPE_COND_AL, RZ_TYPE_COND_EQ, RZ_TYPE_COND_HS, RZ_TYPE_COND_LO, RZ_TYPE_COND_NE, set_cpu_model(), and _8051_op_t::type.
Definition at line 53 of file analysis_8051.c.
References reg, regname(), rz_reg_get(), rz_reg_get_value(), and RZ_REG_TYPE_GPR.
Referenced by i8051_op(), map_direct_addr(), and set_cpu_model().
Definition at line 42 of file analysis_8051.c.
References num, reg, regname(), rz_reg_get(), rz_reg_set_value(), and RZ_REG_TYPE_GPR.
Referenced by set_cpu_model().
|
static |
Definition at line 84 of file analysis_8051.c.
References addr, rz_core_bind_t::cmd, cmdstr, rz_core_bind_t::core, rz_analysis_t::coreb, desc, rz_io_bind_t::fd_get_map, rz_io_bind_t::fd_get_name, rz_io_bind_t::fd_remap, free(), rz_io_map_t::id, rz_io_bind_t::io, rz_analysis_t::iob, maps(), NULL, rz_io_bind_t::open_at, rz_analysis_t::plugin_data, rz_list_free(), RZ_PERM_RW, and rz_str_newf().
Referenced by set_cpu_model().
|
static |
Definition at line 1096 of file analysis_8051.c.
References addr, i8051_reg_read(), and rz_analysis_t::reg.
Referenced by i8051_op().
|
static |
Definition at line 114 of file analysis_8051.c.
References rz_core_bind_t::cmd, rz_analysis_t::coreb, cpu, rz_analysis_t::cpu, cpu_models, rz_io_bind_t::fd_get_name, i, I8051_IDATA, i8051_reg_read(), i8051_reg_write(), I8051_SFR, I8051_XDATA, rz_analysis_t::iob, i8051_cpu_model::map_code, map_cpu_memory(), i8051_cpu_model::map_idata, i8051_cpu_model::map_pdata, i8051_cpu_model::map_sfr, i8051_cpu_model::map_xdata, i8051_cpu_model::name, rz_analysis_t::plugin_data, rz_analysis_t::reg, and rz_str_casecmp().
Referenced by esil_i8051_init(), and i8051_op().
Definition at line 164 of file analysis_8051.c.
|
static |
Definition at line 24 of file analysis_8051.c.
Referenced by set_cpu_model().
Definition at line 69 of file analysis_8051.c.
Referenced by i8051_init(), and set_cpu_model().
Definition at line 70 of file analysis_8051.c.
Referenced by i8051_init(), and set_cpu_model().
Definition at line 71 of file analysis_8051.c.
Referenced by i8051_init(), and set_cpu_model().
|
static |
RZ_API RzLibStruct rizin_plugin |
Definition at line 1304 of file analysis_8051.c.
RzAnalysisPlugin rz_analysis_plugin_8051 |
Definition at line 1288 of file analysis_8051.c.