-
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
5.0.1 has more broken 'NOREGNAME' syntax on ARM32. #2145
Comments
Are you sure you are testing agains 5.0.1? Because The changes to the constants are in the |
Ah! When I was looking at the header files in github, I was indeed looking at Yes, I am convinced that I am using the 5.0.1 python files. I have started from a clean docker container, installed capstone 5.0.1 and then run my test code, and then displayed the constants from the Here's the operations I performed:
Whether the changed constants are on the branch or not, they're definitely in the 5.0.1 release as downloaded from pip. Unless I did something wrong, but I cannot see where. |
In the prior issue, about the operands I reverted the change you reference, and it seems to have fixed the registers as well. The outptu from my test, having built the tree with d2a39a2 reverted I see:
which is the behaviour I expect. So that would address the issue. It doesn't address the cs_version(), but I'll leave a note on the 5.0.x release suggestions ticket to update it for the release. |
I think this was fixed in #2240 which was just merged. |
@gerph Could you please check again. And if true close the issue. |
@Rot127 Retested on the v5 branch and I now get the same register names as 4.0.0. So this still seems to deal with the issue. I also still see that cs_version still reports (5, 0, 1280), so the current v5 branch is indistinguishable from the 5.0.1 release version, but that's an independant thing |
Summary
I made some changes for 5.0.1 for the CS_OPT_SYNTAX_NOREGNAME which I thought were working, but things have become more broken in 5.0.1
It looks like NOREGNAME produces the same output as DEFAULT.
Example code
This example code prints out the default register form and the 'noregname' form.
Test results for 4.0.2
Test results for 5.0.0
Notice this is all register numbers in the
noregname
case; this was what I tried to make more consistent with 4.0.x.Test results for 5.0.1
Note that the
noregname
case is exactly the same as the default.Expected output
I had hoped that 5.0.1 would be closer to the 4.0.x version. It seems to have gone worse..
Possible reason
I looked at the constants in the Python
capstone/__init__.py
for CS_OPT_SYNTAX and I see a possible problem?On 5.0.0 the constants are:
On 5.0.1 the constants are:
It's likely that this is correct, but the fact that the selection of the syntax has changed its constant values, and the output has stopped working makes me think that it might be related.
If I look at the setter for syntax in 5.0.1, I see:
But for 'skipdata' I see it has this form:
ie it's using
CS_OPT_ON
andCS_OPT_OFF
in the call to change options, whilst the syntax isn't, and incapstone.h
file we see the actual definitions as:The value of
CS_OPT_ON
andCS_OPT_OFF
is 1 and 0 respectively, which makes me think that this was intended to be an OR'd bitfield to control the flags.But I'm guessing here... it seems odd that a patch version update would change the meaning of the constants - that might make it hard in compiled languages that expect to be able to dynamic link with minor versions without an ABI change? Again, I'm guessing that's the case.
The text was updated successfully, but these errors were encountered: