Skip to content

Instantly share code, notes, and snippets.

@CreateRemoteThread
Created July 12, 2016 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CreateRemoteThread/495324fa1589d2ea1a32c51f6d50c7c9 to your computer and use it in GitHub Desktop.
Save CreateRemoteThread/495324fa1589d2ea1a32c51f6d50c7c9 to your computer and use it in GitHub Desktop.
#!/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
Copy link

real flag pleaseeeeeee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment