标题 | 简介 | 类型 | 公开时间 | ||||||||||
|
|||||||||||||
|
|||||||||||||
详情 | |||||||||||||
[SAFE-ID: JIWO-2024-2713] 作者: future 发表于: [2020-07-10]
本文共 [472] 位读者顶过
import zlib
import struct filename = 'ctf.png' with open(filename, 'rb') as f: all_b = f.read()[出自:jiwo.org] crc32key = int(all_b[29:33].hex(),16) data = bytearray(all_b[12:29]) n = 4095 #理论上0xffffffff,但考虑到屏幕实际/cpu,0x0fff就差不多了 for w in range(n): #高和宽一起爆破 width = bytearray(struct.pack('>i', w)) #q为8字节,i为4字节,h为2字节 for h in range(n): height = bytearray(struct.pack('>i', h)) for x in range(4): data[x+4] = width[x] data[x+8] = height[x] crc32result = zlib.crc32(data) if crc32result == crc32key: print("宽为:",end="") print(width) print("高为:",end="") print(height) exit(0) |