3 ms·
What will really blow your mind is that you can cat a png and a zip together and the resulting file is both a valid png that looks identical to the image and a
by yoru-sulfur 5y ago
What will really blow your mind is that you can cat a png and a zip together and the resulting file is both a valid png that looks identical to the image and a zip that contains the same contents as the archive.
- Clewza313 5y agoMind. Blown. Only works if the PNG is first and the ZIP second though, because PNG reads front to back and ZIP reads back to front.
- tinus_hn 5y agoThis is how these self extracting archives work, it’s just an exe (that allows adding random data to the end) and a zip (that allows random data to be prepended) added together.
- edub 5y agomore specifically the executable part contains the logic to decompress the remainder of the file, while still allowing a decompression program to be able to open and decompress the file (ignoring the executable portion of that file).
- mike_d 5y agoYou might enjoy PoC||GTFO issue #10: > The polyglot file pocorgtfo10.pdf is valid as a PDF, as a ZIP file, and as an LSMV recording of a Tool Assisted Speedrun (TAS) that exploits Pokémon Red in a Super GameBoy on a Super NES. The result of the exploit is a chat room that plays the text of PoCkGTFO 10:3. https://www.alchemistowl.org/pocorgtfo/pocorgtfo10.pdf https://www.alchemistowl.org/pocorgtfo/pocorgtfo10.pdf
- achairapart 5y agoThis may be also the trick used by the fantasy console PICO-8[0] which games run by png-based cartridges[1]. [0]: https://www.lexaloffle.com/pico-8.php https://www.lexaloffle.com/pico-8.php [1]: https://www.lexaloffle.com/bbs/?cat=7&carts_tab=1#sub=2&mode=carts&orderby=featured https://www.lexaloffle.com/bbs/?cat=7&carts_tab=1#sub=2&mode...
- dangerbird2 5y agoApparently, Pico8 encodes the compressed app data directly in the PNG pixel data. They use 2 least significant bits of each color channel to encode a single byte of data per color. The pixel count of pico8 cartridges is what creates the console's 32,800 byte size limit. https://pico-8.fandom.com/wiki/P8PNGFileFormat https://pico-8.fandom.com/wiki/P8PNGFileFormat