huge commit
This commit is contained in:
15
2026/srdnlen_quals/forensic/chapter2/get_image.py
Normal file
15
2026/srdnlen_quals/forensic/chapter2/get_image.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from PIL import Image, ImageOps
|
||||
|
||||
# Read the XORed binary data
|
||||
with open('./final.bin', 'rb') as f:
|
||||
data = f.read()
|
||||
|
||||
# Interpret the 262,144 bytes as a 512x512 Grayscale image
|
||||
img = Image.frombytes('L', (512, 512), data)
|
||||
|
||||
# The XOR differences might be very dark, so we auto-contrast it to make the flag pop
|
||||
img = ImageOps.autocontrast(img)
|
||||
|
||||
# Save the final image
|
||||
img.save('the_armory.png')
|
||||
print("The forge is lit. Open the_armory.png")
|
||||
Reference in New Issue
Block a user