Skip to content

Instantly share code, notes, and snippets.

@RDxR10
Created October 2, 2020 09:11
Show Gist options
  • Save RDxR10/e4f9a5384abdd73e3a2eb352c4bd2ae5 to your computer and use it in GitHub Desktop.
Save RDxR10/e4f9a5384abdd73e3a2eb352c4bd2ae5 to your computer and use it in GitHub Desktop.
Solution to Misc/Amidst Bits and Bases from darkCTF 2020
from PIL import Image
with open("../crazy.txt", "r") as f:
dat = f.read()
lines = ''.join(dat.split("\n")[8:])
pixels = []
for i in lines:
if i == '1':
pixels += [(255,255,255,255)]
else:
pixels += [(0,0,0,255)]
img = Image.new("RGBA", (200,200))
img.putdata(pixels)
img.save("qrcode.png")
print(lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment