Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aes aets #23952

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions libr/esil/esil_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ static bool trace_hook_reg_read(REsil *esil, const char *name, ut64 *res, int *s
return ret;
}

static bool trace_reg_write(REsil *esil, const char *name, ut64 val) {
// ignore
return true;
}

static bool trace_mem_write(REsil *esil, ut64 addr, const ut8 *buf, int len) {
// ignore
return true;
}

static bool trace_hook_reg_write(REsil *esil, const char *name, ut64 *val) {
bool ret = false;
// eprintf ("[ESIL] REG WRITE %s 0x%08"PFMT64x"\n", name, *val);
Expand Down Expand Up @@ -341,6 +351,8 @@ R_API void r_esil_trace_op(REsil *esil, struct r_anal_op_t *op) {
esil->cb.hook_reg_write = trace_hook_reg_write;
esil->cb.hook_mem_read = trace_hook_mem_read;
esil->cb.hook_mem_write = trace_hook_mem_write;
esil->cb.reg_write = trace_reg_write;
esil->cb.mem_write = trace_mem_write;
/* evaluate esil expression */
const int esil_verbose = esil->verbose;
esil->verbose = 0; // disable verbose logs when tracing
Expand Down
17 changes: 17 additions & 0 deletions test/db/esil/x86_32
Original file line number Diff line number Diff line change
Expand Up @@ -2462,3 +2462,20 @@ esp before :0x00178000
esp after :0x00178000
EOF
RUN

NAME=push ax
FILE=-
ARGS=-a x86 -b 32
CMDS=<<EOF
aeim
aets+
wa push eax
dr?esp
aes
dr?esp
EOF
EXPECT=<<EOF
0x00178000
0x00177ffc
EOF
RUN
Loading