Files
ioccc/2012/hamano
Landon Curt Noll f29b37e49a improve HTML menus, add social.html, prep for IOCCC28 winners
Prepare for the winners of **IOCCC28**.

> However these are not the 2024 droids you are looking for.  :-)

The HTML menu (both JavaScript and non-JavaScript) has been updated.

The `Status -> Rules and guidelines' have been replaced with two
separate menus `Status -> IOCCC rules` and `Status -> IOCCC guidelines`.

Added a new top level `social.html` page: built from a new `social.md`.

Sorted rules for building specific web pages in the top level `Makefile`.
Added `make social` to make the `social.html` page from `social.md`.

The `bin/gen-top-html.sh` now is able to process a argument of **social**
to process the new top level `social.html` page.

Changed `bin/gen-top-html.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-07-25".

Below `About -> Home page` a new `About -> IOCCC social media` menu item
as added.

Because the menu change touched every HTML file, we changed the general
copyright date range for HTML files from "1984-2024" to "1984-2025"
due to the extensive changes made for **IOCCC28**.

Those markdown files that were modified in 2025 had their copyright date
range also changed from "1984-2024" to "1984-2025".

Rebuilt tarballs and sitemap due to the extensive HTML rebuilding.

Ran `make update` to perform the above.
2025-07-26 13:06:29 -07:00
..
…
…
2024-07-31 10:44:10 -07:00

To build:

    make

To use:

    ./hamano < textfile > output.pdf

Try:

    ./try.sh

The script will generate a number of PDF files and it will suggest you look at them as well. You can read hint.pdf with a PDF reader like acroread hint.pdf or evince hint.pdf. With macOS you can do open hint.pdf which by default will open Preview.app. You may of course use your pdf viewer to open the file directly instead.

One of the PDF files generated the README.md file as a PDF, obfuscated, and the PDF file will then be compiled as C (itself!) and executed so that it shows README.md!

That procedure looks like:

    ./hamano < README.md > hint.pdf
    cc -xc hint.pdf -o hint
    ./hint

Another PDF generated is an obfuscated Hello World! program (obfuscated inside the PDF). Once this is done it will compile the PDF as if it was C (itself!). It will look like:

    echo 'int main(){puts("Hello World!");}' | ./hamano > hello.pdf
    cc -xc hello.pdf -o hello
    ./hello | cc -Wno-implicit-function-declaration -xc - -o ./hello2

    ./hello2

although the CFLAGS will be what is in the Makefile as it uses the helper rules hint.pdf, hint, hello.pdf and hello to do this.

Judges' remarks:

This entry treads into a new territory for IOCCC - generating PDF files.

The originally submitted entry could have been thought of as a "Best abuse of Ghostscript" entry. :-)

The source code and rendered pages are obfuscated for humans (where is the font?), and the submitted entry created PDF files that left Ghostscript confused.

The results can be viewed with Acrobat Reader, evince and Apple's Preview.

The updated version can also be viewed using Ghostscript.

There is something strange about the little flags in the output. A search of English literature will provide a hint. The conclusion you might draw is too elementary. :-)

So what do those flags really mean?

The Dancing men algorithm might be useful.

Don't forget to take a look at the generated PDF. Perhaps you might even want to compile the output with a C compiler. When you run it, what does it output?

Author's remarks:

This program obfuscate text file into PDF file with Dancing men algorithm.

Probably, the output PDF file is compliant with PDF 1.3 and it's also available to compile as C code.

I've tested it with GCC 4.7 and Clang 3.0 with Linux, and the following PDF Readers:

  • Adobe Acrobat Reader
  • Evince
  • Ghostscript
  • Xpdf

Obfuscations

This program is obfuscated by using classical methods. But can you find the embedded font in the fragmented glyph?