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 Command.repeat property for repeated commands #272

Merged
merged 2 commits into from May 10, 2017

Conversation

zachriggle
Copy link
Contributor

See #265 for more information

This allows a pwndbg.commands.Command object to see if its invocation was from the user just hitting enter again without any input. This may be useful to e.g. continue dumping hexdump information from the last address printed.

This doesn't automate the process of doing that, it just allows a command object to determine if it has been repeated.

An example of how to implement this was added to the hexdump command. Repeated command invocation how looks like this:

pwndbg> hexdump $rsp 0x20
+0000 0x7fffffffdb38  30 18 60 f7  ff 7f 00 00  00 00 00 00  00 00 00 00  │0.`.│....│....│....│
+0010 0x7fffffffdb48  18 dc ff ff  ff 7f 00 00  00 00 00 00  01 00 00 00  │....│....│....│....│
+0020 0x7fffffffdb58
pwndbg>
+0000 0x7fffffffdb58  d0 ee 41 00  00 00 00 00  00 00 00 00  00 00 00 00  │..A.│....│....│....│
+0010 0x7fffffffdb68  23 ff 3e ed  14 92 d9 c6  60 05 42 00  00 00 00 00  │#.>.│....│`.B.│....│
+0020 0x7fffffffdb78
pwndbg>
+0000 0x7fffffffdb78  10 dc ff ff  ff 7f 00 00  00 00 00 00  00 00 00 00  │....│....│....│....│
+0010 0x7fffffffdb88  00 00 00 00  00 00 00 00  23 ff de 19  7c 6d 26 39  │....│....│#...│|m&9│
+0020 0x7fffffffdb98

The output now looks like:

    pwndbg> hexdump $rsp 0x20
    +0000 0x7fffffffdb38  30 18 60 f7  ff 7f 00 00  00 00 00 00  00 00 00 00  │0.`.│....│....│....│
    +0010 0x7fffffffdb48  18 dc ff ff  ff 7f 00 00  00 00 00 00  01 00 00 00  │....│....│....│....│
    +0020 0x7fffffffdb58
    pwndbg>
    +0000 0x7fffffffdb58  d0 ee 41 00  00 00 00 00  00 00 00 00  00 00 00 00  │..A.│....│....│....│
    +0010 0x7fffffffdb68  23 ff 3e ed  14 92 d9 c6  60 05 42 00  00 00 00 00  │#.>.│....│`.B.│....│
    +0020 0x7fffffffdb78
    pwndbg>
    +0000 0x7fffffffdb78  10 dc ff ff  ff 7f 00 00  00 00 00 00  00 00 00 00  │....│....│....│....│
    +0010 0x7fffffffdb88  00 00 00 00  00 00 00 00  23 ff de 19  7c 6d 26 39  │....│....│#...│|m&9│
    +0020 0x7fffffffdb98
@zachriggle zachriggle added the enhancement For enhancements to existing features label May 10, 2017
@zachriggle zachriggle added this to the Someday milestone May 10, 2017
@zachriggle zachriggle self-assigned this May 10, 2017
@zachriggle zachriggle mentioned this pull request May 10, 2017
@zachriggle zachriggle merged commit 5861c6a into pwndbg:dev May 10, 2017
disconnect3d added a commit to disconnect3d/pwndbg that referenced this pull request Jul 29, 2018
* beta:
  Merge dev to beta (pwndbg#506)
  Better exception msg (pwndbg#300)
  handle window resize event and set width accordingly (pwndbg#291)
  Remove pwndbg/linkmap.py and malloc.py (pwndbg#303)
  Fix got command (pwndbg#306)
  Fire isort so travis won't complain (pwndbg#302)
  extend next_call to take optional symbol/target to break on (pwndbg#290)
  got command: possibility to filter results (pwndbg#284)
  ROPGadget: return when not installed (pwndbg#283)
  Fix parsed commands (pwndbg#282)
  added command 'got' to display status of the GOT table (pwndbg#256)
  Clean up some unnecessary closures in pwndbg.commands (pwndbg#278)
  Fix missing exception in pwndbg/exception.py (pwndbg#277)
  Fix input issue after screen resize: pagination off (pwndbg#276)
  Simplify command exception debugging and make stdio work correctly (pwndbg#251)
  Add Command.repeat property for repeated commands (pwndbg#272)
  support for multiple arenas (pwndbg#262)
  Fix Python2 long types and inthook (pwndbg#250)
  fixed GDB remote get command (pwndbg#241)
  Add CONTRIBUTING and ISSUE_TEMPLATE (pwndbg#238)
@gsingh93 gsingh93 removed this from the Someday milestone May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For enhancements to existing features
Development

Successfully merging this pull request may close these issues.

None yet

2 participants