capstone-rs icon indicating copy to clipboard operation
capstone-rs copied to clipboard

ArmOperand "access" member of type Option<RegAccessType> is missing

Open flipnut opened this issue 4 years ago • 2 comments

Capstone's C types cs_arm_op and cs_x86_op etc. have a member uint8_t access, that provides info about the operand being read or written to by the instruction. In the rust world, the related struct X86Operand has the member pub access: Option<RegAccessType>,. Howevery, for ArmOperand the member is missing.

Unfortunately, I am not familiar with the semi-automated translation process of c types to rust types in capstone-rust. With some guidance I am happy to help where I can to get this fixed.

flipnut avatar Apr 29 '21 19:04 flipnut

Has there been any progress on this issue?

enjhnsn2 avatar Jul 16 '21 15:07 enjhnsn2

Sorry for the late reply. The Rust types are "bespoke" and written by hand. :sweat_smile:

If you are interested in contributing the feature, take a look at RegAccessType and the use for X86:

  • RegAccessType in capstone-rs/src/instruction.rs: https://github.com/capstone-rust/capstone-rs/blob/cb4cc5e7e3e3b0d1e88265a650a920392b8d5ab5/capstone-rs/src/instruction.rs#L42
  • impl TryFrom<cs_ac_type> for RegAccessType: https://github.com/capstone-rust/capstone-rs/blob/cb4cc5e7e3e3b0d1e88265a650a920392b8d5ab5/capstone-rs/src/instruction.rs#L71
  • X86 implementation for RegAccessType https://github.com/capstone-rust/capstone-rs/blob/cb4cc5e7e3e3b0d1e88265a650a920392b8d5ab5/capstone-rs/src/arch/x86.rs#L52

You will also need to update the tests in capstone-rs/src/test.rs.

Let me know if you have any questions.

tmfink avatar Jul 30 '21 19:07 tmfink