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

Fix plt and gotplt commands #1576

Merged
merged 8 commits into from Feb 20, 2023
Merged

Fix plt and gotplt commands #1576

merged 8 commits into from Feb 20, 2023

Conversation

disconnect3d
Copy link
Member

@disconnect3d disconnect3d commented Feb 10, 2023

This fixes:

  • plt, gotplt and got commands on both PIE and non-PIE binaries
  • it fixes got command on PIE binaries which had the binary executable memory page not being the first binary vmmap page
  • fixes pwndbg.gdblib.symbol.get(...) for low addresses when binary hasn't been started yet and the symbols are not rebased yet by GDB

and adds some tests for plt/gotplt/got.

I also compile a reference pie & non-pie binary via zig so that we get a more reproducible build of the binary across different distros, at least hopefully :P

@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2023

Codecov Report

Merging #1576 (0d55ed0) into dev (e5fbefc) will increase coverage by 0.50%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##              dev    #1576      +/-   ##
==========================================
+ Coverage   58.32%   58.83%   +0.50%     
==========================================
  Files         169      171       +2     
  Lines       20343    20749     +406     
  Branches     1832     1944     +112     
==========================================
+ Hits        11865    12207     +342     
- Misses       7901     7960      +59     
- Partials      577      582       +5     
Impacted Files Coverage Δ
gdbinit.py 40.32% <100.00%> (+4.11%) ⬆️
pwndbg/commands/elf.py 100.00% <100.00%> (+8.62%) ⬆️
pwndbg/commands/got.py 86.84% <100.00%> (+13.15%) ⬆️
pwndbg/gdblib/proc.py 85.89% <100.00%> (+7.63%) ⬆️
pwndbg/gdblib/symbol.py 57.62% <100.00%> (-0.71%) ⬇️
pwndbg/gdblib/stack.py 76.47% <0.00%> (-4.42%) ⬇️
pwndbg/commands/rizin.py 72.09% <0.00%> (ø)
pwndbg/rizin.py 50.00% <0.00%> (ø)
pwndbg/commands/__init__.py 75.60% <0.00%> (+0.06%) ⬆️
pwndbg/exception.py 64.38% <0.00%> (+0.55%) ⬆️
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@disconnect3d disconnect3d merged commit ee832c8 into dev Feb 20, 2023
@disconnect3d disconnect3d deleted the fix-plt-gotplt-commands branch February 20, 2023 17:49
alufers pushed a commit to alufers/pwndbg that referenced this pull request Apr 14, 2023
* Fix plt and gotplt commands

* Add plt gotplt commands tests

* Fix got and plt commands and test them

* Revert accidental change

* Extend system path

* Hopefully fix PATH problems once and for all?

* fix import

* remove redundant part
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants