-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
base: master
Are you sure you want to change the base?
Conversation
Uhm is your branch based on master? |
oops nope. 5.8.8, will rebase |
04305fb
to
fc984e3
Compare
i think the problem is that the program counter results in an unaligned address,and the proper behaviour here would be to remove the lower bit and set the thumb mode flag instead |
This and the issue may have been a misunderstanding, I've updated to a build from master and some things have changed or been solved already; issue I'm trying to solve now is -
where the instruction's esil is:
Stepping over again, behaves as expected, though. Is this expected? Naturally I can make this go away with |
Sorry for the late response. kinda busy irl :( let me try to give you a proper response here. It's been a while since i really do some thumb/arm binary analysis, and i think it's been always a pending task to be addressed.. and maybe it's the time to do so if you are in the mood to discuss and test things. I'm not sure the way it works right now, or how it should be working, but basically the way that ARM switches between thumb and arm modes is depending on the lower bit of the program counter which maps to the thumb bit of the cpsr register. So, i see different things there that must be clarified before moving further.
|
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r_strbuf_appendf (&op->esil, "pc,%d,+,lr,:=,", thumb); | |
r_strbuf_appendf (&op->esil, "pc,lr,:=,%d,tf,:=", thumb); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Description
see #22373