TBone
July 24th, 2006, 13:06
I have a "bit" of a problem with IDA (please don't shoot me for the bad pun! :devil
.
I'm working on a dissassembly of an old 16-bit game, in which I have a structure that contains 10 members in a row of the same bitfield type. If the value is non-zero, the bitfield indicates the allowable types of items that can be placed in that slot. If the value is 0, it indicates that the slot can't be used at all. For this reason, I'd like to be able to display a name like "UNUSABLE" when the value of this member is zero.
Newer versions of IDA allow you to define names for zero values within a mask, but in this case, I would need for the mask to span all the bits (0xFFFF). This conflicts with any other defined masks in the field because IDA doesn't allow intersecting masks. Ordinarily, this is quite a sane policy. But unfortunately, it makes it impossible to handle the case of a completely empty bitfield. I mean, you *could* use a mask of 0xFFFF for everything, but that would be stupid and pointless.
I could live with IDA just displaying "0" for the value instead of a nice label, but unfortunately IDA also highlights the value in red because it couldn't find a matching name in the enum for that value. Maybe I'm being too picky, but that drives me nuts. I could make it work with a flat enum type instead of a bitfield, but there are a lot of combinations I'd have to define, and it's just an ugly way of doing it, besides.
Does anyone know of a workaround for this?

I'm working on a dissassembly of an old 16-bit game, in which I have a structure that contains 10 members in a row of the same bitfield type. If the value is non-zero, the bitfield indicates the allowable types of items that can be placed in that slot. If the value is 0, it indicates that the slot can't be used at all. For this reason, I'd like to be able to display a name like "UNUSABLE" when the value of this member is zero.
Newer versions of IDA allow you to define names for zero values within a mask, but in this case, I would need for the mask to span all the bits (0xFFFF). This conflicts with any other defined masks in the field because IDA doesn't allow intersecting masks. Ordinarily, this is quite a sane policy. But unfortunately, it makes it impossible to handle the case of a completely empty bitfield. I mean, you *could* use a mask of 0xFFFF for everything, but that would be stupid and pointless.
I could live with IDA just displaying "0" for the value instead of a nice label, but unfortunately IDA also highlights the value in red because it couldn't find a matching name in the enum for that value. Maybe I'm being too picky, but that drives me nuts. I could make it work with a flat enum type instead of a bitfield, but there are a lot of combinations I'd have to define, and it's just an ugly way of doing it, besides.
Does anyone know of a workaround for this?