Fix r2 arch plugin for radare2 >= 5.8 RArchPlugin API

- Rewrote plugin using RArchPlugin (decode callback)
- Matches z80 reference plugin structure
- Tested against r2 6.1.3
- Decodes: NOP, Type 1 (Compute|DM|PM), Type 6 (Imm16),
  Type 10 (Jump/Call), Type 11 (DO UNTIL), Type 20 (RTS/RTI)
- Proper code alignment (3 bytes) via archinfo callback
- Delayed branch flag support
This commit is contained in:
Siggi
2026-04-12 14:45:23 +00:00
parent 2e43456293
commit b62ad6517e
4 changed files with 230 additions and 56 deletions

View File

@@ -1,14 +1,24 @@
NAME=asm_adsp219x
R2_PLUGIN_PATH=$(shell r2 -H R2_USER_PLUGINS)
R2_PLUGINS=$(shell r2 -H R2_USER_PLUGINS)
R2_INCDIR=$(shell r2 -H R2_INCDIR)
R2_LIBDIR=$(shell r2 -H R2_LIBDIR)
all: $(NAME).so
$(NAME).so: $(NAME).c
gcc -shared -Wall -O2 -fPIC $(shell pkg-config --cflags --libs r_asm) $< -o $@
gcc -shared -Wall -O2 -fPIC \
-I$(R2_INCDIR) -I$(R2_INCDIR)/sdb \
-L$(R2_LIBDIR) \
$(NAME).c -o $@ -lr_arch -lr_util
install: $(NAME).so
mkdir -p $(R2_PLUGIN_PATH)
cp $(NAME).so $(R2_PLUGIN_PATH)
mkdir -p $(R2_PLUGINS)
cp -f $(NAME).so $(R2_PLUGINS)/
uninstall:
rm -f $(R2_PLUGINS)/$(NAME).so
clean:
rm -f $(NAME).so
.PHONY: all install uninstall clean