Skip to content

Commit 7673ce8

Browse files
koalajoe23Arusekk
andauthored
Make template respect args.EXE (Gallopsled#2111)
* Make template respect args.EXE To be able to execute a script using an executable with another name and/or location than specified at template generation, `args.EXE` will be used as path for ELF file loading, only using the preconfigured value when no arg was supplied * Update CHANGELOG.md * FIXUP: properly test for EXE arg * Style fixes and revert changelog Co-authored-by: Arusekk <[email protected]>
1 parent 6a9f78a commit 7673ce8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pwnlib/data/templates/pwnup.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ from pwn import *
4444
# Set up pwntools for the correct architecture
4545
%endif
4646
%if ctx.binary:
47-
exe = context.binary = ELF(${binary_repr})
47+
exe = context.binary = ELF(args.EXE or ${binary_repr})
4848
<% binary_repr = 'exe.path' %>
4949
%else:
5050
context.update(arch='i386')
@@ -58,7 +58,7 @@ exe = ${binary_repr}
5858
# for all created processes...
5959
# ./exploit.py DEBUG NOASLR
6060
%if host or port or user:
61-
# ./exploit.py GDB HOST=example.com PORT=4141
61+
# ./exploit.py GDB HOST=example.com PORT=4141 EXE=/tmp/executable
6262
%endif
6363
%endif
6464
%if host:

0 commit comments

Comments
 (0)