Extract a secret flag hidden inside a corrupted PNG image file. The file appears to be a PNG but is rejected by standard image viewers and libraries as invalid/corrupted. A short ASCII plaintext flag in the format FLAG{...} has been concealed somewhere in the file using a steganography or encoding technique.
Technical Requirements
Language: Python 3 (or any available CLI tools)
Input file:/app/environment/corrupted.png
Output file:/app/output.txt
Task
Analyze the file /app/environment/corrupted.png to understand its structure and determine why image viewers reject it.
Investigate the file's binary content to locate hidden data.
Extract and decode the hidden payload to recover the flag.
Write the recovered flag (and nothing else) to /app/output.txt.
Output Specification
/app/output.txt must contain exactly one line: the recovered flag.
The flag follows the format FLAG{...} where ... is an ASCII alphanumeric string (may include underscores).
No leading/trailing whitespace, no extra lines, no other content.
Constraints
The file has a valid PNG signature but contains structural anomalies that cause viewers to reject it.
The hidden data may require one or more decoding steps (e.g., base64, hex, compression).
Standard forensic tools (file, strings, hexdump, python3, etc.) are available.