From cbdbb3aaff3bcfe86afa084efba584078e8f0e45 Mon Sep 17 00:00:00 2001 From: Grazfather Date: Thu, 14 May 2015 12:00:55 -0700 Subject: [PATCH 1/5] Improve installation instructions --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ddb40655c..9f5f2fb29 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Best supported on Ubuntu 14.04 with default `gdb` or `gdb-multiarch` (e.g. with ## Installation 1. Clone the repo: `git clone https://github.com/zachriggle/pwndbg` -2. Add to `~/.gdbinit`: `source ~/pwndbg/gdbinit.py` +2. Add to `~/.gdbinit`: `cd pwndbg && echo "source $PWD/gdbinit.py" >> ~/.gdbinit` ### Prerequisites @@ -21,8 +21,8 @@ Best supported on Ubuntu 14.04 with default `gdb` or `gdb-multiarch` (e.g. with Currently this is only available via a source build. 1. Clone the repo: `git clone https://github.com/aquynh/capstone` -2. Select the `next` branch: `git checkout -t origin/next` -3. Build and install libcapstone: `sudo make.sh install` +2. Select the `next` branch: `cd capstone && git checkout -t origin/next` +3. Build and install libcapstone: `sudo ./make.sh install` 4. Build and install Python bindings: `cd bindings/python && python setup.py install` #### pycparser From 15fdd040c6a0abf05d930491a7fffebe72bd42ed Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Thu, 14 May 2015 16:50:53 -0400 Subject: [PATCH 2/5] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index ddb40655c..75f594f3e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +# BETA SOFTWARE + +This is barely a beta. If anything works at all, consider yourself lucky. # pwndbg From 2dc4254190fa2e4d13b3d140ba38312cd61879e9 Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Thu, 14 May 2015 16:51:57 -0400 Subject: [PATCH 3/5] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75f594f3e..8ee4c4dea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # BETA SOFTWARE -This is barely a beta. If anything works at all, consider yourself lucky. +This is barely a beta. There are currently no versioned releases, only `master`. I push to master with impunity. There are no tests. If anything works at all, consider yourself lucky. + +Feature contributions and bugfixes are both very welcome :) # pwndbg From b2ffa2545c01ee2c16bd7e004fa31970b0a3288e Mon Sep 17 00:00:00 2001 From: Grazfather Date: Thu, 14 May 2015 15:18:34 -0700 Subject: [PATCH 4/5] README: Don't bother cd-ing on install --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f5f2fb29..7485a3dfa 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Best supported on Ubuntu 14.04 with default `gdb` or `gdb-multiarch` (e.g. with ## Installation 1. Clone the repo: `git clone https://github.com/zachriggle/pwndbg` -2. Add to `~/.gdbinit`: `cd pwndbg && echo "source $PWD/gdbinit.py" >> ~/.gdbinit` +2. Add to `~/.gdbinit`: `echo "source $PWD/pwndbg/gdbinit.py" >> ~/.gdbinit` ### Prerequisites From add3acba1533be5586ec10dc080dd60eed0a1955 Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Sat, 16 May 2015 03:25:21 -0400 Subject: [PATCH 5/5] Don't infinitely decrement ESP; theres always more memory --- pwndbg/stack.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pwndbg/stack.py b/pwndbg/stack.py index 57787e185..9a59a0f57 100644 --- a/pwndbg/stack.py +++ b/pwndbg/stack.py @@ -54,17 +54,18 @@ def update(): for its stack. """ curr_thread = gdb.selected_thread() - try: for thread in gdb.selected_inferior().threads(): thread.switch() sp = pwndbg.regs.sp + sp_low = sp & ~(0xfff) + # If we don't already know about this thread, create # a new Page mapping for it. page = stacks.get(thread.ptid, None) if page is None: - start = pwndbg.memory.find_lower_boundary(sp) + start = sp_low stop = find_upper_stack_boundary(sp) page = pwndbg.memory.Page(start, stop-start, 6 if not is_executable() else 7, 0, '[stack]') stacks[thread.ptid] = page @@ -73,8 +74,8 @@ def update(): page.objfile = '[stack]' # If we *DO* already know about this thread, just - # update the lower boundary. - low = pwndbg.memory.find_lower_boundary(page.vaddr) + # update the lower boundary if it got any lower. + low = min(page.vaddr, sp_low) if low != page.vaddr: page.memsz += (page.vaddr - low) page.vaddr = low