Live data from Hacker News

A file that’s both an acceptable HTML page and a JPEG (2012)

lcamtuf.coredump.cx

21–30 of 72 posts

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#21
post #16

EDIT: I realize that the subject of this thread is not a polygot, but I'm leaving this comment up in case it interests someone. :/ If anyone's interested in what these are called, they are called polygots. > In computing, a polyglot is a computer program or script written in a valid form of multiple programming languages, which performs the same operations or output independent of the programming language used to com…

I wouldn’t call it a polyglot as that has to deal with computer programs, no?

It also doesn't have the same operations/output since one is a squirrel photo and the other is a webpage with English text.

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#22
post #19

POC||GTFO issue 2 (from 2013) was a PDF and a bootable OS at the same time: From section 8: "A careful reader may have noticed that a bootable OS image was hidden in the last issue of PoC k GTFO, as one of the files in its dual PDF/ZIP structure (if you haven’t, download and extract it now!). This time, though, let’s hide it in plain sight. You will find by running ‘qemu-system-i386 -fda pocorgtfo02.pdf’ that the PDF…

Don't forget the issue that was a PDF, a ZIP, and an NES ROM that would print its own MD5 when run in an emulator

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#24
post #19

POC||GTFO issue 2 (from 2013) was a PDF and a bootable OS at the same time: From section 8: "A careful reader may have noticed that a bootable OS image was hidden in the last issue of PoC k GTFO, as one of the files in its dual PDF/ZIP structure (if you haven’t, download and extract it now!). This time, though, let’s hide it in plain sight. You will find by running ‘qemu-system-i386 -fda pocorgtfo02.pdf’ that the PDF…

Any reading you can link to regarding how to accomplish stuff like this? I.e. valid pdfs that are also valid bootable images?

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#26
post #24
post #19

POC||GTFO issue 2 (from 2013) was a PDF and a bootable OS at the same time: From section 8: "A careful reader may have noticed that a bootable OS image was hidden in the last issue of PoC k GTFO, as one of the files in its dual PDF/ZIP structure (if you haven’t, download and extract it now!). This time, though, let’s hide it in plain sight. You will find by running ‘qemu-system-i386 -fda pocorgtfo02.pdf’ that the PDF…

Any reading you can link to regarding how to accomplish stuff like this? I.e. valid pdfs that are also valid bootable images?

They usually document their tricks in the file itself. For example, see Chapter 8 in GP's link.

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#27

Earlier quoted context omitted.

Took a look at the page source, and it's full of binary garbage. It looks to me that it's a JPEG image that has been slightly tweaked to contain just enough HTML to get a (lenient) browser to display it.

It's a JPEG with the HTML written in the comment field: # exiftool -b -comment body { visibility: hidden; } .n { visibility: visible; position: absolute; padding: 0 1ex 0 1ex; margin: 0; top: 0; left: 0; } h1 { margin-top: 0.4ex; margin-bottom: 0.8ex; } Hello, squirrel fans! This is an embedded landing page for an image. You can link to this URL and get the HTML document you are viewing right now (soon to include ess…

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: "body { visibility: hidden; } .n { visibility: visible; position: absolute; ", baseline, precision 8, 1000x667, frames 3

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#28
post #16

EDIT: I realize that the subject of this thread is not a polygot, but I'm leaving this comment up in case it interests someone. :/ If anyone's interested in what these are called, they are called polygots. > In computing, a polyglot is a computer program or script written in a valid form of multiple programming languages, which performs the same operations or output independent of the programming language used to com…

I always thought it was called a chimera.

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#29
post #13

Earlier quoted context omitted.

A chipmunk is a type of squirrel.

https://animalsake.com/how-is-chipmunk-different-from-squirr... (TLDR, Chipmunks are not Squirrels)

https://en.wikipedia.org/wiki/Squirrel

> Squirrels are members of the family Sciuridae, a family that includes small or medium-size rodents. The squirrel family includes tree squirrels, ground squirrels, chipmunks, marmots (including woodchucks), flying squirrels, and prairie dogs amongst other rodents.

(TLDR, chipmunks are squirrels)

Re: A file that’s both an acceptable HTML page and a JPEG (2012)

#30
The last week i found this [1] thread by Notch. He is working in an entry to js13k [2] (a game jam about html5 games restricted to 13 KBs).

He bundled the whole source code and binary data used in the game/tech demo to use the in browser image decompression, avoiding to write a custom (de)compression code, saving KBs this way.

Then he just eval() the needed parts for each thing.

I found this extremely clever, game jam limitations, specially size ones, evolve into clever programming tricks that are interesting both to code and to look at.

[1] https://twitter.com/notch/status/1035811278520872960

[2] http://js13kgames.com/

Post reply on HN