mambo icon indicating copy to clipboard operation
mambo copied to clipboard

Incorrect pcrel address calculation in Thumb

Open asLody opened this issue 6 years ago • 3 comments

All of the: ((uint32_t)read_address) + 2 + 1 should be: ALIGN_DOWN(read_address, 4)

asLody avatar Jan 10 '19 15:01 asLody

Generally, no. Care to expand on that?

lgeek avatar Jan 10 '19 15:01 lgeek

Sorry, I find that the alignment has been processed in get_origin_pc :) In addition, I found that mambo seemed to be working incorrectly with ldr.w pc, [pc, #4], which was resolved to THUMB_LDRL32, whereas in this case, rdn = pc, assert(rdn! = pc) will be triggered.

asLody avatar Jan 11 '19 05:01 asLody

That's not incorrect, it's just not implemented because we've never encountered it in an application. If you did and you could point me to the executable, I can add support for that instruction.

lgeek avatar Jan 11 '19 16:01 lgeek

Since it's an old issue and I have no way of testing it at the moment, I'm going to close it in the effort to clean up the repo. If anyone still requires this fix, please re-open the issue and I can look into it.

IgWod avatar Feb 07 '24 16:02 IgWod