Skip to content

Commit 9099b81

Browse files
committed
make windows chals build
1 parent 32001e7 commit 9099b81

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Diff for: pwnshop/__main__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ def handle_build(args, challenges):
9797
if args.debug_output:
9898
challenge._owns_workdir = False
9999

100-
challenge.build()
100+
binary, lib, pdb = challenge.build()
101+
102+
with open(f"{challenge.__class__.__name__}.exe", 'wb') as f:
103+
f.write(binary)
104+
with open(f"{challenge.__class__.__name__}.pdb", 'wb') as f:
105+
f.write(pdb)
101106

102107
def raise_timeout(signum, stack):
103108
raise TimeoutError("ACTION TIMED OUT")

Diff for: pwnshop/challenge.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,11 @@ def build_compiler_cmd(self):
524524
if self.MAKE_DLL:
525525
cmd.append("/LD")
526526

527-
return cmd
528-
# Linker options
529527

528+
cmd.append(self.src_path)
529+
# Linker options
530530
#pylint:disable=unreachable
531-
cmd.append('/LINK')
531+
cmd.append('/link')
532532
if self.DYNAMIC_BASE is True:
533533
cmd.append('/DYNAMICBASE')
534534
else:
@@ -560,7 +560,6 @@ def build(self, source=None):
560560
with open(src_path, 'w') as f:
561561
f.write(source)
562562

563-
cmd.append(src_path)
564563
subprocess.check_output(cmd, cwd=workdir)
565564
with open(bin_path, 'rb') as f:
566565
binary = f.read()

0 commit comments

Comments
 (0)