Skip to content

Commit

Permalink
[shellcraft] Avoid recursive walk of all templates for command line
Browse files Browse the repository at this point in the history
  • Loading branch information
heapcrash committed Jul 27, 2020
1 parent b6fc0f3 commit 48f1952
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pwnlib/commandline/shellcraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ def main(args):
common.parser.print_usage()
exit()

if args.shellcode not in shellcraft.templates:
try:
template = get_template(args.shellcode)
except AttributeError:
log.error("Unknown shellcraft template %r. Use --list to see available shellcodes." % args.shellcode)

func = get_template(args.shellcode)
Expand Down

0 comments on commit 48f1952

Please sign in to comment.