You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support C++ inheritance syntax in type parser #7228
The field b is at the correct offset (4 instead of 0), but the space where the superclass field should be is just blank.
Expected Behavior:
I realize that this is the 'wrong' inheritance syntax and Binary Ninja has its own syntax. Sure enough, if I add __base(foo, 0) before bar, then things work as expected.
However, it's confusing to accept C++ syntax but only partially. Binary Ninja should either give a warning, or, better, just add the proper inheritance relationship in this case.
For one thing, this would be useful when importing actual C++ headers.
In my particular case, though, the header I was trying to import was not real C++ code but rather an export from IDA. Here too, it would be nice if the import would 'just work', for the sake of better interoperability between reverse engineering tools. Admittedly, fixing the inheritance issue wouldn't solve IDA header import as there were some other manual fixups required, but most of those are trivial (custom keywords like _DWORD)… I should file a separate issue about those. If you're wondering why I didn't just use the IDB importer, I tried it and unfortunately it was completely broken (making for another issue I should file).
This is a known limitation of our support for parsing C++ as of now. It would probably be simple to handle single direct inheritance, but supporting broader C++ concepts like multiple or virtual inheritance is likely to be a significant task.
I have unfinished code from 2022 attempting to add this for simple cases. It may be worth dusting off and seeing if it can be merged.
changed the title [-]Confusing behavior when importing header file using C++ inheritance syntax[/-][+]Support C++ inheritance syntax in type parser[/+]on Aug 13, 2025
Activity
CouleeApps commentedon Aug 13, 2025
This is a known limitation of our support for parsing C++ as of now. It would probably be simple to handle single direct inheritance, but supporting broader C++ concepts like multiple or virtual inheritance is likely to be a significant task.
I have unfinished code from 2022 attempting to add this for simple cases. It may be worth dusting off and seeing if it can be merged.
[-]Confusing behavior when importing header file using C++ inheritance syntax[/-][+]Support C++ inheritance syntax in type parser[/+]CouleeApps commentedon Aug 13, 2025
CC https://github.com/Vector35/binaryninja/commit/92ed9fd72ad2bd6dc9c609689f5f362aefc276f9