BUUCTF Misc (三)

虚幻2

hint:1. 汉信码 2. 图片要转转 3. 暴力修补

知识点

先知道汉信码长啥样

4个脚是定位点,圈出来的辅助定位点一圈是白的


题解

from PIL import Image
img = Image.open("file.png")
str = ''
for w in range(36):
    for h in range(12):
        rgb = img.getpixel((w,h))#取rgb值,发现都是255,0。255记1,0记0
        str += '1' if rgb[0] == 255 else '0'
        str += '1' if rgb[1] == 255 else '0'
        str += '1' if rgb[2] == 255 else '0'

size = int(len(str)**0.5)
code = Image.new('RGB',(36,36))
i=0
for x in range(36):
    for y in range(36):
        if str[i] == '1':
            code.putpixel((x,y),(255,255,255))
        else:
            code.putpixel((x,y),(0,0,0))
        i+=1
code.show()
code.save('res.png')

得31*31规格的码,对照一下,不一样?整体逆时针旋转90度,得到:

后来看fz大佬的wp,那样不行,转转转不会那么简单随便

将res.png逆时针旋转180度,再左右翻转,感觉和前面文档的特征差不多,再改那个7*7的定位点

from PIL import Image
img = Image.open("res.png")
img = img.rotate(180)   #逆时针180度
img = img.transpose(Image.FLIP_LEFT_RIGHT)  #左右镜像
img.save('slip.png')

汉信码在线识别网站可能因为比赛扫的人太多停了
中国编码app可以识别辽,呜呜呜

猜你喜欢

转载自www.cnblogs.com/wrnan/p/12912705.html