Moved init of core->anal->read_at into r_core_init()

This commit is contained in:
Khairul Kasmiran 2018-03-08 22:05:05 +08:00
parent bbb4fb263b
commit c7e38939bd
2 changed files with 5 additions and 5 deletions

View File

@ -3098,10 +3098,6 @@ static ut64 initializeEsil(RCore *core) {
return addr;
}
static bool read_at(RAnal *anal, ut64 addr, ut8 *buf, int len) {
return r_io_read_at (anal->iob.io, addr, buf, len);
}
R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr, ut64 *prev_addr) {
#define return_tail(x) { tail_return_value = x; goto tail_return; }
int tail_return_value = 0;
@ -3123,7 +3119,6 @@ R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr,
return 0;
}
r_anal_esil_setup (esil, core->anal, romem, stats, noNULL); // setup io
core->anal->read_at = read_at;
core->anal->esil = esil;
esil->verbose = verbose;
{

View File

@ -1723,6 +1723,10 @@ static bool r_core_anal_log(struct r_anal_t *anal, const char *msg) {
return true;
}
static bool r_core_anal_read_at(struct r_anal_t *anal, ut64 addr, ut8 *buf, int len) {
return r_io_read_at (anal->iob.io, addr, buf, len);
}
R_API bool r_core_init(RCore *core) {
core->blocksize = R_CORE_BLOCKSIZE;
core->block = (ut8*)calloc (R_CORE_BLOCKSIZE + 1, 1);
@ -1816,6 +1820,7 @@ R_API bool r_core_init(RCore *core) {
r_asm_set_user_ptr (core->assembler, core);
core->anal = r_anal_new ();
core->anal->log = r_core_anal_log;
core->anal->read_at = r_core_anal_read_at;
core->anal->meta_spaces.cb_printf = r_cons_printf;
core->anal->cb.on_fcn_new = on_fcn_new;
core->anal->cb.on_fcn_delete = on_fcn_delete;