-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 Thumb: disassembly for BL instruction resolves incorrect immediate value. #1935
Comments
it also seems to affect some unconditional branch instructions, in particular >>> insn = next(cs.disasm(b"\xfe\xe7", 2))
>>> insn
<CsInsn 0x2 [fee7]: b #2> |
also happening with cbz/cbnz >>> next(cs.disasm(b'\x13\xb1', 2))
<CsInsn 0x2 [13b1]: cbz r3, #0xa> expected |
This still seems to be failing. installed via expecting >>> from capstone import *
>>> from capstone.arm_const import *
>>> cs = Cs(CS_ARCH_ARM, CS_MODE_THUMB)
>>> insn = next(cs.disasm(b"\xff\xf7\xad\xff", 4))
>>> insn
<CsInsn 0x4 [fff7adff]: bl #0xffffff62> Mac M1 Pro, MacOS 14.2.1 |
I assume this is because it uses Capstone
In general I would recommend you to use the |
Thanks for the tip, though I still seem to be getting the issue on I'm using a conda virtual environment for python 3.11 with pip installed. $ cd bindings/python
$ sudo make install3 and that should be it? I can confirm that cstool disassembles it correctly. Am I building the bindings wrong or should I actually reopen the issue? |
Have you ran |
I did, yeah. |
Yeah, tried it as well. It is something with the Python bindings. Apologies. We work on better testing. Hope I'll come to it in the next days. |
Got it, thank you very much for your response! Should I open a new issue re:python bindings? |
Nah, just reopen this one, since it wasn't properly resolved. Thanks! |
I don't have permission to reopen... will open a new issue and reference this one (the underlying problem is likely different this time anyways) |
Please do that than. I don't have permission either. |
capstone v4.0.2 installed from pip (Mac OSX 12.6 and Ubuntu 20.04)
It seems like the ARM Thumb
BL
immediate values are being incorrectly decoded.Manually decoding the instruction
b"\xff\xf7\xad\xff"
ought to yieldbl 0xffffff5a
, however, capstone gives the following:I have tried with some other
bl
instructions and the immediate values are also off by 8.The text was updated successfully, but these errors were encountered: