diff --git a/libr/anal/p/anal_ws.c b/libr/anal/p/anal_ws.c index 52fcbc321e..93375e4836 100644 --- a/libr/anal/p/anal_ws.c +++ b/libr/anal/p/anal_ws.c @@ -9,19 +9,19 @@ #define WS_API static #include "../../asm/arch/whitespace/wsdis.c" -static ut64 ws_find_label(int l, RIOBind iob) { - RIO *io = iob.io; - ut64 cur = 0, size = iob.desc_size (io->desc); +static ut64 ws_find_label(int l, const RIOBind *iob) { + RIO *io = iob->io; + ut64 cur = 0, size = iob->desc_size (io->desc); ut8 buf[128]; RAsmOp aop; - iob.read_at (iob.io, cur, buf, 128); + iob->read_at (iob->io, cur, buf, 128); while (cur <= size && wsdis (&aop, buf, 128)) { const char *buf_asm = r_strbuf_get (&aop.buf_asm); // r_asm_op_get_asm (&aop); if (buf_asm && (strlen (buf_asm) > 4) && buf_asm[0] == 'm' && buf_asm[1] == 'a' && l == atoi (buf_asm + 5)) { return cur; } cur = cur + aop.size; - iob.read_at (iob.io, cur, buf, 128); + iob->read_at (iob->io, cur, buf, 128); } return 0; } @@ -63,7 +63,7 @@ static int ws_anal(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len if (buf_asm[1] == 'a') { op->type = R_ANAL_OP_TYPE_CALL; op->fail = addr + aop->size; - op->jump = ws_find_label (atoi (buf_asm + 5), anal->iob); + op->jump = ws_find_label (atoi (buf_asm + 5), &anal->iob); } else { op->type = R_ANAL_OP_TYPE_UPUSH; } @@ -71,10 +71,10 @@ static int ws_anal(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len case 'j': if (buf_asm[1] == 'm') { op->type = R_ANAL_OP_TYPE_JMP; - op->jump = ws_find_label(atoi (buf_asm + 4), anal->iob); + op->jump = ws_find_label(atoi (buf_asm + 4), &anal->iob); } else { op->type = R_ANAL_OP_TYPE_CJMP; - op->jump = ws_find_label(atoi(buf_asm + 3), anal->iob); + op->jump = ws_find_label(atoi(buf_asm + 3), &anal->iob); } op->fail = addr + aop->size; break;