$ pngcheck challenge.png
OK: challenge.png (800x600, 24-bit RGB, non-interlaced, 92.3%).
$ pngcheck challenge.png
OK: challenge.png (800x600, 24-bit RGB, non-interlaced, 92.3%).
$ pngcheck challenge.png
OK: challenge.png (800x600, 24-bit RGB, non-interlaced, 92.3%).
$ pngcheck -v challenge.png
File: challenge.png (153847 bytes) chunk IHDR at offset 0x0000c, length 13 800 x 600 image, 24-bit RGB, non-interlaced chunk tEXt at offset 0x00025, length 36, keyword: Comment chunk IDAT at offset 0x00057, length 8192 (OK) chunk IDAT at offset 0x02065, length 8192 (OK) chunk IEND at offset 0x25819, length 0
No errors detected in challenge.png (5 chunks, 92.3% compression).
$ pngcheck -v challenge.png
File: challenge.png (153847 bytes) chunk IHDR at offset 0x0000c, length 13 800 x 600 image, 24-bit RGB, non-interlaced chunk tEXt at offset 0x00025, length 36, keyword: Comment chunk IDAT at offset 0x00057, length 8192 (OK) chunk IDAT at offset 0x02065, length 8192 (OK) chunk IEND at offset 0x25819, length 0
No errors detected in challenge.png (5 chunks, 92.3% compression).
$ pngcheck -v challenge.png
File: challenge.png (153847 bytes) chunk IHDR at offset 0x0000c, length 13 800 x 600 image, 24-bit RGB, non-interlaced chunk tEXt at offset 0x00025, length 36, keyword: Comment chunk IDAT at offset 0x00057, length 8192 (OK) chunk IDAT at offset 0x02065, length 8192 (OK) chunk IEND at offset 0x25819, length 0
No errors detected in challenge.png (5 chunks, 92.3% compression).
$ pngcheck challenge.png
CRC error in chunk IHDR (computed 4a3f2c1b, expected 00000000)
ERRORS DETECTED in challenge.png
$ pngcheck challenge.png
CRC error in chunk IHDR (computed 4a3f2c1b, expected 00000000)
ERRORS DETECTED in challenge.png
$ pngcheck challenge.png
CRC error in chunk IHDR (computed 4a3f2c1b, expected 00000000)
ERRORS DETECTED in challenge.png
$ pngcheck -v challenge.png
$ pngcheck -v challenge.png
$ pngcheck -v challenge.png
$ pngcheck -fvp challenge.png
$ pngcheck -fvp challenge.png
$ pngcheck -fvp challenge.png
$ pngcheck -v challenge.png chunk IHDR at offset 0x0000c, length 13 800 x 600 image, 24-bit RGB, non-interlaced
CRC error in chunk IHDR (computed 4a3f2c1b, expected 1a2b3c4d)
ERRORS DETECTED in challenge.png
$ pngcheck -v challenge.png chunk IHDR at offset 0x0000c, length 13 800 x 600 image, 24-bit RGB, non-interlaced
CRC error in chunk IHDR (computed 4a3f2c1b, expected 1a2b3c4d)
ERRORS DETECTED in challenge.png
$ pngcheck -v challenge.png chunk IHDR at offset 0x0000c, length 13 800 x 600 image, 24-bit RGB, non-interlaced
CRC error in chunk IHDR (computed 4a3f2c1b, expected 1a2b3c4d)
ERRORS DETECTED in challenge.png
import struct, zlib with open("challenge.png", "rb") as f: data = f.read() # IHDR chunk data is at bytes 12-28 (after 8-byte signature + 4-byte length + 4-byte type)
ihdr_data = data[12:29] # 4 (length) + 4 (IHDR) + 13 (data) = offset 12 to 28
chunk_type_and_data = data[16:29] # just "IHDR" + 13 bytes of data correct_crc = zlib.crc32(chunk_type_and_data) & 0xFFFFFFFF
print(f"Correct CRC: {correct_crc:#010x}") # Patch: replace bytes 29-33 with correct CRC
patched = data[:29] + struct.pack(">I", correct_crc) + data[33:]
with open("fixed.png", "wb") as f: f.write(patched)
import struct, zlib with open("challenge.png", "rb") as f: data = f.read() # IHDR chunk data is at bytes 12-28 (after 8-byte signature + 4-byte length + 4-byte type)
ihdr_data = data[12:29] # 4 (length) + 4 (IHDR) + 13 (data) = offset 12 to 28
chunk_type_and_data = data[16:29] # just "IHDR" + 13 bytes of data correct_crc = zlib.crc32(chunk_type_and_data) & 0xFFFFFFFF
print(f"Correct CRC: {correct_crc:#010x}") # Patch: replace bytes 29-33 with correct CRC
patched = data[:29] + struct.pack(">I", correct_crc) + data[33:]
with open("fixed.png", "wb") as f: f.write(patched)
import struct, zlib with open("challenge.png", "rb") as f: data = f.read() # IHDR chunk data is at bytes 12-28 (after 8-byte signature + 4-byte length + 4-byte type)
ihdr_data = data[12:29] # 4 (length) + 4 (IHDR) + 13 (data) = offset 12 to 28
chunk_type_and_data = data[16:29] # just "IHDR" + 13 bytes of data correct_crc = zlib.crc32(chunk_type_and_data) & 0xFFFFFFFF
print(f"Correct CRC: {correct_crc:#010x}") # Patch: replace bytes 29-33 with correct CRC
patched = data[:29] + struct.pack(">I", correct_crc) + data[33:]
with open("fixed.png", "wb") as f: f.write(patched)
$ pngcheck -v challenge.png chunk IHDR at offset 0x0000c, length 13 chunk IDAT at offset 0x00025, length 8192 (OK) chunk IEND at offset 0x25801, length 0 chunk flAg at offset 0x25815, length 42 (unknown ancillary chunk)
No errors detected in challenge.png (4 chunks).
$ pngcheck -v challenge.png chunk IHDR at offset 0x0000c, length 13 chunk IDAT at offset 0x00025, length 8192 (OK) chunk IEND at offset 0x25801, length 0 chunk flAg at offset 0x25815, length 42 (unknown ancillary chunk)
No errors detected in challenge.png (4 chunks).
$ pngcheck -v challenge.png chunk IHDR at offset 0x0000c, length 13 chunk IDAT at offset 0x00025, length 8192 (OK) chunk IEND at offset 0x25801, length 0 chunk flAg at offset 0x25815, length 42 (unknown ancillary chunk)
No errors detected in challenge.png (4 chunks).
$ pngcheck challenge.png
invalid chunk name "" (00 00 00 00)
ERRORS DETECTED in challenge.png
$ pngcheck challenge.png
invalid chunk name "" (00 00 00 00)
ERRORS DETECTED in challenge.png
$ pngcheck challenge.png
invalid chunk name "" (00 00 00 00)
ERRORS DETECTED in challenge.png
chunk IEND at offset 0x25801, length 0
additional data after IEND chunk
chunk IEND at offset 0x25801, length 0
additional data after IEND chunk
chunk IEND at offset 0x25801, length 0
additional data after IEND chunk
# Debian/Ubuntu/Kali
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install pngcheck macOS -weight: 500;">brew -weight: 500;">install pngcheck
# Debian/Ubuntu/Kali
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install pngcheck macOS -weight: 500;">brew -weight: 500;">install pngcheck
# Debian/Ubuntu/Kali
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install pngcheck macOS -weight: 500;">brew -weight: 500;">install pngcheck - "The image is corrupted" or "won't open"
- "Something is wrong with the file"
- "Check the structure" or "check the chunks"
- "The file passes validation but something is off"
- Any hint involving CRC, chunk, header, or IHDR - Any chunk with a CRC error
- Non-standard chunk names (anything that isn't IHDR/IDAT/IEND/tEXt/zTXt/gAMA/etc.)
- Chunks in wrong order (IDAT before IHDR is invalid)
- Content after IEND - Run pngcheck -fvp challenge.png immediately — even before trying to open the file
- Read every line of output. Non-standard chunk names are red flags
- If there's a CRC error in IHDR, check the dimensions with a hex editor before doing anything else
- If it passes cleanly, note any tEXt, zTXt, or iTXt chunks — extract their content
- Check for data after IEND
- Only switch to steganography tools (zsteg, stegsolve) after structural analysis is complete