file = zipfile.ZipFile('./0573.zip',) ziplist = file.namelist() for f in ziplist: file.extract(f,r'./', pwd=psw.encode("utf-8")) psw=f.replace('.zip','') file.close()
whileTrue: file = zipfile.ZipFile('./'+ psw + '.zip',) ziplist = file.namelist() for f in ziplist: file.extract(f,r'./', pwd=psw.encode("utf-8")) psw=(f.replace('.zip','')) file.close()
运行到报错即可。当然你用try except也行。
当然如果你从最外面开始直接解压也行。
然后按照大小排序,很容易找到一个qr.txt,显然是画二维码的。
from PIL import Image
x = y = 200 img = Image.new("RGB",(x,y)) file = open('./qr.txt','r')
for width inrange(0,x): for height inrange(0,y): line = file.readline()[1:-2] #.replace("(","").replace(")","") rgb = line.split(',') img.putpixel((width,height),(int(rgb[0]),int(rgb[1]),int(rgb[2]))) img.save('flag.jpg')