Forensic
Challenge
Link
Nintendo (484 pts)
Description
Solution
import apng
from struct import pack, unpack
im = apng.APNG.open("nintendo.apng")
i = 0
for png, control in im.frames:
print(png)
w, h = unpack(">I", png.chunks[0][1][8:12])[0], unpack(">I", png.chunks[0][1][12:16])[0]
png.chunks[0] = ('IHDR', apng.make_chunk("IHDR", pack(">I", w) + pack(">I", h) + b'\x08\x06\x00\x00\x00'))
png.save("%02d.png" % i)
i += 1Last updated