Skip to content

Commit

Permalink
Fix issues related with debugging (#1323)
Browse files Browse the repository at this point in the history
* Fix issues related with debugging

* Update pwnlib/tubes/process.py

Co-Authored-By: Arusekk <[email protected]>

* Enable doctest for find_module_addresses

* Experiment about adding doctests to gdb.py

* Add doctests for most functions in gdb.py

* Remove 'file' statement in gdb script

* Encode cyclic alphabet

* Fix travis build

Co-authored-by: Arusekk <[email protected]>
  • Loading branch information
bet4it and Arusekk committed Dec 29, 2019
1 parent c334ceb commit f727b66
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 155 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ addons:
- zsh
- pandoc
- gdb
- socat
- sshpass
- binutils
- qemu-user-static
- binutils-multiarch
Expand Down Expand Up @@ -47,6 +49,7 @@ before_script:
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print(pwnlib.term.term_mode)'
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print(pwnlib.term.term_mode)'
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print(pwnlib.term.term_mode)'
- sudo sh -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"
script:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E9,F63,F7 --show-source --statistics --exclude=android-?dk # TODO: Add F82
Expand Down
2 changes: 2 additions & 0 deletions docs/source/gdb.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.. testsetup:: *

from pwn import *
context.arch = 'amd64'
context.terminal = [os.path.join(os.path.dirname(pwnlib.__file__), 'gdb_faketerminal.py')]

:mod:`pwnlib.gdb` --- Working with GDB
======================================
Expand Down
2 changes: 1 addition & 1 deletion examples/attach.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pwn import *

bash = process('/bin/bash')
gdb.attach(bash, execute = '''
gdb.attach(bash, gdbscript = '''
p "hello from pwnlib"
c
''')
Expand Down
2 changes: 1 addition & 1 deletion examples/remote_gdb_debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pwn import *

s = ssh(getpass.getuser(), '127.0.0.1', port = 22, keyfile = "~/.ssh/id_rsa")
c = gdb.ssh_gdb(s, '/bin/sh', execute = '''
c = gdb.ssh_gdb(s, '/bin/sh', gdbscript = '''
p/x $pc
c''')

Expand Down
Loading

0 comments on commit f727b66

Please sign in to comment.