Bugku 好多数值

打开文件发现好多行类似255,255,255的数据,直接想到RGB值,估计是画图。文件总共61366行,分解一下是122*503,猜测要画一个宽503,高122的图,拿Python写个脚本如下:

import re
from PIL import Image

with open("1.txt", "r") as f:
    data = f.readlines()

size = [503, 122]
img = Image.new("RGB", size)
pix = img.load()
for x in range(size[0]):
    for y in range(size[1]):
        r, g, b = data[x*122+y][:-1].split(',')
        pix[x,y] = int(r), int(g), int(b)
img.show()
img.save("flag.bmp")

得到最终flag如图:

Bugku 好多数值_第1张图片

你可能感兴趣的:(Bugku 好多数值)