BUUCTF 梅花香自苦寒来

梅花香自苦寒来

打开图片可以看到,在jpg后面有大量的数据,
在这里插入图片描述
将它保存出来,可以看出是十六进制,将它转为ascii,写脚本

 
with open('hex.txt','r') as h:
    h=h.read()
tem=''
for i in range(0,len(h),2):
    tem='0x'+h[i]+h[i+1]
    tem=int(tem,base=16)
    print(chr(tem),end='')

得到

 
(7,7)
(7,8)
(7,9)
(7,10)
(7,11)
(7,12)
(7,13)
(7,14)
(7,15)
(7,16)
(7,17)
(7,18)
(7,19)
(7,20)
(7,21)
(7,22)
(7,23)

35019个坐标,用gnuplot绘图,但要先改为gnuplot能识别的方式,写脚本

with open('ascii.txt','r')as a:
    a=a.read()
a=a.split()
tem=''
for i in range(0,len(a)):
    tem=a[i]
    tem=tem.lstrip('(')
    tem=tem.rstrip(')')
    for j in range(0,len(tem)):
        if tem[j]==',':
            tem=tem[:j]+' '+tem[j+1:]
    print(tem)
 用gnuplot

在这里插入图片描述
得到
在这里插入图片描述
扫码得flag

猜你喜欢

转载自www.cnblogs.com/harmonica11/p/11365812.html