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

Add stepuntilasm command #1798

Merged
merged 6 commits into from
Jul 18, 2023
Merged

Add stepuntilasm command #1798

merged 6 commits into from
Jul 18, 2023

Conversation

mbrla0
Copy link
Contributor

@mbrla0 mbrla0 commented Jul 14, 2023

Fixes #1264.

This change adds a stepuntilasm command that, given a mnemonic and, optionally, a set of operands, will step until a instruction that matches both is found. Matching is string-based, as the user will likely want to spell out the asm directive they want as text, and interpreting assembly language conventions for all of the platforms pwndbg supports is probably outside the scope of this change.

There is a caveat to this implementation in that it can be fairly slow to step over loops, as execution has to be stopped at every branch instruction, but I don't believe there's much that can be done about that.

Copy link
Member

@disconnect3d disconnect3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

This commit adds a `stepuntilasm` command that, given a mnemonic and,
optionally, a set of operands, will step until a instruction that
matches both is found. Matching is string-based, as the user will likely
want to spell out the asm directive they want as text, and interpreting
assembly language conventions for all of the platforms pwndbg supports
is probably outside the scope of this change.
@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2023

Codecov Report

Merging #1798 (c0abee5) into dev (a676ce6) will increase coverage by 0.06%.
The diff coverage is 77.10%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##              dev    #1798      +/-   ##
==========================================
+ Coverage   60.39%   60.45%   +0.06%     
==========================================
  Files         177      177              
  Lines       21451    21588     +137     
  Branches     1931     1974      +43     
==========================================
+ Hits        12955    13052      +97     
- Misses       7853     7889      +36     
- Partials      643      647       +4     
Impacted Files Coverage Δ
gdbinit.py 0.00% <0.00%> (-40.33%) ⬇️
pwndbg/commands/spray.py 35.48% <26.08%> (-9.52%) ⬇️
pwndbg/gdblib/next.py 69.59% <71.15%> (+0.59%) ⬆️
pwndbg/gdblib/info.py 72.72% <88.23%> (+6.93%) ⬆️
pwndbg/commands/got.py 93.68% <92.10%> (+7.19%) ⬆️
pwndbg/commands/checksec.py 100.00% <100.00%> (ø)
pwndbg/commands/next.py 87.50% <100.00%> (+2.04%) ⬆️
pwndbg/glibc.py 77.57% <100.00%> (-0.62%) ⬇️
pwndbg/wrappers/checksec.py 79.41% <100.00%> (+5.12%) ⬆️
pwndbg/wrappers/readelf.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@mbrla0 mbrla0 requested a review from disconnect3d July 17, 2023 17:53
@gsingh93 gsingh93 modified the milestone: 2023.10 Jul 17, 2023
@disconnect3d disconnect3d merged commit 29fea60 into pwndbg:dev Jul 18, 2023
11 checks passed
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.

Add a stepuntilasm command
4 participants