* reflines partial fix
This commit is contained in:
parent
f14d72c7d1
commit
a09f365de5
3 changed files with 6 additions and 7 deletions
|
|
@ -95,7 +95,7 @@ int r_anal_aop(struct r_anal_t *anal, struct r_anal_aop_t *aop, void *data)
|
|||
return R_FALSE;
|
||||
}
|
||||
|
||||
int r_anal_reflines_get(struct r_anal_t *anal, struct r_anal_refline_t *reflines, u8 *buf, u64 len, int nlines, int linesout)
|
||||
struct r_anal_refline_t *r_anal_reflines_get(struct r_anal_t *anal, u8 *buf, u64 len, int nlines, int linesout)
|
||||
{
|
||||
struct r_anal_refline_t *list = MALLOC_STRUCT(struct r_anal_refline_t);
|
||||
struct r_anal_refline_t *list2;
|
||||
|
|
@ -155,8 +155,7 @@ int r_anal_reflines_get(struct r_anal_t *anal, struct r_anal_refline_t *reflines
|
|||
bsz += sz;
|
||||
}
|
||||
|
||||
reflines = list;
|
||||
return R_TRUE;
|
||||
return list;
|
||||
}
|
||||
|
||||
int r_anal_reflines_str(struct r_anal_t *anal, struct r_anal_refline_t *list, u64 addr, char *str, int opts)
|
||||
|
|
|
|||
|
|
@ -363,16 +363,16 @@ static int cmd_print(void *data, const char *input)
|
|||
char str[128];
|
||||
char line[128];
|
||||
struct r_asm_aop_t aop;
|
||||
struct r_anal_refline_t reflines;
|
||||
struct r_anal_refline_t *reflines;
|
||||
|
||||
r_anal_set(&core->anal, "anal_x86");
|
||||
r_anal_set_pc(&core->anal, core->seek);
|
||||
r_anal_reflines_get(&core->anal, &reflines, buf, len, 64, 0);
|
||||
reflines = r_anal_reflines_get(&core->anal, buf, len, 64, 0);
|
||||
|
||||
r_asm_set_pc(&core->assembler, core->seek);
|
||||
for(idx=ret=0; idx < len; idx+=ret) {
|
||||
r_asm_set_pc(&core->assembler, core->assembler.pc + ret);
|
||||
r_anal_reflines_str(&core->anal, &reflines, core->anal.pc + idx, line, 0);
|
||||
r_anal_reflines_str(&core->anal, reflines, core->anal.pc + idx, line, 0);
|
||||
ret = r_asm_disassemble(&core->assembler, &aop, buf+idx, len-idx);
|
||||
if (ret <1) {
|
||||
ret = 1;
|
||||
|
|
|
|||
|
|
@ -125,6 +125,6 @@ int r_anal_set_bits(struct r_anal_t *anal, int bits);
|
|||
int r_anal_set_big_endian(struct r_anal_t *anal, int boolean);
|
||||
int r_anal_set_pc(struct r_anal_t *a, u64 pc);
|
||||
int r_anal_aop(struct r_anal_t *anal, struct r_anal_aop_t *aop, void *data);
|
||||
int r_anal_reflines_get(struct r_anal_t *anal, struct r_anal_refline_t *reflines, u8 *buf, u64 len, int nlines, int linesout);
|
||||
struct r_anal_refline_t *r_anal_reflines_get(struct r_anal_t *anal, u8 *buf, u64 len, int nlines, int linesout);
|
||||
int r_anal_reflines_str(struct r_anal_t *anal, struct r_anal_refline_t *list, u64 addr, char *str, int opts);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue