Fix - Initial import of the asm.null plugin ##asm

This commit is contained in:
radare 2019-02-27 11:40:43 +01:00 committed by GitHub
parent a404c77063
commit 42db45025f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 0 deletions

39
libr/asm/p/asm_null.c Normal file

@ -0,0 +1,39 @@
/* radare - LGPL - Copyright 2019 - pancake */
#include <stdio.h>
#include <string.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_asm.h>
static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
int opsz = 0;
r_strbuf_set (&op->buf_asm, "");
op->size = opsz;
return opsz;
}
static int assemble(RAsm *a, RAsmOp *op, const char *buf) {
return 0;
}
RAsmPlugin r_asm_plugin_null = {
.name = "null",
.author = "pancake",
.version = "1.0.0",
.arch = "null",
.license = "MIT",
.bits = 16 | 32 | 64,
.endian = R_SYS_ENDIAN_NONE,
.desc = "no disassemble",
.disassemble = &disassemble,
.assemble = &assemble
};
#ifndef CORELIB
R_API RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_null,
.version = R2_VERSION
};
#endif

10
libr/asm/p/null.mk Normal file

@ -0,0 +1,10 @@
OBJ_NULL=asm_null.o
TARGET_NULL=asm_null.${EXT_SO}
STATIC_OBJ+=${OBJ_NULL}
ifeq ($(WITHPIC),1)
ALL_TARGETS+=${TARGET_NULL}
${TARGET_NULL}: ${OBJ_NULL}
${CC} $(call libname,asm_null) ${LDFLAGS} ${CFLAGS} -o ${TARGET_NULL} ${OBJ_NULL}
endif

@ -210,6 +210,7 @@ extern RAsmPlugin r_asm_plugin_arm_gnu;
extern RAsmPlugin r_asm_plugin_arm_winedbg;
extern RAsmPlugin r_asm_plugin_avr;
extern RAsmPlugin r_asm_plugin_bf;
extern RAsmPlugin r_asm_plugin_null;
extern RAsmPlugin r_asm_plugin_chip8;
extern RAsmPlugin r_asm_plugin_cr16;
extern RAsmPlugin r_asm_plugin_cris_gnu;

@ -61,6 +61,7 @@ asm.cr16
asm.cris_gnu
asm.dalvik
asm.dcpu16
asm.null
asm.hexagon
asm.ebc
asm.gb