Improve pwnup template, gdbserver detection (#1148)

* Improve pwnup template

* Don't want to break at main again if its been hit already

* Always start the program

* Handle extra newline printed by gdb

* Remove moved recvline

* Remove controversial set sysroot

* Update gdb.py

* Update pwnup.mako
This commit is contained in:
Robin Leander Schröder authored and Zach Riggle committed 2018-05-30 14:32:44 -05:00
1 parent 8da0827c25
commit 338fbeba7a
2 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -132,9 +132,9 @@ def start(argv=[], *a, **kw):
gdbscript = '''
%if ctx.binary:
%if 'main' in ctx.binary.symbols:
break *0x{exe.symbols.main:x}
%else:
break *0x{exe.entry:x}
tbreak main
%elif 'DYN' != ctx.binary.elftype:
tbreak *0x{exe.entry:x}
%endif
%endif
continue
+3 -3
View File
@@ -464,9 +464,9 @@ def debug(args, gdbscript=None, exe=None, ssh=None, env=None, sysroot=None, **kw
# gdbserver outputs a message when a client connects
garbage = gdbserver.recvline(timeout=1)
if "Remote debugging from host" not in garbage:
gdbserver.unrecv(garbage)
# Some versions of gdbserver output an additional message
garbage2 = gdbserver.recvline_startswith("Remote debugging from host ", timeout=1)
return gdbserver