Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/python
from PIL import Image
import sys
from re import sub
print " ** SUPER SEKRIT DECRYPTOR DO NOT DISTRIBUTE ** "
def decode(text):
return sub(r'(\d+)(\D)', lambda m: m.group(2) * int(m.group(1)),text)
if len(sys.argv) != 2:
print "usage: ./d.py [in_img]"
sys.exit(0)
in_img = Image.open(sys.argv[1])
in_pixels = in_img.convert("RGB")
width, height = in_img.size
x = ""
o = ""
for i in range(0,width * height):
temp_x = i % width
temp_y = i / width
(r,g,b) = in_pixels.getpixel((temp_x,temp_y))
x += bin(r)[8:10]
if len(x) == 8:
o += chr(int(x,2))
x = ""
print decode(o)
@timothyleung

This comment has been minimized.

Copy link

timothyleung commented Sep 16, 2016

real flag pleaseeeeeee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.