Rizin
unix-like reverse engineering framework and cli tools
|
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include "getopt.h"
#include <capstone/capstone.h>
Go to the source code of this file.
Functions | |
void | print_insn_detail_x86 (csh ud, cs_mode mode, cs_insn *ins) |
void | print_insn_detail_arm (csh handle, cs_insn *ins) |
void | print_insn_detail_arm64 (csh handle, cs_insn *ins) |
void | print_insn_detail_mips (csh handle, cs_insn *ins) |
void | print_insn_detail_ppc (csh handle, cs_insn *ins) |
void | print_insn_detail_sparc (csh handle, cs_insn *ins) |
void | print_insn_detail_sysz (csh handle, cs_insn *ins) |
void | print_insn_detail_xcore (csh handle, cs_insn *ins) |
void | print_insn_detail_m68k (csh handle, cs_insn *ins) |
void | print_insn_detail_tms320c64x (csh handle, cs_insn *ins) |
void | print_insn_detail_m680x (csh handle, cs_insn *ins) |
void | print_insn_detail_evm (csh handle, cs_insn *ins) |
static void | print_details (csh handle, cs_arch arch, cs_mode md, cs_insn *ins) |
void | print_string_hex (const char *comment, unsigned char *str, size_t len) |
static uint8_t | char_to_hexnum (char c) |
static uint8_t * | preprocess (char *code, size_t *size) |
static void | usage (char *prog) |
int | main (int argc, char **argv) |
Variables | |
struct { | |
const char * name | |
cs_arch arch | |
cs_mode mode | |
} | all_archs [] |
|
static |
Definition at line 297 of file cstool.c.
References all_archs, arch, argv, bytes, c, count, CS_ARCH_ALL, CS_ARCH_ARM, CS_ARCH_ARM64, CS_ARCH_EVM, CS_ARCH_M680X, CS_ARCH_M68K, CS_ARCH_MIPS, CS_ARCH_PPC, CS_ARCH_SPARC, CS_ARCH_SYSZ, CS_ARCH_TMS320C64X, CS_ARCH_X86, CS_ARCH_XCORE, cs_close(), cs_disasm(), cs_free(), cs_open(), CS_OPT_DETAIL, CS_OPT_ON, CS_OPT_SKIPDATA, CS_OPT_SYNTAX, CS_OPT_SYNTAX_ATT, CS_OPT_UNSIGNED, cs_option(), cs_support(), CS_SUPPORT_DIET, CS_SUPPORT_X86_REDUCE, CS_VERSION_EXTRA, CS_VERSION_MAJOR, CS_VERSION_MINOR, ERANGE, err, free(), getopt(), handle, i, benchmark::md, mode, optind, preprocess(), print_details(), printf(), PRIx64, src, and usage().
Definition at line 120 of file cstool.c.
References char_to_hexnum(), i, isxdigit, malloc(), and NULL.
Referenced by main().
Definition at line 240 of file cstool.c.
References arch, CS_ARCH_ARM, CS_ARCH_ARM64, CS_ARCH_EVM, CS_ARCH_M680X, CS_ARCH_M68K, CS_ARCH_MIPS, CS_ARCH_PPC, CS_ARCH_SPARC, CS_ARCH_SYSZ, CS_ARCH_TMS320C64X, CS_ARCH_X86, CS_ARCH_XCORE, cs_group_name(), cs_insn_name(), handle, benchmark::md, print_insn_detail_arm(), print_insn_detail_arm64(), print_insn_detail_evm(), 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_x86(), print_insn_detail_xcore(), and printf().
Referenced by main().
void print_insn_detail_arm | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 8 of file cstool_arm.c.
References ARM_CC_AL, ARM_CC_INVALID, ARM_OP_CIMM, ARM_OP_FP, ARM_OP_IMM, ARM_OP_MEM, ARM_OP_PIMM, ARM_OP_REG, ARM_OP_SETEND, ARM_OP_SYSREG, ARM_REG_INVALID, ARM_SETEND_BE, ARM_SFT_ASR_REG, ARM_SFT_INVALID, CS_AC_READ, CS_AC_WRITE, cs_reg_name(), cs_regs_access(), handle, i, NULL, and printf().
Referenced by print_details().
void print_insn_detail_arm64 | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 11 of file cstool_arm64.c.
References access, ARM64_EXT_INVALID, ARM64_OP_BARRIER, ARM64_OP_CIMM, ARM64_OP_FP, ARM64_OP_IMM, ARM64_OP_MEM, ARM64_OP_PREFETCH, ARM64_OP_PSTATE, ARM64_OP_REG, ARM64_OP_REG_MRS, ARM64_OP_REG_MSR, ARM64_OP_SYS, ARM64_REG_INVALID, ARM64_SFT_INVALID, ARM64_VAS_INVALID, ARM64_VESS_INVALID, CS_AC_READ, CS_AC_WRITE, cs_reg_name(), cs_regs_access(), handle, i, NULL, printf(), and PRIx64.
Referenced by print_details().
void print_insn_detail_evm | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 8 of file cstool_evm.c.
References cs_evm::fee, NULL, cs_evm::pop, printf(), and cs_evm::push.
Referenced by print_details().
void print_insn_detail_m680x | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 45 of file cstool_m680x.c.
References CS_AC_INVALID, cs_reg_name(), cs_m680x::flags, handle, i, M680X_FIRST_OP_IN_MNEM, M680X_IDX_INDIRECT, M680X_IDX_POST_INC_DEC, M680X_OP_CONSTANT, M680X_OP_DIRECT, M680X_OP_EXTENDED, M680X_OP_IMMEDIATE, M680X_OP_INDEXED, M680X_OP_REGISTER, M680X_OP_RELATIVE, M680X_REG_INVALID, M680X_REG_PC, M680X_SECOND_OP_IN_MNEM, NULL, cs_m680x::op_count, cs_m680x::operands, print_read_write_regs(), printf(), and s_access.
Referenced by print_details().
void print_insn_detail_m68k | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 61 of file cstool_m68k.c.
References cs_reg_name(), test_evm::detail, handle, i, M68K_OP_FP_DOUBLE, M68K_OP_FP_SINGLE, M68K_OP_IMM, M68K_OP_MEM, M68K_OP_REG, M68K_REG_INVALID, NULL, print_read_write_regs(), printf(), and s_addressing_modes.
Referenced by print_details().
void print_insn_detail_mips | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 11 of file cstool_mips.c.
References cs_reg_name(), handle, i, MIPS_OP_IMM, MIPS_OP_MEM, MIPS_OP_REG, MIPS_REG_INVALID, NULL, printf(), and PRIx64.
Referenced by print_details().
void print_insn_detail_ppc | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 39 of file cstool_ppc.c.
References cs_reg_name(), get_bc_name(), handle, i, NULL, PPC_OP_CRX, PPC_OP_IMM, PPC_OP_MEM, PPC_OP_REG, PPC_REG_INVALID, printf(), and PRIx64.
Referenced by print_details().
void print_insn_detail_sparc | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 10 of file cstool_sparc.c.
References cs_reg_name(), handle, i, NULL, printf(), PRIx64, SPARC_OP_IMM, SPARC_OP_MEM, SPARC_OP_REG, and X86_REG_INVALID.
Referenced by print_details().
void print_insn_detail_sysz | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 10 of file cstool_systemz.c.
References cs_sysz::cc, cs_reg_name(), handle, i, NULL, cs_sysz::op_count, cs_sysz::operands, printf(), PRIx64, SYSZ_OP_ACREG, SYSZ_OP_IMM, SYSZ_OP_MEM, SYSZ_OP_REG, and SYSZ_REG_INVALID.
Referenced by print_details().
void print_insn_detail_tms320c64x | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 9 of file cstool_tms320c64x.c.
References cs_tms320c64x::condition, cs_tms320c64x::crosspath, cs_reg_name(), cs_tms320c64x::funit, handle, i, NULL, cs_tms320c64x::op_count, cs_tms320c64x::operands, cs_tms320c64x::parallel, printf(), cs_tms320c64x::reg, cs_tms320c64x::side, TMS320C64X_FUNIT_D, TMS320C64X_FUNIT_L, TMS320C64X_FUNIT_M, TMS320C64X_FUNIT_NO, TMS320C64X_FUNIT_S, TMS320C64X_MEM_DIR_BW, TMS320C64X_MEM_DIR_FW, TMS320C64X_MEM_DIR_INVALID, TMS320C64X_MEM_DISP_CONSTANT, TMS320C64X_MEM_DISP_INVALID, TMS320C64X_MEM_DISP_REGISTER, TMS320C64X_MEM_MOD_INVALID, TMS320C64X_MEM_MOD_NO, TMS320C64X_MEM_MOD_POST, TMS320C64X_MEM_MOD_PRE, TMS320C64X_OP_IMM, TMS320C64X_OP_MEM, TMS320C64X_OP_REG, TMS320C64X_OP_REGPAIR, TMS320C64X_REG_INVALID, cs_tms320c64x::unit, and cs_tms320c64x::zero.
Referenced by print_details().
Definition at line 180 of file cstool_x86.c.
References count, CS_AC_READ, CS_AC_WRITE, CS_MODE_16, cs_op_count(), cs_op_index(), cs_reg_name(), cs_regs_access(), get_eflag_name(), get_fpu_flag_name(), i, NULL, print_string_hex(), printf(), PRIx64, X86_AVX_BCAST_INVALID, X86_AVX_CC_INVALID, X86_AVX_RM_INVALID, X86_GRP_FPU, X86_OP_IMM, X86_OP_MEM, X86_OP_REG, X86_REG_INVALID, X86_SSE_CC_INVALID, and X86_XOP_CC_INVALID.
Referenced by print_details().
void print_insn_detail_xcore | ( | csh | handle, |
cs_insn * | ins | ||
) |
Definition at line 9 of file cstool_xcore.c.
References cs_reg_name(), handle, i, NULL, printf(), XCORE_OP_IMM, XCORE_OP_MEM, XCORE_OP_REG, and XCORE_REG_INVALID.
Referenced by print_details().
Definition at line 91 of file cstool.c.
References c, len, printf(), and cmd_descs_generate::str.
Referenced by test_x86::print_insn_detail(), and print_insn_detail_x86().
|
static |
Definition at line 147 of file cstool.c.
References CS_ARCH_ARM, CS_ARCH_ARM64, CS_ARCH_EVM, CS_ARCH_M680X, CS_ARCH_M68K, CS_ARCH_MIPS, CS_ARCH_PPC, CS_ARCH_SPARC, CS_ARCH_SYSZ, CS_ARCH_TMS320C64X, CS_ARCH_X86, CS_ARCH_XCORE, cs_support(), CS_VERSION_EXTRA, CS_VERSION_MAJOR, CS_VERSION_MINOR, printf(), and prog.
Referenced by main().
struct { ... } all_archs[] |
Referenced by main().
cs_arch arch |
Definition at line 13 of file cstool.c.
Referenced by _cs_disasm(), _resolve_arch(), arch_destroys_dst(), arch_hint_acc_cb(), bs_open(), core_bin_file_print(), cpu_reload_needed(), create(), cs_fuzz_arch(), cs_open(), does_arch_destroys_dst(), ds_print_fcn_name(), ds_print_ptr(), entries(), extract(), extract_binobj(), gdbr_get_reg_profile(), gdbr_set_architecture(), get_cpu_mips(), get_dwarf_reg_name(), get_entrypoint(), info(), is_apple_target(), LLVMFuzzerTestOneInput(), main(), TestBasic::main(), ocaml_cs_disasm(), ocaml_cs_disasm_internal(), ocaml_open(), oneshot_buffer(), opiscall(), parse_asm_path(), print_arch_hint_cb(), print_assembly_output(), print_details(), rz_analysis_hint_get(), rz_analysis_hint_set_arch(), rz_analysis_hint_set_arch_handler(), rz_analysis_set_triplet(), rz_asm_setup(), rz_bin_arch_options_init(), rz_bin_file_find_by_arch_bits(), rz_bin_object_find_by_arch_bits(), rz_bin_pe_get_arch(), rz_bin_pe_is_big_endian(), rz_bin_select(), rz_bin_select_object(), rz_bin_te_get_arch(), rz_bin_use_arch(), rz_coff_supported_arch(), rz_core_analysis_esil(), rz_core_analysis_hint_print(), rz_core_analysis_search(), rz_core_analysis_sigdb_apply(), rz_core_arch_bits_at(), rz_core_asm_plugins_print(), rz_core_bin_apply_all_info(), rz_core_bin_load(), rz_core_bin_set_arch_bits(), rz_core_bin_update_arch_bits(), rz_core_egg_setup(), rz_core_flirt_arch_from_id(), rz_core_flirt_arch_from_name(), rz_core_rtr_gdb_run(), rz_core_search_rop(), rz_core_seek_arch_bits(), rz_core_set_asm_configs(), rz_debug_gdb_attach(), rz_debug_gdb_reg_profile(), rz_debug_qnx_attach(), rz_debug_qnx_reg_profile(), rz_debug_set_arch(), rz_egg_Cfile_armOrMips(), rz_egg_Cfile_parser(), rz_egg_Cfile_set_cEnv(), rz_egg_load_file(), rz_egg_setup(), rz_flirt_scan_handler(), rz_main_rz_asm(), rz_main_rz_bin(), rz_main_rz_gg(), rz_open_arch_bits_handler(), rz_platform_profiles_init(), rz_platform_target_index_init(), rz_sys_arch_id(), rz_sys_arch_match(), rz_sys_arch_str(), rz_syscall_setup(), rz_sysreg_set_arch(), rz_test_load_asm_test_file(), rz_type_db_init(), sections(), set_tmp_arch(), setab(), symbols(), syscall_reload_needed(), sysregs_reload_needed(), test(), update_asmcpu_options(), and xtr_metadata_match().