diff --git a/dist/plugins-cfg/plugins.bin.cfg b/dist/plugins-cfg/plugins.bin.cfg index 917f694e48..5eec3051e4 100644 --- a/dist/plugins-cfg/plugins.bin.cfg +++ b/dist/plugins-cfg/plugins.bin.cfg @@ -78,7 +78,6 @@ io.zip asm.8051 asm.tms320 asm.sh -asm.xap asm.arm_winedbg asm.sparc asm.java @@ -120,5 +119,4 @@ debug.rap debug.bf asm.dcpu16 asm.rar -asm.xap io.shm" diff --git a/dist/plugins-cfg/plugins.def.cfg b/dist/plugins-cfg/plugins.def.cfg index bb2d6d2c9c..0530f9505c 100644 --- a/dist/plugins-cfg/plugins.def.cfg +++ b/dist/plugins-cfg/plugins.def.cfg @@ -92,7 +92,6 @@ asm.sparc_cs asm.sparc_gnu asm.tms320 asm.m68k_gnu -asm.xap asm.arm_as asm.x86_as asm.x86_cs diff --git a/dist/plugins-cfg/plugins.emscripten.cfg b/dist/plugins-cfg/plugins.emscripten.cfg index 0819edd60a..78eaeb400b 100644 --- a/dist/plugins-cfg/plugins.emscripten.cfg +++ b/dist/plugins-cfg/plugins.emscripten.cfg @@ -68,7 +68,6 @@ io.zip asm.8051 asm.tms320 asm.sh -asm.xap asm.arm_winedbg asm.sparc anal.ppc @@ -97,5 +96,4 @@ debug.rap debug.bf asm.dcpu16 asm.rar -asm.xap io.shm" diff --git a/dist/plugins-cfg/plugins.mingw.cfg b/dist/plugins-cfg/plugins.mingw.cfg index a328932c11..67a50f07ad 100644 --- a/dist/plugins-cfg/plugins.mingw.cfg +++ b/dist/plugins-cfg/plugins.mingw.cfg @@ -84,7 +84,6 @@ asm.sparc_cs asm.sparc_gnu asm.tms320 asm.m68k_gnu -asm.xap asm.arm_as asm.x86_as asm.x86_cs diff --git a/dist/plugins-cfg/plugins.nocs.cfg b/dist/plugins-cfg/plugins.nocs.cfg index 37c843e6b9..cdad0e1c2a 100644 --- a/dist/plugins-cfg/plugins.nocs.cfg +++ b/dist/plugins-cfg/plugins.nocs.cfg @@ -69,7 +69,6 @@ asm.sh asm.sparc_gnu asm.tms320 asm.m68k_gnu -asm.xap asm.arm_as asm.x86_as asm.x86_nz diff --git a/dist/plugins-cfg/plugins.nogpl.cfg b/dist/plugins-cfg/plugins.nogpl.cfg index 602369912f..d6a7329d10 100644 --- a/dist/plugins-cfg/plugins.nogpl.cfg +++ b/dist/plugins-cfg/plugins.nogpl.cfg @@ -29,7 +29,6 @@ esil.dummy asm.8051 asm.arm_cs asm.arm_winedbg -asm.xap asm.dalvik asm.dcpu16 asm.gb diff --git a/dist/plugins-cfg/plugins.static.cfg b/dist/plugins-cfg/plugins.static.cfg index c2a52790f3..6046401543 100644 --- a/dist/plugins-cfg/plugins.static.cfg +++ b/dist/plugins-cfg/plugins.static.cfg @@ -59,7 +59,6 @@ asm.lanai_gnu asm.sh asm.sparc_cs asm.sparc_gnu -asm.xap asm.arm_as asm.x86_as asm.x86_cs diff --git a/dist/plugins-cfg/plugins.static.nogpl.cfg b/dist/plugins-cfg/plugins.static.nogpl.cfg index 1e4096495d..1d65be539e 100644 --- a/dist/plugins-cfg/plugins.static.nogpl.cfg +++ b/dist/plugins-cfg/plugins.static.nogpl.cfg @@ -39,7 +39,6 @@ asm.propeller asm.riscv asm.sh asm.sparc_cs -asm.xap asm.arm_as asm.x86_as asm.x86_cs diff --git a/dist/plugins-cfg/plugins.termux.cfg b/dist/plugins-cfg/plugins.termux.cfg index 8bf2f83156..169bf0e720 100644 --- a/dist/plugins-cfg/plugins.termux.cfg +++ b/dist/plugins-cfg/plugins.termux.cfg @@ -57,7 +57,6 @@ asm.sparc_cs asm.sparc_gnu asm.tms320 asm.m68k_gnu -asm.xap asm.arm_as asm.x86_as asm.x86_cs diff --git a/libr/anal/p/anal_xap.c b/libr/anal/p/anal_xap.c index 708eb6711f..62a1521dda 100644 --- a/libr/anal/p/anal_xap.c +++ b/libr/anal/p/anal_xap.c @@ -64,6 +64,10 @@ static int xap_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *bytes, int len op->type = R_ANAL_OP_TYPE_UNK; op->size = 2; + if (mask & R_ANAL_OP_MASK_DISASM) { + op->mnemonic = r_str_ndup (d.d_asm, sizeof (d.d_asm)); + } + switch (i2ut16 (in)) { case INST_NOP: op->type = R_ANAL_OP_TYPE_NOP; @@ -215,6 +219,7 @@ RAnalPlugin r_anal_plugin_xap = { .license = "LGPL3", .arch = "xap", .bits = 16, + .endian = R_SYS_ENDIAN_LITTLE, .op = &xap_op, }; diff --git a/libr/asm/meson.build b/libr/asm/meson.build index e61bfa24fd..302dd3cf34 100644 --- a/libr/asm/meson.build +++ b/libr/asm/meson.build @@ -43,7 +43,6 @@ r_asm_sources = [ join_paths('p','asm_x86_nasm.c'), join_paths('p','asm_x86_nz.c'), #join_paths('p','asm_x86_vm.c'), - join_paths('p','asm_xap.c'), # join_paths('p','asm_z80.c'), #join_paths('arch','8051','8051_disas.c'), join_paths('arch','8051','8051_ass.c'), @@ -106,7 +105,6 @@ r_asm_sources = [ join_paths('arch','v810','v810_disas.c'), join_paths('arch','v850','v850_disas.c'), # join_paths('arch','whitespace','wsdis.c'), - # join_paths('arch','xap','dis.c'), #join_paths('arch','z80','expressions.c'), # join_paths('arch','z80','z80.c'), #join_paths('arch','z80','z80asm.c'), diff --git a/libr/asm/p/Makefile b/libr/asm/p/Makefile index e88bd65e18..601bf1de5e 100644 --- a/libr/asm/p/Makefile +++ b/libr/asm/p/Makefile @@ -19,7 +19,7 @@ ALL_TARGETS= # TODO: rename to enabled plugins ARCHS=mips_gnu.mk x86_cs.mk sparc_cs.mk sparc_gnu.mk java.mk arm_gnu.mk dalvik.mk ARCHS+=x86_as.mk x86_nz.mk cris_gnu.mk arc.mk -ARCHS+=ppc_gnu.mk ppc_as.mk ppc_cs.mk xap.mk x86_nasm.mk avr.mk +ARCHS+=ppc_gnu.mk ppc_as.mk ppc_cs.mk x86_nasm.mk avr.mk ARCHS+=sh.mk arm_winedbg.mk tms320.mk gb.mk ebc.mk ARCHS+=cr16.mk v850.mk propeller.mk ARCHS+=v810.mk mcs96.mk lm32.mk jdh8.mk diff --git a/libr/asm/p/asm_xap.c b/libr/asm/p/asm_xap.c deleted file mode 100644 index 1635b8cf35..0000000000 --- a/libr/asm/p/asm_xap.c +++ /dev/null @@ -1,55 +0,0 @@ -/* radare - LGPL - Copyright 2009-2014 - nibble */ - -#include -#include -#include -#include -#include -#include "xap/dis.c" - -static int arch_xap_disasm(char *str, const unsigned char *buf, ut64 seek) { - struct state *s = get_state(); - struct directive *d; - memset(s, 0, sizeof(*s)); - s->s_buf = buf; - s->s_off = seek; - s->s_out = NULL; - d = next_inst(s); - if (d) { - xap_decode (s, d); - strcpy (str, d->d_asm); - free (d); - } else { - *str = '\0'; - } -#if 0 - if (s->s_ff_quirk) { - sprintf(d->d_asm, "DC\t0x%x", i2u16(&d->d_inst)); - s->s_ff_quirk = 0; - } -#endif - return 0; -} -static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, int len) { - char *buf_asm = r_strbuf_get (&op->buf_asm); - arch_xap_disasm (buf_asm, buf, a->pc); - return (op->size = 2); -} - -RAsmPlugin r_asm_plugin_xap = { - .name = "xap", - .arch = "xap", - .license = "PD", - .bits = 16, - .endian = R_SYS_ENDIAN_LITTLE, - .desc = "XAP4 RISC (CSR)", - .disassemble = &disassemble -}; - -#ifndef R2_PLUGIN_INCORE -R_API RLibStruct radare_plugin = { - .type = R_LIB_TYPE_ASM, - .data = &r_asm_plugin_xap, - .version = R2_VERSION -}; -#endif diff --git a/libr/asm/p/xap.mk b/libr/asm/p/xap.mk deleted file mode 100644 index 70eea2dd3c..0000000000 --- a/libr/asm/p/xap.mk +++ /dev/null @@ -1,12 +0,0 @@ -OBJ_XAP=asm_xap.o -#OBJ_XAP+=../arch/xap/dis.o - -STATIC_OBJ+=${OBJ_XAP} -TARGET_XAP=asm_xap.${EXT_SO} - -ifeq ($(WITHPIC),1) -ALL_TARGETS+=${TARGET_XAP} - -${TARGET_XAP}: ${OBJ_XAP} - ${CC} $(call libname,asm_xap) ${LDFLAGS} ${CFLAGS} -o asm_xap.${EXT_SO} ${OBJ_XAP} -endif diff --git a/libr/include/r_asm.h b/libr/include/r_asm.h index 570985ff5f..055b661881 100644 --- a/libr/include/r_asm.h +++ b/libr/include/r_asm.h @@ -227,7 +227,6 @@ extern RAsmPlugin r_asm_plugin_x86_as; extern RAsmPlugin r_asm_plugin_x86_cs; extern RAsmPlugin r_asm_plugin_x86_nasm; extern RAsmPlugin r_asm_plugin_x86_nz; -extern RAsmPlugin r_asm_plugin_xap; extern RAsmPlugin r_asm_plugin_xtensa; extern RAsmPlugin r_asm_plugin_alpha; extern RAsmPlugin r_asm_plugin_vasm; diff --git a/libr/meson.build b/libr/meson.build index 230acb9f05..15a0c9b7d2 100644 --- a/libr/meson.build +++ b/libr/meson.build @@ -153,7 +153,6 @@ asm_plugins += [ 'x86_cs', 'x86_nasm', 'x86_nz', - 'xap', ] # TODO: add the pyc plugin for meson builds too