Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Nov 13, 2024
1 parent 384fe42 commit 36a63d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pwnshop/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def handle_apply(args):
continue

out_dir = f"{os.path.dirname(args.yaml)}/{c['id']}/_{v}"
print(f"Building {c['id']} variant {v} into {out_dir}.")
print(f"Applying {c['id']} variant {v} into {out_dir}.")
os.makedirs(out_dir, exist_ok=True)

challenge = pwnshop.ALL_CHALLENGES[c['challenge']](
Expand All @@ -188,16 +188,21 @@ def handle_apply(args):
challenge.VERIFY_IMAGE = verify_image

if args.no_render and not args.no_build:
print("... using existing source")
challenge.source = open(challenge.src_path).read()
else:
print("... rendering")
challenge.render()

if args.no_build:
print("... using existing binary")
challenge.binary = open(challenge.bin_path, "rb").read()
else:
print("... building")
challenge.build()

if not args.no_verify:
print("... verifying")
challenge.verify()
print("... verification passed")

Expand Down
2 changes: 1 addition & 1 deletion pwnshop/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def alarm(*args):
signal.alarm(timeout)
return func(*args, **kwargs)
except AssertionError:
traceback.print_exc()
print("... timed out. Retrying...")
finally:
signal.alarm(0)

Expand Down

0 comments on commit 36a63d2

Please sign in to comment.