Rizin
unix-like reverse engineering framework and cli tools
asm_mcore.c File Reference
#include <rz_asm.h>
#include <rz_lib.h>
#include "../arch/mcore/mcore.h"

Go to the source code of this file.

Functions

static int disassemble (RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
 

Variables

static mcore_handle handle = { 0 }
 
RzAsmPlugin rz_asm_plugin_mcore
 
RZ_API RzLibStruct rizin_plugin
 

Function Documentation

◆ disassemble()

static int disassemble ( RzAsm a,
RzAsmOp op,
const ut8 buf,
int  len 
)
static

Definition at line 10 of file asm_mcore.c.

10  {
11  mcore_t *instr = NULL;
12  char tmp[256];
13  if (!op || mcore_init(&handle, buf, len)) {
14  return -1;
15  }
16  op->size = 2;
17  if ((instr = mcore_next(&handle))) {
18  mcore_snprint(tmp, sizeof(tmp), a->pc, instr);
19  mcore_free(instr);
21  } else {
22  rz_asm_op_set_asm(op, "invalid");
23  }
24  return op->size;
25 }
size_t len
Definition: 6502dis.c:15
RZ_API void rz_asm_op_set_asm(RzAsmOp *op, const char *str)
Definition: aop.c:53
static mcore_handle handle
Definition: asm_mcore.c:8
#define NULL
Definition: cris-opc.c:27
voidpf void * buf
Definition: ioapi.h:138
int mcore_init(mcore_handle *handle, const ut8 *buffer, const ut32 size)
Definition: mcore.c:409
void mcore_snprint(char *str, int size, ut64 addr, mcore_t *instr)
Definition: mcore.c:469
mcore_t * mcore_next(mcore_handle *handle)
Definition: mcore.c:418
void mcore_free(mcore_t *instr)
Definition: mcore.c:432
#define a(i)
Definition: sha256.c:41
Definition: mcore.h:40
Definition: dis.c:32

References a, handle, len, mcore_free(), mcore_init(), mcore_next(), mcore_snprint(), NULL, rz_asm_op_set_asm(), and autogen_x86imm::tmp.

Variable Documentation

◆ handle

mcore_handle handle = { 0 }
static

Definition at line 8 of file asm_mcore.c.

Referenced by _cs_disasm(), add_download(), add_window_to_table(), analop(), analop_vle(), anop(), anop32(), anop64(), anop_esil(), arg(), bcs_group_name(), bs_close(), bs_disasm(), bs_disasm_iter(), bs_errno(), bs_insn_group(), bs_insn_name(), bs_malloc(), bs_op_count(), bs_op_index(), bs_open(), bs_option(), bs_reg_name(), bs_reg_read(), bs_reg_write(), crunch_away(), cs_close(), cs_disasm(), cs_disasm_iter(), cs_driver_hello(), cs_errno(), cs_group_name(), cs_insn_group(), cs_insn_name(), cs_malloc(), cs_op_count(), cs_op_index(), cs_open(), cs_option(), cs_reg_name(), cs_reg_read(), cs_reg_write(), cs_regs_access(), curl_close_cb(), del_hook(), disassemble(), eof_timer_close_cb(), fill_insn(), fs__create_junction(), fs__fchmod(), fs__fstat(), fs__ftruncate(), fs__futime(), fs__read(), fs__readlink(), fs__readlink_handle(), fs__realpath(), fs__realpath_handle(), fs__stat_handle(), fs__stat_impl_from_path(), fs__unlink(), fs__utime_handle(), fs__utime_impl_from_path(), fs__write(), getarg(), getarg2(), LLVMFuzzerTestOneInput(), M68K_getInstruction(), main(), maybe_new_socket(), mcore_analysis(), mcore_init(), mcore_next(), new_socket(), ocaml_cs_disasm(), ocaml_cs_disasm_internal(), ocaml_open(), on_close(), op_fillval(), opex(), opex64(), os390_message_queue_handler(), parse_reg64_name(), parse_reg_name(), pipe_alloc_accept(), pipe_connect_thread_proc(), pipe_shutdown_thread_proc(), poll_cb(), post_completion(), post_completion_read_wait(), post_completion_write_wait(), post_write_completion(), print_details(), print_insn(), print_insn_detail(), print_insn_detail_arm(), print_insn_detail_arm64(), print_insn_detail_m680x(), print_insn_detail_m68k(), print_insn_detail_mips(), print_insn_detail_ppc(), print_insn_detail_sparc(), print_insn_detail_sysz(), print_insn_detail_tms320c64x(), print_insn_detail_xcore(), print_progress(), print_read_write_regs(), run_basic_block_analysis(), run_command(), rz_arm_cs_32_il(), rz_event_hook(), rz_event_unhook(), RZ_PACKED(), set_access_info(), set_src_dst(), signal_handler(), skipdata_size(), SOCKOPT_SETTER(), test(), timer_close_cb(), uv__async_close(), uv__async_spin(), uv__cancel_read_console(), uv__chld(), uv__create_nul_handle(), uv__determine_vterm_state(), uv__duplicate_fd(), uv__duplicate_handle(), uv__fast_poll_process_poll_req(), uv__fast_poll_submit_poll_req(), uv__finish_close(), uv__fs_event(), uv__fs_event_close(), uv__fs_poll_close(), uv__get_handle(), uv__get_osfhandle(), uv__getsockpeername(), uv__handle_fd(), uv__inotify_fork(), uv__make_close_pending(), uv__next_timeout(), uv__pipe_close(), uv__pipe_get_ipc_remote_pid(), uv__pipe_getname(), uv__pipe_getsockpeername(), uv__pipe_interrupt_read(), uv__pipe_queue_ipc_xfer_info(), uv__pipe_read_data(), uv__pipe_read_ipc(), uv__pipe_read_stop(), uv__pipe_write(), uv__pipe_write_data(), uv__pipe_write_ipc(), uv__poll_close(), uv__poll_io(), uv__poll_set(), uv__poll_stop(), uv__process_close(), uv__run_timers(), uv__send(), uv__setsockopt(), uv__setsockopt_maybe_char(), uv__signal_close(), uv__signal_dispatch(), uv__signal_event(), uv__signal_first_handle(), uv__signal_handler(), uv__signal_loop_cleanup(), uv__signal_start(), uv__signal_stop(), uv__slow_poll_process_poll_req(), uv__slow_poll_submit_poll_req(), uv__slow_poll_thread_proc(), uv__socket_sockopt(), uv__stdio_destroy(), uv__stdio_noinherit(), uv__stream_close(), uv__tcp_bind(), uv__tcp_close(), uv__tcp_connect(), uv__tcp_try_write(), uv__tcp_xfer_export(), uv__timer_close(), uv__tty_try_write(), uv__udp_bind(), uv__udp_check_before_send(), uv__udp_close(), uv__udp_connect(), uv__udp_disconnect(), uv__udp_finish_close(), uv__udp_init_ex(), uv__udp_io(), uv__udp_is_bound(), uv__udp_is_connected(), uv__udp_maybe_deferred_bind(), uv__udp_recv_start(), uv__udp_recv_stop(), uv__udp_recvmsg(), uv__udp_run_completed(), uv__udp_send(), uv__udp_sendmsg(), uv__udp_set_membership4(), uv__udp_set_membership6(), uv__udp_set_source_membership4(), uv__udp_set_source_membership6(), uv__udp_try_send(), uv__work_done(), uv_async_close(), uv_async_endgame(), uv_async_init(), uv_async_send(), uv_close(), uv_connection_init(), uv_disable_stdio_inheritance(), uv_fileno(), uv_fs_event_close(), uv_fs_event_endgame(), uv_fs_event_getpath(), uv_fs_event_init(), uv_fs_event_queue_readdirchanges(), uv_fs_event_start(), uv_fs_event_stop(), uv_fs_poll_getpath(), uv_fs_poll_init(), uv_fs_poll_start(), uv_fs_poll_stop(), uv_guess_handle(), uv_handle_get_data(), uv_handle_get_loop(), uv_handle_get_type(), uv_handle_set_data(), uv_has_ref(), uv_insert_non_overlapped_write_req(), uv_is_active(), uv_is_closing(), uv_is_readable(), uv_is_writable(), uv_loop_watcher_endgame(), uv_os_getppid(), uv_os_getpriority(), uv_os_setpriority(), uv_pipe_bind(), uv_pipe_chmod(), uv_pipe_cleanup(), uv_pipe_close(), uv_pipe_connect(), uv_pipe_connection_init(), uv_pipe_endgame(), uv_pipe_getpeername(), uv_pipe_getsockname(), uv_pipe_init(), uv_pipe_listen(), uv_pipe_open(), uv_pipe_pending_count(), uv_pipe_pending_instances(), uv_pipe_pending_type(), uv_pipe_queue_accept(), uv_pipe_queue_read(), uv_pipe_read_eof(), uv_pipe_read_error(), uv_pipe_read_error_or_eof(), uv_pipe_read_start(), uv_pipe_writefile_thread_proc(), uv_pipe_zero_readfile_thread_proc(), uv_poll_close(), uv_poll_endgame(), uv_poll_init(), uv_poll_init_socket(), uv_poll_start(), uv_poll_stop(), uv_process_async_wakeup_req(), uv_process_close(), uv_process_endgame(), uv_process_endgames(), uv_process_fs_event_req(), uv_process_init(), uv_process_pipe_accept_req(), uv_process_pipe_connect_req(), uv_process_pipe_read_req(), uv_process_pipe_shutdown_req(), uv_process_pipe_write_req(), uv_process_poll_req(), uv_process_proc_exit(), uv_process_reqs(), uv_process_signal_req(), uv_process_tcp_accept_req(), uv_process_tcp_connect_req(), uv_process_tcp_read_req(), uv_process_tcp_write_req(), uv_process_tty_read_line_req(), uv_process_tty_read_raw_req(), uv_process_tty_read_req(), uv_process_tty_write_req(), uv_process_udp_recv_req(), uv_process_udp_send_req(), uv_queue_non_overlapped_write(), uv_read_start(), uv_read_stop(), uv_recv_buffer_size(), uv_ref(), uv_remove_non_overlapped_write_req(), uv_rwlock_init(), uv_send_buffer_size(), uv_set_pipe_handle(), uv_shutdown(), uv_signal_close(), uv_signal_endgame(), uv_signal_init(), uv_signal_start(), uv_signal_start_oneshot(), uv_signal_stop(), uv_stdio_pipe_server(), uv_stream_init(), uv_stream_set_blocking(), uv_tcp_bind(), uv_tcp_close_reset(), uv_tcp_connect(), uv_tcp_endgame(), uv_tcp_getpeername(), uv_tcp_getsockname(), uv_tcp_init(), uv_tcp_init_ex(), uv_tcp_keepalive(), uv_tcp_listen(), uv_tcp_nodelay(), uv_tcp_open(), uv_tcp_queue_accept(), uv_tcp_queue_read(), uv_tcp_read_start(), uv_tcp_set_socket(), uv_tcp_simultaneous_accepts(), uv_tcp_try_bind(), uv_tcp_try_connect(), uv_tcp_write(), uv_timer_again(), uv_timer_get_due_in(), uv_timer_get_repeat(), uv_timer_init(), uv_timer_set_repeat(), uv_timer_start(), uv_timer_stop(), uv_tty_clear(), uv_tty_close(), uv_tty_emit_text(), uv_tty_endgame(), uv_tty_init(), uv_tty_line_read_thread(), uv_tty_move_caret(), uv_tty_post_raw_read(), uv_tty_queue_read(), uv_tty_queue_read_line(), uv_tty_queue_read_raw(), uv_tty_read_start(), uv_tty_read_stop(), uv_tty_reset(), uv_tty_restore_state(), uv_tty_save_state(), uv_tty_set_cursor_shape(), uv_tty_set_cursor_visibility(), uv_tty_set_style(), uv_tty_write(), uv_tty_write_bufs(), uv_udp_bind(), uv_udp_close(), uv_udp_connect(), uv_udp_endgame(), uv_udp_get_send_queue_count(), uv_udp_get_send_queue_size(), uv_udp_getpeername(), uv_udp_getsockname(), uv_udp_init(), uv_udp_init_ex(), uv_udp_maybe_bind(), uv_udp_open(), uv_udp_queue_recv(), uv_udp_recv_start(), uv_udp_recv_stop(), uv_udp_send(), uv_udp_set_broadcast(), uv_udp_set_membership(), uv_udp_set_multicast_interface(), uv_udp_set_multicast_loop(), uv_udp_set_multicast_ttl(), uv_udp_set_socket(), uv_udp_set_source_membership(), uv_udp_set_ttl(), uv_udp_try_send(), uv_udp_using_recvmmsg(), uv_unref(), uv_want_endgame(), uv_write(), uv_write2(), vle_init(), vle_next(), vle_option(), w32_desc_list(), wait_for_a_while(), and winkd_bkpt().

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_mcore
Definition: asm_mcore.c:27
@ RZ_LIB_TYPE_ASM
Definition: rz_lib.h:72
#define RZ_VERSION
Definition: rz_version.h:8
const char * version
Definition: rz_asm.h:133

Definition at line 39 of file asm_mcore.c.

◆ rz_asm_plugin_mcore

RzAsmPlugin rz_asm_plugin_mcore
Initial value:
= {
.name = "mcore",
.desc = "Motorola MCORE disassembler",
.license = "LGPL3",
.arch = "mcore",
.cpus = "mcore,c-sky",
.bits = 32,
.endian = RZ_SYS_ENDIAN_BIG,
.disassemble = &disassemble,
}
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_mcore.c:10
#define RZ_SYS_ENDIAN_BIG
Definition: rz_types.h:527

Definition at line 27 of file asm_mcore.c.