Skip to content

search --asm: set breakpoint on found instructions#2103

Merged
disconnect3d merged 4 commits into
pwndbg:devfrom
TheLazron:breakpoint-asm-search-result
Apr 9, 2024
Merged

search --asm: set breakpoint on found instructions#2103
disconnect3d merged 4 commits into
pwndbg:devfrom
TheLazron:breakpoint-asm-search-result

Conversation

@TheLazron

Copy link
Copy Markdown
Contributor

#2084
--asmbp flag to breakpoint found --asm instructions
ss

@codecov

codecov Bot commented Mar 28, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 59.70%. Comparing base (66740fc) to head (ebc55df).
Report is 2 commits behind head on dev.

❗ Current head ebc55df differs from pull request most recent head ca6708a. Consider uploading reports for the commit ca6708a to get more accurate results

Files Patch % Lines
pwndbg/commands/search.py 42.85% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2103      +/-   ##
==========================================
- Coverage   59.70%   59.70%   -0.01%     
==========================================
  Files         191      191              
  Lines       24407    24392      -15     
  Branches     2418     2419       +1     
==========================================
- Hits        14572    14563       -9     
+ Misses       9051     9044       -7     
- Partials      784      785       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheLazron TheLazron marked this pull request as ready for review March 29, 2024 10:19
Comment thread pwndbg/commands/search.py Outdated
if save:
saved.add(address)
if type == "asm" and asmbp:
ins = pwndbg.disasm.one(address)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need to disasm it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh sorry I overlooked the redundancy while making changes

@disconnect3d disconnect3d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we do it so it can be specified without --asm? Just --asmbp?

Ideally, it would be nice if it worked with specifying both --asm --asmbp and with specifying only --asmbp flag.

(So that if someone hits 'arrow up' and just adds --asmbp it should work; but if someone just specifies only --asmbp it should also work)

@TheLazron

Copy link
Copy Markdown
Contributor Author

Ideally, it would be nice if it worked with specifying both --asm --asmbp and with specifying only --asmbp flag.

--asmbp now can be used as an independent flag to search for asm instructions and then setting a breakpoint and also works with asm

changes

Comment thread pwndbg/commands/search.py Outdated

@disconnect3d disconnect3d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should set up a standard breakpoint and let user delete it if they do not want it.

I made a change for this. Going to merge when CI passes.

PS: If u can, pls send another PR implementing tests for this :)

@TheLazron

Copy link
Copy Markdown
Contributor Author

PS: If u can, pls send another PR implementing tests for this :)

Sure! on it

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.

2 participants