Decompiler bitfield support

Hello! I’m doing the analysis of a program that makes have use of bitfields inside C++ structs. The IDA type database supports C++ bitfields inside structure definitions, but the decompiler still can’t output them for cleaner results. It would be great if the decompiler could catch the bitfields inside variables/pointers and use them as fields of any other type.

Thanks.

Is this even planned?

Hello @void_17 ,

Thank you for bringing this to our attention, and apologies for the delayed response.
We heard from other users as well that a lack of bitfield support in the decompiler is quite frustrating. While we have it on our radar as a possible enhancement, I’m afraid we don’t currently have plans to include this feature in upcoming IDA releases.

1 Like

Perhaps this solution could be used in the meantime: JustasMasiulis/ida_bitfields: IDA Pro plugin to make bitfield accesses easier to grep

It’s quite unhandy though, you have to create a union. It also doesn’t work on read/write expressions, only on if statements. So it’s bad even as a temporary solution.