Rizin
unix-like reverse engineering framework and cli tools
asm_cil.c File Reference
#include <rz_asm.h>
#include "cil/cil_dis.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_cil
 
RZ_API RzLibStruct rizin_plugin
 

Function Documentation

◆ disassemble()

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

Definition at line 7 of file asm_cil.c.

7  {
8  CILOp cilop = { { { 0 } } };
9  if (cil_dis(&cilop, buf, len)) {
10  return 0;
11  }
12  rz_strbuf_copy(&op->buf_asm, &cilop.strbuf);
13  rz_strbuf_fini(&cilop.strbuf);
14  return op->size = cilop.size;
15 }
size_t len
Definition: 6502dis.c:15
int cil_dis(CILOp *op, const ut8 *buf, int len)
Disassemble a CIL buffer.
Definition: cil_dis.c:150
voidpf void * buf
Definition: ioapi.h:138
RZ_API bool rz_strbuf_copy(RzStrBuf *dst, RzStrBuf *src)
Definition: strbuf.c:48
RZ_API void rz_strbuf_fini(RzStrBuf *sb)
Definition: strbuf.c:365
Definition: cil_dis.h:27
int size
Definition: cil_dis.h:29
RzStrBuf strbuf
Definition: cil_dis.h:28
Definition: dis.c:32

References cil_dis(), len, rz_strbuf_copy(), rz_strbuf_fini(), CILOp::size, and CILOp::strbuf.

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
.type = RZ_LIB_TYPE_ASM,
}
RzAsmPlugin rz_asm_plugin_cil
Definition: asm_cil.c:17
@ 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 27 of file asm_cil.c.

◆ rz_asm_plugin_cil

RzAsmPlugin rz_asm_plugin_cil
Initial value:
= {
.name = "cil",
.arch = "cil",
.desc = ".NET Common Intermediate Language",
.license = "LGPL3",
.bits = 16 | 32 | 64,
.disassemble = &disassemble,
}
static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
Definition: asm_cil.c:7

Definition at line 17 of file asm_cil.c.