Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
7c37161
Move code from esil_trace refactor to type_trace
condret Apr 4, 2025
9fa53ce
bvhjik
condret Apr 22, 2025
0c05247
56ftgyhuji
condret Apr 22, 2025
3f3823e
Stack map setup + esil interfaces for type trace
condret Apr 23, 2025
b2e9f72
Finish refactoring tps_{init/fini} for now
condret Apr 24, 2025
e3e72a6
Some more refactoring
condret Apr 24, 2025
96f93fe
Add missing LOC
condret Apr 25, 2025
5393ca0
wooooops
condret Apr 25, 2025
a0f9d8a
Add type_trace_loopcount functions
condret Apr 28, 2025
41016b2
Avoid use of r_core_esil_step in type_trace
condret Apr 28, 2025
fb60597
Use type_trace_op instead of r_esil_parse in type propagation
condret Apr 28, 2025
c0980d5
blub
condret Apr 28, 2025
f467545
tyfvguhbjnkm
condret Apr 28, 2025
29c8f7e
tfygvuhbijnkm
condret Apr 28, 2025
7f0a5b8
fix segfault
condret Apr 28, 2025
d50428e
Fix another segfault
condret Apr 28, 2025
e02497a
Fix 2 more segfaults
condret Apr 28, 2025
c45497e
Remove unused type_trace_restore helpers
condret Apr 29, 2025
6399590
Remove a bunch of crap and overall speedup typetrace
condret Apr 29, 2025
a00c67d
Hackfix
condret Apr 29, 2025
77fed3b
disable forgotten unused function to stop compiler bitching
condret Apr 29, 2025
47ca8d4
use new esil api to see what happens
condret Apr 30, 2025
55c579e
Fix some bugz
condret Apr 30, 2025
7d1ef8a
Prepare esil_dfg for switch to new esil api
condret May 2, 2025
60b3c4b
Prepare vmenus for switch to new esil api
condret May 2, 2025
1fa053b
Prepare cmd_search for switch to new esil api
condret May 3, 2025
b40be03
Fix esil_dfg unit tests for new api
condret May 5, 2025
5754a4d
Prepare anal for switch to new esil api
condret May 5, 2025
66e0a84
Fix annoying warning when using new esil api
condret May 5, 2025
9230ae3
Fix esil_toc for switch to new esil api
condret May 5, 2025
d106e6f
Prepare esil_cost in cmd_anal.inc.c for switch to new esil api
condret May 7, 2025
d0b2f27
Fix esil_toc
condret May 7, 2025
670657e
Continue massaging cmd_anal.inc.c for new esil api
condret May 7, 2025
bc1bbfc
Add anal specific esil mem and reg interfaces
condret May 8, 2025
b5b9c1a
Use esil->reg_if.is_reg in not_a_number (libr/esil/esil.c) if new esi…
condret May 8, 2025
a333fe0
Further massage cmd_anal.inc.c for new esil api
condret May 8, 2025
c6babb6
Add mdev and ioer support to core_esil
condret May 9, 2025
b233134
Add cmd_step and cmd_step_out support to core_esil
condret May 10, 2025
b5de016
Implement step back capabilities in RCoreEsil
condret May 11, 2025
1348d8f
Add esil back step config var
condret May 26, 2025
d20e487
Initialize core_esil on core init and autoupdate on arch config changes
condret May 27, 2025
a1a843f
Start rewriting r_core_esil_step
condret Jun 5, 2025
faf8e0c
Add r_core_esil_run_expr_at and fix some things pointed out by @trufae
condret Jun 10, 2025
d425851
Rewrite r_core_esil_step{_back} using new esil api
condret Jun 20, 2025
f4ed577
Add missing brace
condret Jun 28, 2025
09ed840
Add sanity check
condret Jun 28, 2025
dc1ffee
Fix warnings
radare Jul 11, 2025
e15b8c7
i
radare Jul 12, 2025
122eae9
fw
radare Jul 12, 2025
8057a80
fw
radare Jul 12, 2025
c86e803
more fixes
radare Jul 14, 2025
80e9bff
wiring up more reg/memifs to esil
radare Jul 14, 2025
5057b38
more segflutes fixed
radare Jul 14, 2025
f70b4b0
meh
radare Jul 14, 2025
3d3ecd5
step ismpety
radare Jul 14, 2025
74a3570
fix step
radare Jul 14, 2025
931be62
Add temporary hack to use anal->reg in core_esil
condret Jul 14, 2025
4499f4e
Remove esil.verbose and fix null derefs when esil->anal is nul
radare Jul 14, 2025
43b9654
bring back
radare Jul 14, 2025
8de3f5a
coreesil is cesil
radare Jul 15, 2025
e9b8649
fb
radare Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions libr/anal/anal.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,84 @@ static void r_meta_item_free(void *_item) {
}
}

