Corrupt PNG, a neat little challenge.

Corrupt PNG, a neat little challenge.

I have been working on fixing a corrupt PNG as a part of an ARG.

I used dev tools, to copy the text directly into HxD, as copy pasting into something like Notepad++ seemed to truncate a lot of the data.

From there, I was able to see there was quite a lot of html code within the PNG stream.

https://preview.redd.it/pd8d879lvilb1.png?width=1267&format=png&auto=webp&s=cb144705a1e6bf46c8fc8000a3f67247ce3a9e51

So my first step, was to find and replace all the HTML code items, with their unicode counterparts

I managed to locate 4 different characters, that had been swapped out with HTML. I used the search function in HxD, to track down the Unicode/Hex values specifically, and replace them with their correct Hex values.

  = 26 6E 62 73 70 3B REPLACE WITH ” ” = A0

&lt; = 26 6C 74 3B REPLACE WITH < = 3C

&gt; = 26 67 74 3B REPLACE WITH > = 3E

&amp; = 26 61 6D 70 3B REPLACE WITH & = 26

From there, I went about fixing the PNG Header and IHDR chunks.

Due to formatting issues with Reddit, I will screenshot the following part as it is easier to follow.

https://preview.redd.it/sn5w4iiovilb1.png?width=983&format=png&auto=webp&s=24c4c75dfbff3fb6c9335d4467a70e7e92989409

I was continuously running my edits through PNGCheck.exe, and found the fix for these two sections by removing junk data at the beginning of the file, then repairing the malformed sections and changing the CRC Checksum at the end.

Next, I started on the iCCP Profile and this is where I have been stuck, for the last day or so. The Chunk length of 00 00 18 23 seems incredibly long for the iCCP Profile Chunk. with zero editing, it appears to travel well into the following iTXT chunk.

I am not sure, if I am supposed to be calculating the chunk sizes and repairing them as I go, or if there is something I am missing. Any assistance, would be GREATLY appreciated.

I have never attempted something like this before, and 3 days ago, I didn’t even know what a PNG header looked like, so I am learning a lot and enjoying this immensely!

EDIT:

This is where I am currently at

https://preview.redd.it/p09aqh2cxilb1.png?width=903&format=png&auto=webp&s=bad44b6e7aaddb6b250457ee488172dae9f748c1

submitted by /u/mattperkins86
[link] [comments]

September 1, 2023
Read More >>