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

Make symbol.get bulletproof against duplicated symbols #1610

Closed
disconnect3d opened this issue Mar 6, 2023 · 0 comments
Closed

Make symbol.get bulletproof against duplicated symbols #1610

disconnect3d opened this issue Mar 6, 2023 · 0 comments

Comments

@disconnect3d
Copy link
Member

@lebr0nli pointed out an interesting case with symbol.get failing when Pwntools+Pwndbg is used: #1605 (comment)

The bug actually does not require Pwntools at all and was partially caused by our _add_main_to_symbols hook. I am going to remove that hook in #1609 if tests passes, since it seems reduntant.

However, that does not really fix the problem as there may always be duplicated symbols such that info symbols main would show:

pwndbg> info symbol main
main in section .text of /pwndbg/bug/vaccine
main in section .text of /pwndbg/bug/vaccine

This can probably be mitigated by doing something like:

loc_string, *_ = result.split(...)

instead of:

loc_string, _ = result.split(...)

In the symbol.get implementation.

This would also mean we would effectively always assume the first symbol is the one we want to use, but I also do not see a good other way to resolve the duplicated symbol issue.

@disconnect3d disconnect3d changed the title Make symbol.get bulletproof Make symbol.get bulletproof against duplicated symbols Mar 6, 2023
alufers pushed a commit to alufers/pwndbg that referenced this issue Apr 14, 2023
* Fix pwndbg#1610: symbol.get with duplicated symbols

See pwndbg#1610

* fix ubuntu 18.04 build

* fix ubuntu 18.04 build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant