The key thing of RAsm plugin is a structure
where .disassemble
is a pointer to disassembly function, which accepts the bytes buffer and length:
asm_mycpu.c
After compiling radare2 will list this plugin in the output:
List of affected files:
- : build instructions
- : add the struct definition in there
Check out how the NIOS II CPU disassembly plugin was implemented by reading those commits:
Implement RAnal plugin: