Re:A file that’s both an acceptable HTML page and a JPEG (2012)
by cryptonaut on Sunday September 09, 2018 @08:50PM
(#17948641)
It's a JPEG with the HTML written in the comment field:
[ Parent
| on HN ]
Re:A file that’s both an acceptable HTML page and a JPEG (2012)
by saagarjha on Sunday September 09, 2018 @09:02PM
(#17948681)
I suspected it was something like that: the "meat" of the HTML and JPEG data being contained in each other's comment fields, since that's how many quines work. I don't quite know enough about the JPEG file format to be confident about it, though.
Re:A file that’s both an acceptable HTML page and a JPEG (2012)
by mikeryan on Sunday September 09, 2018 @08:54PM
(#17948653)
It also uses an (non terminated - AFAICT) HTML Comment to hide the rest of the JPEG data.
Re:A file that’s both an acceptable HTML page and a JPEG (2012)
by saagarjha on Sunday September 09, 2018 @08:59PM
(#17948673)
> non terminated - AFAICT
Yes, it shows up as all green in Safari. And:
$ { curl -s http://lcamtuf.coredump.cx/squirrel/?1 | grep -- '-->' ; } || echo "Not found"
Not found
Re:A file that’s both an acceptable HTML page and a JPEG (2012)
by anonymfus on Sunday September 09, 2018 @08:56PM
(#17948662)
Yes but it is not necessary because everything except absolutely positioned div is hidden anyway.
Re:A file that’s both an acceptable HTML page and a JPEG (2012)
by MapleWalnut on Sunday September 09, 2018 @11:36PM
(#17949223)
Here is the output from the handy `file` BSD utility which gave it away to me (see the comment field).
JPEG image data, JFIF standard 1.01, resolution (DPI), density 300x300, segment length 16, comment: "<html><body><style>body { visibility: hidden; } .n { visibility: visible; position: absolute; ", baseline, precision 8, 1000x667, frames 3