capstone
capstone copied to clipboard
New cs_reg_is_subreg API
This adds a new public API in order to check if a register is a sub-register of another one: bool CAPSTONE_API cs_reg_is_subreg(csh ud, unsigned int reg_a, unsigned int reg_b)
For instance, cs_reg_is_subreg(csh, X86_REG_EAX, X86_REG_AH) will return true.
I had to add new fields to cs_struct in order to convert between public & private registers. This is needed especially for x86 where Capstone's public register enum doesn't match LLVM's one anymore (on Capstone next
branch). An existing function does the conversion between public and private register IDs via a table, so I added the reverse table and function.
Can you please create a new PR on libcapstone?
@pranith Is libcapstone an unofficial fork? I submitted this PR to the official repo hoping that I won't have to maintain my own fork, and still get upstream patches. I don't think submitting it to yet another unofficial fork isn't going to help much. But feel free to clone this PR to your repo and mention this one.
Any reason not to merge this despite the conflicts?
I think this API is not essential.
On Wed, Oct 12, 2022, 18:10 pancake @.***> wrote:
Any reason not to merge this despite the conflicts?
— Reply to this email directly, view it on GitHub https://github.com/capstone-engine/capstone/pull/1665#issuecomment-1275922232, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNQNYDM646XDWVO7L44QVLWC2FAXANCNFSM4O6OUTGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Thank you for the PR! I closed it because it is out of date. With the new auto-sync update for v6 we made many changes to some main architectures and will do also to others. This also changed the requirements we have now for new PRs.
If you still want to merge the changes, please rebase your fix onto the newest next
branch and open a new PR.