Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # QR generator for images.rar by Ipw for Team Tasteless
- # BaltCTF 2012
- import Image, os, math
- #Start by scanning the directory and getting results
- fakelist = []
- for x in range(1, 26):
- for y in range(1, 26):
- if((20<x<25 and 0<y<10) or (10<x<13 and 0<y<10)): #Since the existing file names seem to regard the entire series 20-25 as collisions, we'll do that to :|
- fakelist.append(str(x) + "(" + str(y) + ")" + ".gif")
- elif((str(x) + str(y) + ".gif") in fakelist):
- print "we fd up!!!!"
- os.exit()
- else:
- fakelist.append(str(x) + str(y) + ".gif")
- print fakelist
- finalimage = Image.new('RGB', (300, 300))
- for imageno, imagename in enumerate(fakelist):
- print str(imageno) + " and name: " + imagename + "\n"
- tempimage = Image.open('images/' + imagename)
- pixel = tempimage.crop((0, 0, 12, 12))
- row = int((math.floor(imageno/25)))
- column = int(((imageno) % 25))
- print str(row) + ":" + str(column)
- finalimage.paste(pixel, (column*12, row*12, (column+1)*12, (row+1)*12))
- del tempimage
- finalimage.save("output.jpg")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement