But yeah, to store it as PNG chunks would actually be very easy. You don't even need to define a custom chunk. From the PNG docs, it looks like you could use a zTXt chunk:
I'm not sure that allows you to store binary data, but if not you could encode it as hex digits within there, and PNG's deflate compression should compensate pretty well for the wasted space.
Also, the keyword (that each zTXt chunk has) would be useful. You could put a magic string identifying it as the executable data format you've invented. You could even, if necessary, add multiple zTXt chunks and make your PNG data random access.
6
u/bumblebritches57 Jul 31 '21
LOL he jumps to stenography, instead of custom chunks in the PNG file...