From 5285d1bdea8e12e5e1afd5790afda237229be25d Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 9 Apr 2013 22:54:04 +0200 Subject: [PATCH] Break ABI. r_asm_disassemble's length is now 'int' --- libr/asm/asm.c | 4 ++-- libr/asm/p/asm_8051.c | 3 +-- libr/asm/p/asm_arc.c | 2 +- libr/asm/p/asm_arm.c | 2 +- libr/asm/p/asm_arm_winedbg.c | 2 +- libr/asm/p/asm_avr.c | 4 ++-- libr/asm/p/asm_bf.c | 4 ++-- libr/asm/p/asm_csr.c | 5 ++--- libr/asm/p/asm_dalvik.c | 4 ++-- libr/asm/p/asm_dcpu16.c | 4 ++-- libr/asm/p/asm_gas.c | 9 ++++++--- libr/asm/p/asm_i8080.c | 4 ++-- libr/asm/p/asm_java.c | 14 ++------------ libr/asm/p/asm_m68k.c | 4 ++-- libr/asm/p/asm_mips.c | 6 +++--- libr/asm/p/asm_msil.c | 2 +- libr/asm/p/asm_ppc.c | 4 ++-- libr/asm/p/asm_psosvm.c | 6 +++--- libr/asm/p/asm_rar.c | 2 +- libr/asm/p/asm_sh.c | 2 +- libr/asm/p/asm_sparc.c | 4 ++-- libr/asm/p/asm_x86.c | 4 ++-- libr/asm/p/asm_x86_as.c | 2 +- libr/asm/p/asm_x86_nasm.c | 2 +- libr/asm/p/asm_x86_olly.c | 4 ++-- libr/asm/p/asm_z80.c | 4 ++-- libr/include/r_asm.h | 6 +++--- r2-bindings/vapi/r_asm.vapi | 4 ++-- 28 files changed, 54 insertions(+), 63 deletions(-) diff --git a/libr/asm/asm.c b/libr/asm/asm.c index 530261347e..515315af40 100644 --- a/libr/asm/asm.c +++ b/libr/asm/asm.c @@ -281,7 +281,7 @@ R_API int r_asm_set_pc(RAsm *a, ut64 pc) { return R_TRUE; } -R_API int r_asm_disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +R_API int r_asm_disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { int ret = op->payload = 0; if (a->cur && a->cur->disassemble) ret = a->cur->disassemble (a, op, buf, len); @@ -328,7 +328,7 @@ R_API int r_asm_assemble(RAsm *a, RAsmOp *op, const char *buf) { return ret; } -R_API RAsmCode* r_asm_mdisassemble(RAsm *a, ut8 *buf, ut64 len) { +R_API RAsmCode* r_asm_mdisassemble(RAsm *a, ut8 *buf, int len) { RAsmCode *acode; int ret, slen; RAsmOp op; diff --git a/libr/asm/p/asm_8051.c b/libr/asm/p/asm_8051.c index a3c2156558..90909eeb80 100644 --- a/libr/asm/p/asm_8051.c +++ b/libr/asm/p/asm_8051.c @@ -9,8 +9,7 @@ #include #include "../arch/8051/8051.c" -// ut64 for length here is overkill! -static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { Op8051 o = do8051struct (buf, len); if (!o.name) return 0; // invalid instruction do8051disasm (o, op->buf_asm, sizeof (op->buf_asm)); diff --git a/libr/asm/p/asm_arc.c b/libr/asm/p/asm_arc.c index 5be1bb0b72..94217f0705 100644 --- a/libr/asm/p/asm_arc.c +++ b/libr/asm/p/asm_arc.c @@ -48,7 +48,7 @@ static int buf_fprintf(void *stream, const char *format, ...) { } int decodeInstr (bfd_vma address, disassemble_info * info); -static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, int len) { static struct disassemble_info disasm_obj; if (len<4) return -1; buf_global = op->buf_asm; diff --git a/libr/asm/p/asm_arm.c b/libr/asm/p/asm_arm.c index a23a750b3d..ea503c5580 100644 --- a/libr/asm/p/asm_arm.c +++ b/libr/asm/p/asm_arm.c @@ -53,7 +53,7 @@ static int buf_fprintf(void *stream, const char *format, ...) { return R_TRUE; } -static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { struct disassemble_info obj; if (len<(a->bits/8)) return -1; diff --git a/libr/asm/p/asm_arm_winedbg.c b/libr/asm/p/asm_arm_winedbg.c index e9f04f13af..5116d366f5 100644 --- a/libr/asm/p/asm_arm_winedbg.c +++ b/libr/asm/p/asm_arm_winedbg.c @@ -9,7 +9,7 @@ #include #include "../arch/arm/winedbg/be_arm.h" -static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { char buf2[4]; struct arm_insn *arminsn = arm_new(); arm_set_pc (arminsn, a->pc); diff --git a/libr/asm/p/asm_avr.c b/libr/asm/p/asm_avr.c index 92a6433f76..a6e6c971ca 100644 --- a/libr/asm/p/asm_avr.c +++ b/libr/asm/p/asm_avr.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2010 pancake <@nopcode.org> */ +/* radare - LGPL - Copyright 2010-2013 - pancake */ #include #include @@ -11,7 +11,7 @@ #include "../arch/avr/disasm.c" -static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { return op->inst_len = avrdis (op->buf_asm, a->pc, buf, len); } diff --git a/libr/asm/p/asm_bf.c b/libr/asm/p/asm_bf.c index 85df6ff445..8842d34df0 100644 --- a/libr/asm/p/asm_bf.c +++ b/libr/asm/p/asm_bf.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2012 - pancake, nibble */ +/* radare - LGPL - Copyright 2009-2013 - pancake, nibble */ #include #include @@ -8,7 +8,7 @@ #include -static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, int len) { char *buf_cp, *b; int i; diff --git a/libr/asm/p/asm_csr.c b/libr/asm/p/asm_csr.c index 89cc26fda4..bfd8d38713 100644 --- a/libr/asm/p/asm_csr.c +++ b/libr/asm/p/asm_csr.c @@ -1,7 +1,6 @@ -/* radare - LGPL - Copyright 2009-2010 nibble<.ds@gmail.com> */ +/* radare - LGPL - Copyright 2009-2013 - nibble */ #include - #include #include #include @@ -29,7 +28,7 @@ static int arch_csr_disasm(char *str, const unsigned char *buf, ut64 seek) { #endif return 0; } -static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, int len) { arch_csr_disasm (op->buf_asm, buf, a->pc); return (op->inst_len=2); } diff --git a/libr/asm/p/asm_dalvik.c b/libr/asm/p/asm_dalvik.c index d2d5eca4a5..f65fdfef74 100644 --- a/libr/asm/p/asm_dalvik.c +++ b/libr/asm/p/asm_dalvik.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2012 - earada, pancake */ +/* radare - LGPL - Copyright 2009-2013 - earada, pancake */ #include #include @@ -9,7 +9,7 @@ #include -static int dalvik_disassemble (RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +static int dalvik_disassemble (RAsm *a, RAsmOp *op, const ut8 *buf, int len) { int i = (int) buf[0]; int vA, vB, vC; char str[1024]; diff --git a/libr/asm/p/asm_dcpu16.c b/libr/asm/p/asm_dcpu16.c index 2274620a19..4dde7a7230 100644 --- a/libr/asm/p/asm_dcpu16.c +++ b/libr/asm/p/asm_dcpu16.c @@ -1,4 +1,4 @@ -/* radare2 - LGPL - Copyright 2012 pancake */ +/* radare2 - LGPL - Copyright 2012-2013 pancake */ #include #include @@ -10,7 +10,7 @@ #include "../arch/dcpu16/dcpu16.h" // ut64 for length here is overkill! -static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { if (len<2) return -1; // at least 2 bytes! op->inst_len = dcpu16_disasm (op->buf_asm, (const ut16*)buf, len, NULL); if (op->inst_len == -1) diff --git a/libr/asm/p/asm_gas.c b/libr/asm/p/asm_gas.c index 8173dc163a..a4010398fa 100644 --- a/libr/asm/p/asm_gas.c +++ b/libr/asm/p/asm_gas.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2010-2011 pancake */ +/* radare - LGPL - Copyright 2010-2013 - pancake */ #include #include @@ -6,11 +6,14 @@ #include // XXX: TODO Implement -static int assemble(struct r_asm_t *a, struct r_asm_op_t *op, const char *buf) { +static int assemble(RAsm *a, RAsmOp *op, const char *buf) { int len = 0; char cmd[R_ASM_BUFSIZE]; ut8 *out; - sprintf(cmd, "gas /dev/stdin -o /dev/stdout <<__\nBITS %i\nORG 0x%"PFMT64x"\n%s\n__", a->bits, a->pc, buf); + snprintf (cmd, sizeof (cmd), + "gas /dev/stdin -o /dev/stdout <<__\n" + "BITS %i\nORG 0x%"PFMT64x"\n%s\n__", + a->bits, a->pc, buf); out = (ut8 *)r_sys_cmd_str(cmd, "", &len); if (out) { memcpy(op->buf, out, len<=R_ASM_BUFSIZE?len:R_ASM_BUFSIZE); diff --git a/libr/asm/p/asm_i8080.c b/libr/asm/p/asm_i8080.c index cb217ccd00..6323d14a6a 100644 --- a/libr/asm/p/asm_i8080.c +++ b/libr/asm/p/asm_i8080.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2012 - Alexander */ +/* radare - LGPL - Copyright 2012-2013 - Alexander */ #include #include @@ -7,7 +7,7 @@ #include "../arch/i8080/i8080dis.c" -static int do_disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int do_disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, int len) { int dlen = i8080_disasm (buf, op->buf_asm, len); if (dlen<0) dlen = 0; op->inst_len = dlen; diff --git a/libr/asm/p/asm_java.c b/libr/asm/p/asm_java.c index 1bf324d895..21535cddf5 100644 --- a/libr/asm/p/asm_java.c +++ b/libr/asm/p/asm_java.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2012 - nibble, pancake */ +/* radare - LGPL - Copyright 2009-2013 - nibble, pancake */ #include #include @@ -9,8 +9,7 @@ #include "../../shlr/java/code.h" #include -//static const char *lastfile = NULL; -static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { //void *cp; RBinJavaObj *obj = NULL; RBin *b = a->binb.bin; @@ -20,15 +19,6 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { if (obj) r_java_setcp (obj->cp_items, obj->cf.cp_count); } } - // XXX: crossmodule dependency -// TODO: get class info from rbin if loaded -#if 0 - RCore *core = (RCore*)a->user; - if (core && core->file && lastfile != core->file->filename) { - lastfile = core->file->filename; - java_classdump (lastfile, 0); - } else javasm_init (); -#endif return op->inst_len = r_java_disasm (a->pc, buf, op->buf_asm, sizeof (op->buf_asm)); } diff --git a/libr/asm/p/asm_m68k.c b/libr/asm/p/asm_m68k.c index 8a8a35ad79..7a5ddd8432 100644 --- a/libr/asm/p/asm_m68k.c +++ b/libr/asm/p/asm_m68k.c @@ -1,4 +1,4 @@ -/* radare - GPL3 - Copyright 2009-2012 nibble<.ds@gmail.com> */ +/* radare - GPL3 - Copyright 2009-2013 - nibble */ #include #include @@ -10,7 +10,7 @@ #include "m68k/m68k_disasm/m68k_disasm.h" -static int disassemble(RAsm *a, RAsmOp *aop, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *aop, const ut8 *buf, int len) { m68k_word bof[4]; m68k_word iaddr = (m68k_word)a->pc; char opcode[256]; diff --git a/libr/asm/p/asm_mips.c b/libr/asm/p/asm_mips.c index d3aaaeda0e..51c85ed0de 100644 --- a/libr/asm/p/asm_mips.c +++ b/libr/asm/p/asm_mips.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2012 - pancake, nibble */ +/* radare - LGPL - Copyright 2009-2013 - pancake, nibble */ #include #include @@ -55,7 +55,7 @@ static int buf_fprintf(void *stream, const char *format, ...) { return R_TRUE; } -static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, int len) { static struct disassemble_info disasm_obj; if (len<4) return -1; buf_global = op->buf_asm; @@ -63,7 +63,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, memcpy (bytes, buf, 4); // TODO handle thumb /* prepare disassembler */ - memset (&disasm_obj,'\0', sizeof(struct disassemble_info)); + memset (&disasm_obj,'\0', sizeof (struct disassemble_info)); mips_mode = a->bits; disasm_obj.arch = CPU_LOONGSON_2F; disasm_obj.buffer = bytes; diff --git a/libr/asm/p/asm_msil.c b/libr/asm/p/asm_msil.c index 3db45e1860..def0f6717f 100644 --- a/libr/asm/p/asm_msil.c +++ b/libr/asm/p/asm_msil.c @@ -20,7 +20,7 @@ static int arch_msil_disasm(char *str, const ut8 *buf, ut64 seek) { return 0; } -static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, int len) { arch_msil_disasm (op->buf_asm, buf, a->pc); return (op->inst_len=2); } diff --git a/libr/asm/p/asm_ppc.c b/libr/asm/p/asm_ppc.c index 910506beac..c65158cfa6 100644 --- a/libr/asm/p/asm_ppc.c +++ b/libr/asm/p/asm_ppc.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2010 nibble<.ds@gmail.com> */ +/* radare - LGPL - Copyright 2009-2013 - nibble */ #include #include @@ -57,7 +57,7 @@ static int buf_fprintf(void *stream, const char *format, ...) { return 0; } -static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, int len) { static struct disassemble_info disasm_obj; if (len<4) return -1; diff --git a/libr/asm/p/asm_psosvm.c b/libr/asm/p/asm_psosvm.c index 9b2ccce2c6..6bde1b8a1f 100644 --- a/libr/asm/p/asm_psosvm.c +++ b/libr/asm/p/asm_psosvm.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2010 nibble<.ds@gmail.com> */ +/* radare - LGPL - Copyright 2009-2013 - nibble */ #include #include @@ -6,14 +6,14 @@ #include #include -static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, int len) { psosvmasm_init(); op->inst_len = psosvm_disasm(buf, op->buf_asm); return op->inst_len; } -static int assemble(struct r_asm_t *a, struct r_asm_op_t *op, const char *buf) { +static int assemble(RAsm *a, RAsmOp *op, const char *buf) { op->inst_len = psosvm_assemble(op->buf, buf); return op->inst_len; } diff --git a/libr/asm/p/asm_rar.c b/libr/asm/p/asm_rar.c index ffd32cceed..226d84c69f 100644 --- a/libr/asm/p/asm_rar.c +++ b/libr/asm/p/asm_rar.c @@ -9,7 +9,7 @@ #include #include "../../shlr/rar/all.c" -static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { // TODO: support bitsize opcodes // rarvm_disassemble (&b, str); return 0; diff --git a/libr/asm/p/asm_sh.c b/libr/asm/p/asm_sh.c index 01a7bbc178..38cc335bc1 100644 --- a/libr/asm/p/asm_sh.c +++ b/libr/asm/p/asm_sh.c @@ -52,7 +52,7 @@ static int buf_fprintf(void *stream, const char *format, ...) { return ret; } -static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { static struct disassemble_info disasm_obj; if (len<2) return -1; buf_global = op->buf_asm; diff --git a/libr/asm/p/asm_sparc.c b/libr/asm/p/asm_sparc.c index 8a7dee8989..b02977adb2 100644 --- a/libr/asm/p/asm_sparc.c +++ b/libr/asm/p/asm_sparc.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2011 - nibble */ +/* radare - LGPL - Copyright 2009-2013 - nibble */ #include #include @@ -47,7 +47,7 @@ static int buf_fprintf(void *stream, const char *format, ...) { return 0; } -static int disassemble(RAsm *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { static struct disassemble_info disasm_obj; if (len<4) return -1; buf_global = op->buf_asm; diff --git a/libr/asm/p/asm_x86.c b/libr/asm/p/asm_x86.c index a783585387..dc5161c6d8 100644 --- a/libr/asm/p/asm_x86.c +++ b/libr/asm/p/asm_x86.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2012 - nibble */ +/* radare - LGPL - Copyright 2009-2013 - nibble */ #include #include @@ -43,7 +43,7 @@ static int modify(RAsm *a, ut8 *buf, int field, ut64 val) { return ret; } -static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len) { +static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { static ud_t disasm_obj; ud_init (&disasm_obj); ud_set_syntax (&disasm_obj, diff --git a/libr/asm/p/asm_x86_as.c b/libr/asm/p/asm_x86_as.c index b5487ed329..845a5e6ac7 100644 --- a/libr/asm/p/asm_x86_as.c +++ b/libr/asm/p/asm_x86_as.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2011 pancake */ +/* radare - LGPL - Copyright 2011-2013 pancake */ #include #include diff --git a/libr/asm/p/asm_x86_nasm.c b/libr/asm/p/asm_x86_nasm.c index 0af60917ae..acf4e17ea3 100644 --- a/libr/asm/p/asm_x86_nasm.c +++ b/libr/asm/p/asm_x86_nasm.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2011 pancake */ +/* radare - LGPL - Copyright 2009-2013 - pancake */ #include #include diff --git a/libr/asm/p/asm_x86_olly.c b/libr/asm/p/asm_x86_olly.c index 96d52f608b..9d8c3c1f71 100644 --- a/libr/asm/p/asm_x86_olly.c +++ b/libr/asm/p/asm_x86_olly.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2012 pancake, nibble */ +/* radare - LGPL - Copyright 2009-2013 - pancake, nibble */ #include #include @@ -9,7 +9,7 @@ #include "x86/ollyasm/disasm.h" -static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, int len) { t_disasm disasm_obj; op->inst_len = Disasm_olly(buf, len, a->pc, &disasm_obj, DISASM_FILE); diff --git a/libr/asm/p/asm_z80.c b/libr/asm/p/asm_z80.c index ec0aeb647d..eca55f78dd 100644 --- a/libr/asm/p/asm_z80.c +++ b/libr/asm/p/asm_z80.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2012 - pancake */ +/* radare - LGPL - Copyright 2012-2013 - pancake */ #include #include @@ -11,7 +11,7 @@ static int do_assemble(RAsm *a, RAsmOp *op, const char *buf) { return op->inst_len = z80asm (op->buf, buf); } -static int do_disassemble(struct r_asm_t *a, struct r_asm_op_t *op, const ut8 *buf, ut64 len) { +static int do_disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { int dlen = z80dis (0, buf, op->buf_asm, len); if (dlen<0) dlen = 0; op->inst_len = dlen; diff --git a/libr/include/r_asm.h b/libr/include/r_asm.h index ec7398dd38..eb0c3e102e 100644 --- a/libr/include/r_asm.h +++ b/libr/include/r_asm.h @@ -102,7 +102,7 @@ typedef struct r_asm_plugin_t { int *bits; int (*init)(void *user); int (*fini)(void *user); - int (*disassemble)(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len); + int (*disassemble)(RAsm *a, RAsmOp *op, const ut8 *buf, int len); int (*assemble)(RAsm *a, RAsmOp *op, const char *buf); RAsmModifyCallback modify; int (*set_subarch)(RAsm *a, const char *buf); @@ -122,9 +122,9 @@ R_API int r_asm_set_bits(RAsm *a, int bits); R_API int r_asm_set_big_endian(RAsm *a, int boolean); R_API int r_asm_set_syntax(RAsm *a, int syntax); R_API int r_asm_set_pc(RAsm *a, ut64 pc); -R_API int r_asm_disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, ut64 len); +R_API int r_asm_disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len); R_API int r_asm_assemble(RAsm *a, RAsmOp *op, const char *buf); -R_API RAsmCode* r_asm_mdisassemble(RAsm *a, ut8 *buf, ut64 len); +R_API RAsmCode* r_asm_mdisassemble(RAsm *a, ut8 *buf, int len); R_API RAsmCode* r_asm_mdisassemble_hexstr(RAsm *a, const char *hexstr); R_API RAsmCode* r_asm_massemble(RAsm *a, const char *buf); R_API RAsmCode* r_asm_assemble_file(RAsm *a, const char *file); diff --git a/r2-bindings/vapi/r_asm.vapi b/r2-bindings/vapi/r_asm.vapi index e6fa77cfa2..e0d414b839 100644 --- a/r2-bindings/vapi/r_asm.vapi +++ b/r2-bindings/vapi/r_asm.vapi @@ -161,9 +161,9 @@ public class RAsm { public bool set_pc(uint64 addr); public bool set_big_endian(bool big); // TODO: Use Code? instead of op?? - public int disassemble(out Op op, uint8* buf, uint64 length); + public int disassemble(out Op op, uint8* buf, int length); public int assemble(out Op op, string buf); - public Code? mdisassemble(uint8 *buf, uint64 length); + public Code? mdisassemble(uint8 *buf, int length); public Code? mdisassemble_hexstr(string hexstr); public Code? massemble(string buf); public Code? assemble_file(string file);