mirror of
https://github.com/Gallopsled/pwntools.git
synced 2026-11-09 10:09:36 -10:00
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:
1 parent
8da0827c25
commit
338fbeba7a
2 files changed
+6
-6
No files matched your search
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user