binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Can not use new platform types in older BNDB

Open op2786 opened this issue 2 years ago • 1 comments

Version and Platform (required):

  • Binary Ninja Version: 3.6.4707-dev Personal, 3cd0ac3b
  • OS: macos
  • OS Version: 14.1
  • CPU Architecture: arm64

Bug Description: I've a BNDB that I created with older version of BN. A function in that BNDB uses struct DOS_Header* as a second parameter type. When I noticed IMAGE_DOS_HEADER structure is included in platform types I want to use that standart structure instead of DOS_Header. But BN can not use that type instead it states that "a type specifier is required for all declarations".

I guess this is the same BNDB with issue #4168. So anyone wants BNDB can search "16260762028509746446" in slack for BNDB.

Screenshots:

op2786 avatar Dec 07 '23 10:12 op2786

Currently the way platform types work is they're all imported directly into the BNDB. On BNDB reload the current set of platform types aren't imported as they could overwrite things causing problems.

We need a mechanism where if platform types change then the user can choose to override the platform types which have been imported into the current binary.

Cases to consider:

  • automatic importing if those types aren't actually used.
  • partial importing
  • interactive importing

plafosse avatar Apr 01 '24 17:04 plafosse

After further review, we don' think this is something we can (or should) solve automatically with our current architecture.

However, there is an existing work-around that can solve this particular problem:

If you run into this issue, all that's required is to create a new database with the updated platform and use the "Import from BNDB..." command-palette or menu option on the old database and load the types from the newer BNDB. This will allow you to overwrite older types or missing types with newer platform types from the updated database.

psifertex avatar Jul 26 '24 19:07 psifertex