Skip to content

Commit

Permalink
Add ability to set env vars in template (#960)
Browse files Browse the repository at this point in the history
* added ability to set env vars in template

* changed env param to general *a, **kw
  • Loading branch information
reu-res authored and zachriggle committed Apr 21, 2017
1 parent 9b50163 commit 42692c6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pwnlib/data/templates/pwnup.mako
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,23 @@ if not args.LOCAL:

%if host:
# Execute the target binary locally
def local(argv=[]):
def local(argv=[], *a, **kw):
if args.GDB:
return gdb.debug([exe.path] + argv, gdbscript=gdbscript)
return gdb.debug([exe.path] + argv, gdbscript=gdbscript, *a, **kw)
else:
return process([exe.path] + argv)
return process([exe.path] + argv, *a, **kw)

%if ssh:
# Execute the target binary on the remote host
%else:
# Connect to the process on the remote host
%endif
def remote(argv=[]):
def remote(argv=[], *a, **kw):
%if ssh:
if args.GDB:
return gdb.debug([remote_path] + argv, gdbscript=gdbscript, ssh=shell)
return gdb.debug([remote_path] + argv, gdbscript=gdbscript, ssh=shell, *a, **kw)
else:
return shell.process([remote_path] + argv)
return shell.process([remote_path] + argv, *a, **kw)
%else:
return connect(host, port)
%endif
Expand All @@ -112,11 +112,11 @@ def remote(argv=[]):
%if host:
start = local if args.LOCAL else remote
%else:
def start(argv=[]):
def start(argv=[], *a, **kw):
if args.GDB:
io = gdb.debug([${binary_repr}] + argv, gdbscript=gdbscript)
io = gdb.debug([${binary_repr}] + argv, gdbscript=gdbscript, *a, **kw)
else:
io = process([${binary_repr}] + argv)
io = process([${binary_repr}] + argv, *a, **kw)
%endif

%if host and not ssh:
Expand Down

0 comments on commit 42692c6

Please sign in to comment.