mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-25 06:36:34 +00:00
af0a865d9f
- Adds endian aware functions - Removes references to host endian - Uses binary detected endianness else tries LE and restricts by RAsmPlugin - Fixes gdb debugger endianness when debugging BE qemu gdbserver Signed-off-by: Damien Zammit <damien@zamaudio.com>
39 lines
730 B
C
39 lines
730 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <r_types.h>
|
|
#include <r_lib.h>
|
|
#include <r_asm.h>
|
|
|
|
#include <h8300_disas.h>
|
|
|
|
static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len)
|
|
{
|
|
int ret = 1;
|
|
struct h8300_cmd cmd;
|
|
|
|
ret = h8300_decode_command(buf, &cmd);
|
|
|
|
snprintf(op->buf_asm, R_ASM_BUFSIZE, "%s %s", cmd.instr, cmd.operands);
|
|
op->size = ret;
|
|
|
|
return ret;
|
|
}
|
|
|
|
RAsmPlugin r_asm_plugin_h8300 = {
|
|
.name = "h8300",
|
|
.license = "LGPL3",
|
|
.desc = "H8/300 disassembly plugin",
|
|
.arch = "h8300",
|
|
.bits = 16,
|
|
.endian = R_SYS_ENDIAN_BIG,
|
|
.disassemble = &disassemble
|
|
};
|
|
|
|
#ifndef CORELIB
|
|
struct r_lib_struct_t radare_plugin = {
|
|
.type = R_LIB_TYPE_ASM,
|
|
.data = &r_asm_plugin_h8300,
|
|
.version = R2_VERSION
|
|
};
|
|
#endif
|