6 ms·
So, the quine-stion we're all asking now - is there a valid image, that also happens to be a valid executable, that when run, outputs the image? And/or what ab
by argvargc 5y ago
So, the quine-stion we're all asking now - is there a valid image, that also happens to be a valid executable, that when run, outputs the image?
And/or what about an interpret or compile step in there?
- NieDzejkob 5y agoIf a Game Boy ROM counts as an executable, it's been done: https://github.com/pinobatch/little-things-gb/tree/master/gbpng https://github.com/pinobatch/little-things-gb/tree/master/gb...
- Retr0id 5y agoI created something very similar. It is a PNG and bootable x86 MBR polyglot. When executed, it rewrites the PNG's image data, to convey the program's output. https://twitter.com/OverTheWireCTF/status/1465742422751821829 https://twitter.com/OverTheWireCTF/status/146574242275182182... Someone who solved the challenge did a writeup: https://joe.lothan.net/ctfs/2021-advent-otw/00-warmup/ https://joe.lothan.net/ctfs/2021-advent-otw/00-warmup/
- bowmessage 5y agoWow, such an impressive CTF! Did the author solve it in the exact way you intended? I'm curious what the real answer to problem 8 was, now!
- Retr0id 5y agoTo be honest there is no singular intended solution, I deliberately designed it so that there were multiple approaches that could make sense (especially in combination). Intended solutions include but are not limited to: - Guessing by hand. - Bruteforce by programatically feeding input into QEMU (as in that writeup). - Bruteforce by only emulating the "important" code, via something like Unicorn. - Bruteforce by reimplementing the algorithm in another language (There are some tricks you can use to make it go fast - maybe I should write those up...) - Reducing the search space by grepping for likely keywords. - Bruteforce of remaining bytes of the RC4 key (also as in that writeup).
- boothby 5y ago> is there a valid image, that also happens to be a valid executable, that when run, outputs the image? Yes, this exists: https://codegolf.stackexchange.com/a/23255 https://codegolf.stackexchange.com/a/23255