Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bn: use symtab for names #1504

Closed
Tracked by #1445
williballenthin opened this issue Jun 1, 2023 · 3 comments
Closed
Tracked by #1445

bn: use symtab for names #1504

williballenthin opened this issue Jun 1, 2023 · 3 comments
Labels
binary-ninja enhancement New feature or request

Comments

@williballenthin
Copy link
Collaborator

williballenthin commented Jun 1, 2023

implement #1445 for Binary Ninja backend

@xusheng6
Copy link
Contributor

xusheng6 commented Jun 9, 2023

I did an initial investigation on this, and I found that BN is already parsing the info from the symtab section properly. We just need to improve the extractor to provide the most accurate info.

For sample 2bf18d which is used in the unit test, I see BN already names the function at 0x4088a4 __libc_connect.

Screenshot 2023-06-09 at 1 14 30 PM

There are also symbols for connect and __GI_connect at the very same address, but if we call get_symbol_at with that address, only the __libc_connect is returned.

>>> bv.get_symbols_by_name('connect')
[<FunctionSymbol: "connect" @ 0x4088a4>]

>>> bv.get_symbols_by_name('__GI_connect')
[<FunctionSymbol: "__GI_connect" @ 0x4088a4>]

>>> bv.get_symbol_at(0x4088a4)
<FunctionSymbol: "__libc_connect" @ 0x4088a4>

I will checkout our doc and see how we could retrieve the three symbols with that address. I remember we already properly support multiple symbols at the same address.

@williballenthin
Copy link
Collaborator Author

williballenthin commented Jun 9, 2023 via email

@xusheng6
Copy link
Contributor

xusheng6 commented Jun 12, 2023

We have an API get_symbols that allows the user to specify a start and end: https://api.binary.ninja/binaryninja.binaryview-module.html#binaryninja.binaryview.BinaryView.get_symbols. This API can return the multiple APIs at the same address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binary-ninja enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants