Merge remote-tracking branch 'origin/master'

pull/14/head
Zach Riggle 11 years ago
commit 2486c54f55

@ -1,3 +1,8 @@
# BETA SOFTWARE
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 # pwndbg
@ -12,7 +17,7 @@ Best supported on Ubuntu 14.04 with default `gdb` or `gdb-multiarch` (e.g. with
## Installation ## Installation
1. Clone the repo: `git clone https://github.com/zachriggle/pwndbg` 1. Clone the repo: `git clone https://github.com/zachriggle/pwndbg`
2. Add to `~/.gdbinit`: `source ~/pwndbg/gdbinit.py` 2. Add to `~/.gdbinit`: `echo "source $PWD/pwndbg/gdbinit.py" >> ~/.gdbinit`
### Prerequisites ### Prerequisites
@ -21,8 +26,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. Currently this is only available via a source build.
1. Clone the repo: `git clone https://github.com/aquynh/capstone` 1. Clone the repo: `git clone https://github.com/aquynh/capstone`
2. Select the `next` branch: `git checkout -t origin/next` 2. Select the `next` branch: `cd capstone && git checkout -t origin/next`
3. Build and install libcapstone: `sudo make.sh install` 3. Build and install libcapstone: `sudo ./make.sh install`
4. Build and install Python bindings: `cd bindings/python && python setup.py install` 4. Build and install Python bindings: `cd bindings/python && python setup.py install`
#### pycparser #### pycparser

@ -54,17 +54,18 @@ def update():
for its stack. for its stack.
""" """
curr_thread = gdb.selected_thread() curr_thread = gdb.selected_thread()
try: try:
for thread in gdb.selected_inferior().threads(): for thread in gdb.selected_inferior().threads():
thread.switch() thread.switch()
sp = pwndbg.regs.sp sp = pwndbg.regs.sp
sp_low = sp & ~(0xfff)
# If we don't already know about this thread, create # If we don't already know about this thread, create
# a new Page mapping for it. # a new Page mapping for it.
page = stacks.get(thread.ptid, None) page = stacks.get(thread.ptid, None)
if page is None: if page is None:
start = pwndbg.memory.find_lower_boundary(sp) start = sp_low
stop = find_upper_stack_boundary(sp) stop = find_upper_stack_boundary(sp)
page = pwndbg.memory.Page(start, stop-start, 6 if not is_executable() else 7, 0, '[stack]') page = pwndbg.memory.Page(start, stop-start, 6 if not is_executable() else 7, 0, '[stack]')
stacks[thread.ptid] = page stacks[thread.ptid] = page
@ -73,8 +74,8 @@ def update():
page.objfile = '[stack]' page.objfile = '[stack]'
# If we *DO* already know about this thread, just # If we *DO* already know about this thread, just
# update the lower boundary. # update the lower boundary if it got any lower.
low = pwndbg.memory.find_lower_boundary(page.vaddr) low = min(page.vaddr, sp_low)
if low != page.vaddr: if low != page.vaddr:
page.memsz += (page.vaddr - low) page.memsz += (page.vaddr - low)
page.vaddr = low page.vaddr = low

Loading…
Cancel
Save