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

Set lr correctly in blx esil on arm #22377

Open
wants to merge 1 commit 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
2 changes: 1 addition & 1 deletion libr/arch/p/arm/plugin_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ static int analop_esil(RArchSession *as, RAnalOp *op, ut64 addr, const ut8 *buf,
break;
case ARM_INS_BL:
case ARM_INS_BLX:
r_strbuf_append (&op->esil, "pc,lr,:=,");
r_strbuf_appendf (&op->esil, "pc,%d,+,lr,:=,", thumb);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r_strbuf_appendf (&op->esil, "pc,%d,+,lr,:=,", thumb);
r_strbuf_appendf (&op->esil, "pc,lr,:=,%d,tf,:=", thumb);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about this solution? its working?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not we should probably considering checking for the thumb flag in the register set which is more correct for esil cnoncepts than using the hacky lower bit thing in the program counter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I got sidetracked from all this and am abroad at the moment so can't do much, but i'll defer to your experience here

/* fallthrough */
case ARM_INS_BX:
case ARM_INS_BXJ:
Expand Down
Loading