mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-10 16:23:08 +00:00
535a2aa713
* Split core/cmd.c into disasm.c and core/visual.c into vmenus.c * Fix some warnings reported by valgrind * Chop instructions disassembled by udis86 * Fix visual prompt display in debugger mode * Added 'pdi' and 'pdf' commands - Used to print just instructions or lengths - Documented via 'pd?' * Added initial work on a test suite for r2 - Spot a crash!
33 lines
678 B
C
33 lines
678 B
C
/* radare - LGPL - Copyright 2009-2010 nibble<.ds@gmail.com> */
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <r_types.h>
|
|
#include <r_lib.h>
|
|
#include <r_util.h>
|
|
#include <r_asm.h>
|
|
#include "csr/dis.c"
|
|
|
|
static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) {
|
|
arch_csr_disasm (op->buf_asm, buf, a->pc);
|
|
return (op->inst_len=2);
|
|
}
|
|
|
|
RAsmPlugin r_asm_plugin_csr = {
|
|
.name = "csr",
|
|
.arch = "csr",
|
|
.bits = (int[]){ 16, 0 },
|
|
.desc = "CSR disassembly plugin",
|
|
.init = NULL,
|
|
.fini = NULL,
|
|
.disassemble = &disassemble,
|
|
.assemble = NULL
|
|
};
|
|
|
|
#ifndef CORELIB
|
|
struct r_lib_struct_t radare_plugin = {
|
|
.type = R_LIB_TYPE_ASM,
|
|
.data = &r_asm_plugin_csr
|
|
};
|
|
#endif
|