From 98e6d291337bcd8bb54adb2831d1023bf93aeeea Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 7 Feb 2024 09:42:51 +0100 Subject: [PATCH] leftover? --- libr/asm/p/arch_evm.c | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 libr/asm/p/arch_evm.c diff --git a/libr/asm/p/arch_evm.c b/libr/asm/p/arch_evm.c new file mode 100644 index 000000000..429129db0 --- /dev/null +++ b/libr/asm/p/arch_evm.c @@ -0,0 +1,47 @@ +/* radare - LGPL - Copyright 2017-2023 - pancake */ + +#include +#include +#include +#include +#include +#include "evm.h" +// #include "../arch/evm/evm.c" + +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { + EvmOp eop = { + 0 + }; + + evm_dis (&eop, buf, len); + op->size = eop.len; + r_asm_op_set_asm (op, eop.txt); + + return eop.len; +} + +static int assemble(RAsm *a, RAsmOp *op, const char *buf) { + op->size = evm_asm (buf, &op->buf, sizeof (op->buf)); + return op->size; +} + +RAsmPlugin r_a_plugin_evm = { + .name = "evm", + .author = "pancake", + .version = "0.0.1", + .arch = "evm", + .license = "MIT", + .bits = 32, + .endian = R_SYS_ENDIAN_BIG, + .desc = "evm", + .disassemble = &disassemble, + .assemble = &assemble +}; + +#ifndef CORELIB +RLibStruct radare_plugin = { + .type = R_LIB_TYPE_ARCH, + .data = &r_arch_plugin_evm, + .version = R2_VERSION +}; +#endif