diff --git a/librz/analysis/meson.build b/librz/analysis/meson.build index 1e90210e5e4..c57cd8199e8 100644 --- a/librz/analysis/meson.build +++ b/librz/analysis/meson.build @@ -45,7 +45,6 @@ analysis_plugins_list = [ ] if capstone_dep.version().split('.')[0].to_int() > 4 analysis_plugins_list += 'riscv_cs' - analysis_plugins_list += 'tricore_cs' endif if get_option('use_gpl') @@ -57,6 +56,7 @@ if get_option('use_gpl') 'riscv', 'sh', 'sparc_gnu', + 'tricore', 'vax', 'xtensa', 'z80', @@ -234,7 +234,6 @@ rz_analysis_sources = [ if capstone_dep.version().split('.')[0].to_int() > 4 rz_analysis_sources += 'p/analysis_riscv_cs.c' - rz_analysis_sources += 'p/analysis_tricore_cs.c' endif if get_option('use_gpl') @@ -246,6 +245,7 @@ if get_option('use_gpl') 'p/analysis_riscv.c', 'p/analysis_sh.c', 'p/analysis_sparc_gnu.c', + 'p/analysis_tricore.c', 'p/analysis_vax.c', 'p/analysis_xtensa.c', 'p/analysis_z80.c', diff --git a/librz/analysis/p/analysis_tricore_cs.c b/librz/analysis/p/analysis_tricore_cs.c deleted file mode 100644 index 9ae861ea775..00000000000 --- a/librz/analysis/p/analysis_tricore_cs.c +++ /dev/null @@ -1,114 +0,0 @@ -// SPDX-FileCopyrightText: 2020 curly -// SPDX-License-Identifier: LGPL-3.0-only - -#include -#include -#include -#include -#include - -static char *get_reg_profile(RzAnalysis *analysis) { - const char *p = - "=PC pc\n" - "=SP a10\n" - "=A0 a0\n" - "gpr p0 .64 0 0\n" - "gpr a0 .32 0 0\n" - "gpr a1 .32 4 0\n" - "gpr p2 .64 8 0\n" - "gpr a2 .32 8 0\n" - "gpr a3 .32 12 0\n" - "gpr p4 .64 16 0\n" - "gpr a4 .32 16 0\n" - "gpr a5 .32 20 0\n" - "gpr p6 .64 24 0\n" - "gpr a6 .32 24 0\n" - "gpr a7 .32 28 0\n" - "gpr p8 .64 32 0\n" - "gpr a8 .32 32 0\n" - "gpr a9 .32 36 0\n" - "gpr p10 .64 40 0\n" - "gpr a10 .32 40 0\n" - "gpr a11 .32 44 0\n" - "gpr p12 .64 48 0\n" - "gpr a12 .32 48 0\n" - "gpr a13 .32 52 0\n" - "gpr p14 .64 56 0\n" - "gpr a14 .32 56 0\n" - "gpr a15 .32 60 0\n" - "gpr e0 .64 64 0\n" - "gpr d0 .32 64 0\n" - "gpr d1 .32 68 0\n" - "gpr e2 .64 72 0\n" - "gpr d2 .32 72 0\n" - "gpr d3 .32 76 0\n" - "gpr e4 .64 80 0\n" - "gpr d4 .32 80 0\n" - "gpr d5 .32 84 0\n" - "gpr e6 .64 88 0\n" - "gpr d6 .32 88 0\n" - "gpr d7 .32 92 0\n" - "gpr e8 .64 96 0\n" - "gpr d8 .32 96 0\n" - "gpr d9 .32 100 0\n" - "gpr e10 .64 104 0\n" - "gpr d10 .32 104 0\n" - "gpr d11 .32 108 0\n" - "gpr e12 .64 112 0\n" - "gpr d12 .32 112 0\n" - "gpr d13 .32 114 0\n" - "gpr e14 .64 118 0\n" - "gpr d14 .32 118 0\n" - "gpr d15 .32 120 0\n" - "gpr PSW .32 124 0\n" - "gpr PCXI .32 128 0\n" - "gpr FCX .32 132 0\n" - "gpr LCX .32 136 0\n" - "gpr ISP .32 140 0\n" - "gpr ICR .32 144 0\n" - "gpr PIPN .32 148 0\n" - "gpr BIV .32 152 0\n" - "gpr BTV .32 156 0\n" - "gpr pc .32 160 0\n"; - return strdup(p); -} - -// TODO: Implement this -static RzAnalysisLiftedILOp rz_analysis_tricore_il_op() { - return NULL; -} - -static int rz_analysis_tricore_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask) { - if (!(a && op && data && len > 0)) { - return 0; - } - - if (mask & RZ_ANALYSIS_OP_MASK_IL) { - op->il_op = rz_analysis_tricore_il_op(); - } - return op->size; -} - -static RzAnalysisILConfig *il_config(RzAnalysis *analysis) { - RzAnalysisILConfig *cfg = rz_analysis_il_config_new(32, false, 32); - return cfg; -} - -RzAnalysisPlugin rz_analysis_plugin_tricore_cs = { - .name = "tricore_cs", - .desc = "TRICORE analysis plugin", - .license = "LGPL3", - .arch = "tricore", - .bits = 32, - .get_reg_profile = get_reg_profile, - .op = rz_analysis_tricore_op, - .il_config = il_config, -}; - -#ifndef RZ_PLUGIN_INCORE -RZ_API RzLibStruct rizin_plugin = { - .type = RZ_LIB_TYPE_ANALYSIS, - .data = &rz_analysis_plugin_tricore_cs, - .version = RZ_VERSION -}; -#endif diff --git a/librz/include/rz_analysis.h b/librz/include/rz_analysis.h index 5069649950c..5e14aff4e8a 100644 --- a/librz/include/rz_analysis.h +++ b/librz/include/rz_analysis.h @@ -2243,7 +2243,7 @@ extern RzAnalysisPlugin rz_analysis_plugin_spc700; extern RzAnalysisPlugin rz_analysis_plugin_sysz; extern RzAnalysisPlugin rz_analysis_plugin_tms320; extern RzAnalysisPlugin rz_analysis_plugin_tms320c64x; -extern RzAnalysisPlugin rz_analysis_plugin_tricore_cs; +extern RzAnalysisPlugin rz_analysis_plugin_tricore; extern RzAnalysisPlugin rz_analysis_plugin_v810; extern RzAnalysisPlugin rz_analysis_plugin_v850; extern RzAnalysisPlugin rz_analysis_plugin_vax;