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

ARM branching bugfix #22156

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 17 additions & 12 deletions libr/arch/p/arm/plugin_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2493,24 +2493,29 @@ static int analop_esil(RArchSession *as, RAnalOp *op, ut64 addr, const ut8 *buf,
case ARM_INS_NOP:
r_strbuf_set (&op->esil, ",");
break;
case ARM_INS_BL:
case ARM_INS_BLX:
r_strbuf_appendf (&op->esil, "1,%s,&,tf,:=", ARG (0));
case ARM_INS_BL:
r_strbuf_append (&op->esil, "pc,lr,:=,");
/* fallthrough */
case ARM_INS_BX:
case ARM_INS_BXJ:
case ARM_INS_B:
if (ISREG (0) && REGID (0) == ARM_REG_PC) {
r_strbuf_appendf (&op->esil, "0x%" PFMT64x ",pc,:=",
(ut64)((addr & ~3LL) + pcdelta));
} else {
if (ISIMM (0)) {
r_strbuf_appendf (&op->esil, "%s,pc,:=", ARG (0));
} else {
r_strbuf_appendf (&op->esil, "%d,%s,-,pc,:=", thumb, ARG (0));
}
}
break;
if (ISREG (0) && REGID (0) == ARM_REG_PC) {
r_strbuf_appendf (&op->esil, "0x%" PFMT64x ",pc,:=",
(ut64)((addr & ~3LL) + pcdelta));
} else {
if (ISIMM (0)) {
r_strbuf_appendf (&op->esil, "%s,pc,:=", ARG (0));
} else {
if (ISIMM (0)) {
r_strbuf_appendf (&op->esil, "%s,pc,:=", ARG (0));
} else {
r_strbuf_appendf (&op->esil, "tf,%s,-,pc,:=", ARG (0));
}
}
}
break;
case ARM_INS_UDF:
r_strbuf_setf (&op->esil, "%s,TRAP", ARG (0));
break;
Expand Down
Loading