Rizin
unix-like reverse engineering framework and cli tools
asm_pic.c File Reference

Go to the source code of this file.

Functions

static int asm_pic_disassemble (RzAsm *a, RzAsmOp *op, const ut8 *b, int l)
 

Variables

RzAsmPlugin rz_asm_plugin_pic
 
RZ_API RzLibStruct rizin_plugin
 

Function Documentation

◆ asm_pic_disassemble()

static int asm_pic_disassemble ( RzAsm a,
RzAsmOp op,
const ut8 b,
int  l 
)
static

Definition at line 12 of file asm_pic.c.

12  {
13  int res = -1;
14  char opbuf[128];
15  const char *opstr = opbuf;
16  strcpy(opbuf, "invalid");
17  if (a->cpu && strcasecmp(a->cpu, "baseline") == 0) {
18  res = pic_baseline_disassemble(op, opbuf, b, l);
19  } else if (a->cpu && strcasecmp(a->cpu, "midrange") == 0) {
20  res = pic_midrange_disassemble(op, opbuf, b, l);
21  } else if (a->cpu && strcasecmp(a->cpu, "pic18") == 0) {
22  res = pic_pic18_disassemble(op, opbuf, b, l);
23  }
25  return op->size = res;
26 }
RZ_API void rz_asm_op_set_asm(RzAsmOp *op, const char *str)
Definition: aop.c:53
static int opstr(RzAsm *a, ut8 *data, const Opcode *op)
Definition: asm_x86_nz.c:4054
int pic_baseline_disassemble(RzAsmOp *op, char *opbuf, const ut8 *b, int l)
Definition: pic_baseline.c:193
int pic_midrange_disassemble(RzAsmOp *op, char *opbuf, const ut8 *b, int l)
Definition: pic_midrange.c:159
int pic_pic18_disassemble(RzAsmOp *op, char *opbuf, const ut8 *b, int blen)
Definition: pic_pic18.c:114
#define b(i)
Definition: sha256.c:42
#define a(i)
Definition: sha256.c:41
Definition: dis.c:32

References a, b, opstr(), pic_baseline_disassemble(), pic_midrange_disassemble(), pic_pic18_disassemble(), and rz_asm_op_set_asm().

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_pic
Definition: asm_pic.c:28
@ RZ_LIB_TYPE_ASM
Definition: rz_lib.h:72

Definition at line 39 of file asm_pic.c.

◆ rz_asm_plugin_pic

RzAsmPlugin rz_asm_plugin_pic
Initial value:
= {
.name = "pic",
.arch = "pic",
.cpus = "baseline,midrange,pic18",
.bits = 8,
.license = "LGPL3",
.desc = "PIC disassembler",
.disassemble = &asm_pic_disassemble
}
static int asm_pic_disassemble(RzAsm *a, RzAsmOp *op, const ut8 *b, int l)
Definition: asm_pic.c:12

Definition at line 28 of file asm_pic.c.