Rizin
unix-like reverse engineering framework and cli tools
asm_ebc.c File Reference
#include <stdio.h>
#include <string.h>
#include <rz_types.h>
#include <rz_lib.h>
#include <rz_asm.h>
#include <ebc_disas.h>

Go to the source code of this file.

Functions

static int disassemble (RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
 

Variables

RzAsmPlugin rz_asm_plugin_ebc
 
RZ_API RzLibStruct rizin_plugin
 

Function Documentation

◆ disassemble()

static int disassemble ( RzAsm a,
RzAsmOp op,
const ut8 buf,
int  len 
)
static

Definition at line 12 of file asm_ebc.c.

12  {
13  ebc_command_t cmd = { { 0 }, { 0 } };
14  int ret = ebc_decode_command(buf, &cmd);
15  const char *buf_asm = (cmd.operands[0])
16  ? sdb_fmt("%s %s", cmd.instr, cmd.operands)
17  : cmd.instr;
18  rz_asm_op_set_asm(op, buf_asm);
19  return op->size = ret;
20 }
RZ_API void rz_asm_op_set_asm(RzAsmOp *op, const char *str)
Definition: aop.c:53
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags cmd
Definition: sflib.h:79
int ebc_decode_command(const ut8 *instr, ebc_command_t *cmd)
Definition: ebc_disas.c:986
RZ_API char * sdb_fmt(const char *fmt,...)
Definition: fmt.c:26
voidpf void * buf
Definition: ioapi.h:138
Definition: dis.c:32

References cmd, ebc_decode_command(), rz_asm_op_set_asm(), and sdb_fmt().

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_ebc
Definition: asm_ebc.c:22
@ RZ_LIB_TYPE_ASM
Definition: rz_lib.h:72
#define RZ_VERSION
Definition: rz_version.h:8
const char * version
Definition: rz_asm.h:133

Definition at line 34 of file asm_ebc.c.

◆ rz_asm_plugin_ebc

RzAsmPlugin rz_asm_plugin_ebc
Initial value:
= {
.name = "ebc",
.license = "LGPL3",
.desc = "EFI Bytecode",
.author = "Fedor Sakharov",
.arch = "ebc",
.bits = 32 | 64,
.disassemble = &disassemble,
}
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_ebc.c:12
#define RZ_SYS_ENDIAN_LITTLE
Definition: rz_types.h:526

Definition at line 22 of file asm_ebc.c.