#if USE_NEW_ESIL
static bool anal_esil_mem_switch (void *mem, ut32 idx) {
RAnal *anal = mem;
if (!anal || !anal->iob.init) {
R_LOG_WARN ("anal->iob is not setup");
return false;
}
return anal->iob.bank_use (anal->iob.io, idx);
}

static bool anal_esil_mem_read (void *mem, ut64 addr, ut8 *buf, int len) {
RAnal *anal = mem;
if (!anal || !anal->iob.init) {
R_LOG_WARN ("anal->iob is not setup");
return false;
}
return anal->iob.read_at (anal->iob.io, addr, buf, len);
}

static bool anal_esil_mem_write (void *mem, ut64 addr, const ut8 *buf, int len) {
RAnal *anal = mem;
if (!anal || !anal->iob.init) {
R_LOG_WARN ("anal->iob is not setup");
return false;
}
return anal->iob.write_at (anal->iob.io, addr, buf, len);
}

REsilMemInterface anal_esil_mem_if = {
.mem_switch = anal_esil_mem_switch,
.mem_read = anal_esil_mem_read,
.mem_write = anal_esil_mem_write
};

static bool anal_esil_is_reg (void *user, const char *name) {
RRegItem *ri = r_reg_get (((RAnal *)user)->reg, name, -1);
if (!ri) {
return false;
}
r_unref (ri);
return true;
}

static bool anal_esil_reg_read(void *user, const char *name, ut64 *val) {
RRegItem *ri = r_reg_get (((RAnal *)user)->reg, name, -1);
if (!ri) {
return false;
}
ut64 v = r_reg_get_value (((RAnal *)user)->reg, ri);
if (val) {
*val = v;
}
r_unref (ri);
return true;
}

static bool anal_esil_reg_write (void *user, const char *name, ut64 val) {
return r_reg_setv (((RAnal *)user)->reg, name, val);
}

static ut32 anal_esil_reg_size (void *user, const char *name) {
RRegItem *ri = r_reg_get (((RAnal *)user)->reg, name, -1);
if (!ri) {
return 0;
}
const ut32 size = ri->size;
r_unref (ri);
return size;
}

static REsilRegInterface anal_esil_reg_if = {
.is_reg = anal_esil_is_reg,
.reg_read = anal_esil_reg_read,
.reg_write = anal_esil_reg_write,
.reg_size = anal_esil_reg_size
};
#endif

// Take nullable RArchConfig as argument?
R_API RAnal *r_anal_new(void) {
int i;
Expand Down Expand Up @@ -113,7 +191,13 @@ R_API RAnal *r_anal_new(void) {
anal->sdb_classes_attrs = sdb_ns (anal->sdb_classes, "attrs", 1);
anal->zign_path = strdup ("");
anal->cb_printf = (PrintfCallback) printf;
#if USE_NEW_ESIL
anal_esil_reg_if.user = anal;
anal_esil_mem_if.user = anal;
anal->esil = r_esil_new_ex (4096, 0, 1, &anal_esil_reg_if, &anal_esil_mem_if);
#else
anal->esil = r_esil_new (4096, 0, 1);
#endif
anal->esil->anal = anal;
(void)r_anal_pin_init (anal);
(void)r_anal_xrefs_init (anal);
Expand Down
10 changes: 9 additions & 1 deletion libr/anal/esil_dfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,11 @@ R_API RAnalEsilDFG *r_anal_esil_dfg_new(RAnal* anal, bool use_map_info, bool use
free (dfg);
return NULL;
}
#if USE_NEW_ESIL
dfg->esil = r_esil_new_simple (1, anal->reg, &anal->iob);
#else
dfg->esil = r_esil_new (4096, 0, 1);
#endif
if (!dfg->esil) {
r_reg_free (dfg->reg);
free (dfg);
Expand Down Expand Up @@ -1644,13 +1648,17 @@ R_API void r_anal_esil_dfg_free(RAnalEsilDFG *dfg) {
R_API RAnalEsilDFG *r_anal_esil_dfg_expr(RAnal *anal, RAnalEsilDFG * R_NULLABLE dfg, const char *expr,
bool use_map_info, bool use_maps) {
R_RETURN_VAL_IF_FAIL (anal && expr, NULL);
#if USE_NEW_ESIL
REsil *esil = r_esil_new_simple (1, anal->reg, &anal->iob);
#else
REsil *esil = r_esil_new (4096, 0, 1);
#endif
if (!esil) {
return NULL;
}
esil->anal = anal;

RAnalEsilDFG *edf = dfg ? dfg : r_anal_esil_dfg_new (anal, use_map_info, use_maps);
RAnalEsilDFG *edf = dfg? dfg: r_anal_esil_dfg_new (anal, use_map_info, use_maps);
if (!edf) {
r_esil_free (esil);
return NULL;
Expand Down
Loading
Loading