m = open("flag.png","rb").read() k=0 for i inrange(5000): if k==1: break for j inrange(5000): c = m[12:16] + struct.pack('>i', i) + struct.pack('>i', j)+m[24:29] crc = binascii.crc32(c) & 0xffffffff if crc == 0x91918666: //crc k = 1 print(hex(i),hex(j)) break
miwen='' for i in x: if i notin k: miwen=miwen+i print(yuanwen,miwen)
for order inlist(permutations(miwen,4)): for i inrange(len(yuanwen)): d[yuanwen[i]]=order[i] s='' for j in timu: s=s+d[j] bs=base64.b64decode(s) withopen('output\\'+''.join(order)+'.rar','wb')as f: f.write(bs)
import pyzbar.pyzbar as pyzbar from PIL import Image import os from tqdm import tqdm path = 'C:\\Users\\username\\Desktop\\qcode' texts = ['']*9424 list = ['']*9424 i = 0 for filename in os.listdir(path): list[i] = filename i += 1 print('目录文件获取完毕')
for i in tqdm(range(len(list))): img = Image.open(path +'\\'+ list[i]) texts[i] = pyzbar.decode(img) print('图像信息获取完毕') i = 0 for j inrange(len(texts)): for text in texts[j]: tmp = text.data.decode("utf-8") if('ctfshow{'in tmp): print('二维码 ' + list[j] + ' 解码出ctfshow:' + tmp) if('flag{'in tmp): print('二维码 ' + list[j] + ' 解码出flag:' + tmp)
from PIL import Image pic = Image.new("RGB",(1000,1000)) f = open("flaag.txt",'r').readlines() for i inrange(len(f)): s = f[i].split(',') for j inrange(len(s)): if(s[j] == '255'): pic.putpixel((j,i),(255,255,255)) elif s[j].find('\n')>0: pic.putpixel((j,i),(255,255,255)) else: pic.putpixel((j,i),(0,0,0)) pic.save("qcode.png")