CTF中好用的一些脚本
二进制文件转图片
import struct a = open("C:\\Users\\DELL\\Desktop\\123.txt", "r") # 十六进制数据文件 lines = a.read() res = [lines[i:i + 2] for i in range(0, len(lines), 2)] with open("C:\\Users\\DELL\\Desktop\\123.jpg", "wb") as f: for i in res: s = struct.pack('B', int(i, 16)) f.write(s)