Skip to content

Instantly share code, notes, and snippets.

@cabreraalex
Last active August 29, 2015 13:56
Show Gist options
  • Save cabreraalex/9339626 to your computer and use it in GitHub Desktop.
Save cabreraalex/9339626 to your computer and use it in GitHub Desktop.
Attempt at Misc. 200 DEFKTHON CTF 2014
from PIL import Image
import numpy
flag = open("flag.txt")
pixels = flag.read().split("\n")
del pixels[-1]
myPixelsArray = ()
for x in pixels:
arrayer = x.split(",")
arrayer = tuple([int(w) for w in arrayer])
#if arrayer[0] != 255 or arrayer[1] != 255 or arrayer[2] != 255:
# arrayer = (0,0,0)
myPixelsArray += arrayer
myImage = Image.new("RGB", (122, 10000))
myImage.putdata(myPixelsArray)
myImage.save("test.jpeg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment