Created
July 12, 2016 07:18
-
-
Save CreateRemoteThread/495324fa1589d2ea1a32c51f6d50c7c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
real flag pleaseeeeeee