Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
927 stars 209 forks source link

"Create All Members For Structure" overrides inherited fields #4540

Closed fuzyll closed 1 year ago

fuzyll commented 1 year ago

From another customer, via email.

Version and Platform (required):

Bug Description: Not sure if it's an expected behavior. See the screenshots. I had a struct with __base() that is inheriting a bunch of fields, and I wanted to create the fields that don't already exist (the __offset* ones). Instead of only creating the fields for the __offset*, it also overrode the fields that already existed.

Screenshots:

Screenshot 2023-07-30 at 10 02 43 Screenshot 2023-07-30 at 10 02 57
xusheng6 commented 1 year ago

test_inherited_struct.bndb.zip

Screenshot 2023-08-02 at 4 33 14 PM

Screenshot 2023-08-02 at 4 32 11 PM

I created a database that can be used to reproduce this issue. Press S on var_38 and we can see all of the fields get redefined, including those inherited from the base class.

Screenshot 2023-08-02 at 4 32 27 PM