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

[docs] Improve 'Finding System Headers' examples for C++

Open 0xdevalias opened this issue 1 year ago • 0 comments

Is this a general concept that needs to be documented or a specific API?

General

What concept or API needs more documentation?

In the 'Importing Type Information' docs:

  • https://docs.binary.ninja/guide/types/typeimportexport.html#import-header-file

The 'Import Header File' section mentions:

-x c -std=c99 to specify C99 mode

It might also be useful to include something for C++ mode such as:

-x c++ -std=c++14 to specify C++14 mode

Then in the 'Finding System Headers' section it provides commands for listing the system paths, but these seem to be specifically for C:

gcc -Wp,-v -E -
clang -Wp,-v -E -

It might be useful to also explicitly mention how to do the same for C++ here as well:

gcc -Wp,-v -x c++ -E -
clang -Wp,-v -x c++ -E -

The only section that seems to currently explicitly mention anything about C++ is in the Windows section:

  • https://docs.binary.ninja/guide/types/typeimportexport.html#for-windows

You also want to include -x c -std=c99 since Windows headers include lots of C++ types that the type importer currently does not support.

It might be useful to have this information somewhere 'higher up' in a more 'general' section, as it was only by accident that I noticed this (since I am working on a macOS binary)

Is this documentation related to a specific API?

N/A

Are there any known examples of people using this API/concept?

This tweet thread has some context where I was originally asking how to make it work, and then eventually figured out a way to do so:

  • https://twitter.com/_devalias/status/1777575161426006375

Semi-related:

  • https://github.com/Vector35/binaryninja-api/issues/5257

0xdevalias avatar Apr 11 '24 00:04 0xdevalias