-
Notifications
You must be signed in to change notification settings - Fork 847
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
better display for canary command #2044
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #2044 +/- ##
==========================================
- Coverage 59.70% 59.70% -0.01%
==========================================
Files 191 191
Lines 24407 24430 +23
Branches 2418 2424 +6
==========================================
+ Hits 14572 14585 +13
- Misses 9051 9060 +9
- Partials 784 785 +1 ☔ View full report in Codecov by Sentry. |
@disconnect3d is this roughly what you want? ^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way canary
works now (before this PR) is that it looks for stack canaries everywhere.
With this PR change, canaries would be only searched for on thread stacks. I think that this is not great as this may lead to us missing a canary value in some memory (that we may want to leak somehow).
I think we should change the command so that:
-
canary
searches everywhere and dumps the info as it did before with a better display. It should probably be 3 columns:Stack? | Memory page | Address
. The first column should tell "Thread # 1" if its memory page for stack from thread 1. We probably don't need to usetelescope
here as the addresses contain the stack canary values anyway. -
canary --stacks-only
should limit the search/detection to memory pages from tread stacks.
I am not sure about --all
(?) - if we do limit results, maybe we should allow to filter by memory pages or by number of results. But I think above is probably more useful than this.
I don't quite follow this - https://github.com/pwndbg/pwndbg/pull/2044/files#diff-1aab26f35891063c5e0bf76bc9578b142c1aa57fd9f30c9ccc5c1ba27228f037L44 - isn't this just searching the current thread stack before? |
i made a slightly janky example to show the current behaviour - i copy some stuff from the stack ( including the canary ) into some heap allocations - the canary command doesn't see them it only sees the ones on the stack |
Oh interesting, I thought it was searched everywhere... my bad... Anyway, showing just stacks may be ok in the end, since one can fire a full search if they wanted to and doing a full search ourselves may be painful for the users (may take long time if there are looooots of mappings). |
#1704