9ee1 / Capstone.NET

.NET Core and .NET Framework binding for the Capstone Disassembly Framework
MIT License
134 stars 31 forks source link

ARM: ArmInstructionDetail.AllReadRegisters Missing Some Registers on Version >= 2.1.0 #39

Open huyquocdo opened 1 year ago

huyquocdo commented 1 year ago

I found an issue when using Capstone.NET 2.3.0 to disassembly following ARM v7R instruction: 0x000028e0: e9 2d 10 00 stmdb sp!, {ip} The register IP is not added into AllReadRegisters, only SP is added. The issue does not appear in the earlier version Capstone.NET 2.0.2: both registers are added. Is it a bug, or is there any change in the interface/semantics of AllReadRegisters? Thank you very much.

9ee1 commented 1 year ago

Hello. Thanks for reporting this. I confirm this behavior, but I am pretty sure it is an underlying issue with the native Capstone library. I have created an issue there for your reference. I will keep this issue open until I hear back from them but if they confirm the issue, it will have to be fixed in the native library.

Capstone.NET 2.0.2 packaged Capstone 4.0.1. Starting with Capstone.NET 2.1.0, Capstone 4.0.2 is packaged. I think this issue was introduced in Capstone 4.0.2 and that is why you will see it with any version of Capstone.NET >= 2.1.0.

huyquocdo commented 1 year ago

It seems that the bug has been fixed by Capstone 5. Could you please give a hint when Capstone 5 can be packaged by Capstone.NET?

9ee1 commented 11 months ago

Hello. It looks like Capstone 5 was released back in July. I was working on a small PR to organize the code a little bit and then I can work on updating the P/Invoke definitions and structures to support Capstone 5. It shouldn't be a lot of work but I don't want to promise you a deadline until I have a chance to better assess.

Thanks for your patience.