Skip to content

Bitfield pointers don't render correctly #8408

Description

@CouleeApps

Version and Platform (required):

  • Binary Ninja Version: based on 5.4.10248
  • Edition: Ultimate
  • OS: macOS
  • OS Version: 26.6
  • CPU Architecture: arm64

Bug Description:
When a pointer type is rendered as part of a bitfield structure member, the pointer data renderer is not invoked and details like the pointer base is not handled.

Steps To Reproduce:
Please provide all steps required to reproduce the behavior:

  1. Open a new file, enter in bytes 10 00
  2. Create a type with the following signature:
struct struct_1 __packed
{
    void* __ptr16 __based(const, 0x1234) foo : 12;
    int16_t bar : 4;
};
  1. Apply the struct_1 type to the first byte of the binary
  2. Observe the foo member is not rebased as you defined

Expected Behavior:
I expected my pointer base to apply when rendering pointers.

Screenshots/Video Recording:
Image

Additional Information:
This is because StructureMemberLinearViewObject has dedicated behavior for rendering bitfield structure members, and that does not invoke the DataRendererContainer::RenderObjectForData as it does for all other structure members. Even if this were changed, the pointer renderer would need to understand the bitfield length of the member it is rendering, so it does not read the bits shared with other members in the bytes of the rendered member.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions