Pwndbg: Pwndbg new ideas

Created on 6 May 2017  ยท  6Comments  ยท  Source: pwndbg/pwndbg

I know there is lot of work to do, but I like to share a couple of new ideas and get your feedbacks @zachriggle @disconnect3d @anthraxx.

1) In my opinion it will be useful if the command hexdump behaves like the classic gdb command x/200bx. I mean that when we type hexdump 0x804e000 200 we display 200bytes from the address specified ( basically until 0x804e0c8) , but then when I press Enter in the CLI I want to display 200bytes from 0x804e0c8 until 0x804e190. I think this is useful during debugging since I don't have to rewrite manually the address if I need to display more bytes ( it's faster to press enter! ).

2) Why not implementing a pseudo-scripting engine for pwndbg? User can have inside a text file a list of gdb or pwndbg commands and by typing something like pwnscript <scriptname> pwndbg will execute the specified commands. This should resemble something like the scripting engine of Immunity that I found very very useful.

Do you think are they worth being implemented? Any feedback?

feature

Most helpful comment

  1. I like it! Definitely agreed that it's useful.
  2. Use Python โค๏ธ or built-in GDB commands to load gdbscripts (which conveniently can by Python!)

All 6 comments

  1. I like it! Definitely agreed that it's useful.
  2. Use Python โค๏ธ or built-in GDB commands to load gdbscripts (which conveniently can by Python!)
  1. Ok, good! Will look into that. Hey @zachriggle are you against a custom .inputrc? since it seems that is not straightforward as I thought to accomplish this... :worried:
  2. Well, actually...you are right :laughing:

I don't like the idea of a custom inputrc, but if it's simple, maybe?

I don't think we can do this trivially: https://sourceware.org/gdb/onlinedocs/gdb/Command-Syntax.html#Command-Syntax

Only the list and x commands get this special treatment.

It looks like repeated commands do not get logged in the command history. We can just grab the history each command and see if the counter has incremented.

pwndbg> hexdump $rsp 10
+0000 0x7fffffffdb48  30 18 60 f7  ff 7f 00 00  00 00 00 00  00 00 00 00  โ”‚0.`.โ”‚....โ”‚....โ”‚....โ”‚
+0010 0x7fffffffdb58
pwndbg>
+0000 0x7fffffffdb48  30 18 60 f7  ff 7f 00 00  00 00 00 00  00 00 00 00  โ”‚0.`.โ”‚....โ”‚....โ”‚....โ”‚
+0010 0x7fffffffdb58
pwndbg>
+0000 0x7fffffffdb48  30 18 60 f7  ff 7f 00 00  00 00 00 00  00 00 00 00  โ”‚0.`.โ”‚....โ”‚....โ”‚....โ”‚
+0010 0x7fffffffdb58
pwndbg> show com
commands      compile-args  complaints
pwndbg> show com
Ambiguous show command "com": commands, compile-args, complaints.
pwndbg> show commands
   15  show history sie
   16  q
   17  show commands
   18  start
   19  x/10i $pc
   20  show commands
   21  hexdump $esp 10
   22  hexdump $rsp 10
   23  show com
   24  show commands

@degrigis see #272

I was stubbornly searching for a way to do this hooking inputs from keyboard, but I think that the solution in #272 is simpler and effective!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thinkycx picture thinkycx  ยท  6Comments

GrosQuildu picture GrosQuildu  ยท  8Comments

disconnect3d picture disconnect3d  ยท  9Comments

devneal picture devneal  ยท  6Comments

kiror0 picture kiror0  ยท  4Comments