Repairing Corrupted PNG Files by Hand
A PNG that refuses to open is rarely beyond repair. Its structure is simple: an 8-byte signature followed by length-type-data-CRC chunks. Once you know that layout, you can fix a broken file in a hex editor. Here I walk through repairing a mangled signature, IHDR header, chunk name, and CRC checksums, using two forensics challenges from the bi0s DD CTF as worked examples.