Rizin
unix-like reverse engineering framework and cli tools
asm_propeller.c File Reference
#include <stdio.h>
#include <string.h>
#include <rz_types.h>
#include <rz_lib.h>
#include <rz_asm.h>
#include <propeller_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_propeller
 
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_propeller.c.

12  {
13  rz_return_val_if_fail(a && op && buf && len >= 4, -1);
14  const char *buf_asm;
15  struct propeller_cmd cmd;
16  int ret = propeller_decode_command(buf, &cmd);
17  if (cmd.prefix[0] && cmd.operands[0]) {
18  buf_asm = sdb_fmt("%s %s %s", cmd.prefix, cmd.instr, cmd.operands);
19  } else if (cmd.operands[0]) {
20  buf_asm = sdb_fmt("%s %s", cmd.instr, cmd.operands);
21  } else {
22  buf_asm = sdb_fmt("%s", cmd.instr);
23  }
24  rz_asm_op_set_asm(op, buf_asm);
25  op->size = 4;
26  return ret;
27 }
size_t len
Definition: 6502dis.c:15
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
RZ_API char * sdb_fmt(const char *fmt,...)
Definition: fmt.c:26
voidpf void * buf
Definition: ioapi.h:138
int propeller_decode_command(const ut8 *instr, struct propeller_cmd *cmd)
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
#define a(i)
Definition: sha256.c:41
Definition: dis.c:32

References a, cmd, len, propeller_decode_command(), rz_asm_op_set_asm(), rz_return_val_if_fail, and sdb_fmt().

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_propeller
Definition: asm_propeller.c:29
@ 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 40 of file asm_propeller.c.

◆ rz_asm_plugin_propeller

RzAsmPlugin rz_asm_plugin_propeller
Initial value:
= {
.name = "propeller",
.license = "LGPL3",
.desc = "propeller disassembly plugin",
.arch = "propeller",
.bits = 32,
.endian = RZ_SYS_ENDIAN_BIG,
.disassemble = &disassemble
}
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_propeller.c:12
#define RZ_SYS_ENDIAN_BIG
Definition: rz_types.h:527

Definition at line 29 of file asm_propeller.c.