mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-01 00:51:19 +00:00
Fix r_reg_next_diff (thanks defragger!)
This commit is contained in:
parent
a9907ec4f5
commit
ab05fbd9d3
@ -347,15 +347,16 @@ R_API RRegItem *r_reg_next_diff(RReg *reg, int type, const ut8* buf, int buflen,
|
||||
return NULL;
|
||||
arena = reg->regset[type].arena;
|
||||
delta = prev_ri? prev_ri->offset+prev_ri->size: 0;
|
||||
if (delta>=arena->size || delta >= buflen)
|
||||
return NULL;
|
||||
dist = r_mem_mem (arena->bytes+delta, arena->size, buf, buflen);
|
||||
if (dist) {
|
||||
RRegItem *ri = r_reg_get_at (reg, regsize, type,
|
||||
(int)(size_t)(dist-arena->bytes));
|
||||
if (ri) return ri;
|
||||
return r_reg_next_diff (reg, type,
|
||||
buf, buflen, ri, regsize);
|
||||
}
|
||||
for (;;) {
|
||||
if (delta>=arena->size || delta >= buflen)
|
||||
break;
|
||||
dist = r_mem_mem (arena->bytes+delta, arena->size, buf, buflen);
|
||||
if (dist) {
|
||||
RRegItem *ri = r_reg_get_at (reg, regsize, type,
|
||||
(int)(size_t)(dist-arena->bytes));
|
||||
if (ri) return ri;
|
||||
}
|
||||
delta += regsize;
|
||||
} while (delta<buflen);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user