Slashdot Mirror


Source Code For 22nd IOCCC Winners Has Been Released

An anonymous reader writes "The source code for the 22nd International Obfuscated C Code Contest winners has finally been released. Many entries exploited bugs in the size check program, making the 2013 entries possibly the most featureful submissions ever."

47 comments

  1. Perl by Threni · · Score: 5, Funny

    Is there one for Perl, but the other way around - where it's clear what the code is actually doing?

    1. Re:Perl by John+Bokma · · Score: 1

      Yes, it's called CPAN.

    2. Re:Perl by Anonymous Coward · · Score: 0

      There is no code.

    3. Re:Perl by countach · · Score: 1

      Yes there is, but nobody has ever been deemed worthy of winning.

  2. It's not just the obfuscation... by LikwidCirkel · · Score: 4, Interesting

    I find this very impressive, not so much for the obfuscation, but for packing so much functionality into a small bit of code....

    http://ioccc.org/2013/cable3/hint.html

    1. Re:It's not just the obfuscation... by hydrofix · · Score: 2

      There might be more to that entry than meets the eye. Quoting its description:

      CPU supports the full 8086/186 instruction set. Due to the complexities of the 8086’s arbitrary-length instruction decoding and flags, 8086 instructions are first converted to a simpler intermediate format before being executed. This conversion, along with instruction lengths and how each instruction modifies the flags, is assisted by some lookup tables which form part of the BIOS binary.

      The BIOS binary is over 12 kilobytes, so it raises the question as to which extent the emulation might be actually achieved by the BIOS.

    2. Re:It's not just the obfuscation... by icebike · · Score: 2

      I'm just glad the published these guys names.
      Every HR department now will know never to hire them for work on any production code.

      --
      Sig Battery depleted. Reverting to safe mode.
    3. Re:It's not just the obfuscation... by rusty0101 · · Score: 2

      Actually, the reverse is mostly true.

      Most companies want to be able to find developers who can do this, as it means that they have someone on staff (or available) who will go to the trouble of figuring out just what it is that the spagetti code that did make it to production actually does. Someone who can write this level of code, can often get the company in question out of trouble that even the original developer could not, or perhaps would charge excessively high "support" fees based on the perception that they are the only ones capable of reading the code they produced to begin with.

      That said, someone who can do this can probably put in all kinds of back door's to programs, but that's what you implement a code audit and QA department for.

      --
      You never know...
    4. Re:It's not just the obfuscation... by TheGratefulNet · · Score: 1

      we have guys at work who are paid to write obfuscated code (in java, no less) so that its harder for people to disassemble and figure out what the code is doing. whether I agree with that or not, I'm not the boss, but we have guys who do this at work, for actual pay (yes).

      --

      --
      "It is now safe to switch off your computer."
    5. Re:It's not just the obfuscation... by Anonymous Coward · · Score: 0

      That's no problem. None of these folks would really want work in a company with such an hr dept :)

    6. Re:It's not just the obfuscation... by cold+fjord · · Score: 1

      There are tools to obfuscate code. Won't those do the trick?

      --
      much of left-wing thought is a kind of playing with fire by people who don't even know that fire is hot - George Orwell
    7. Re:It's not just the obfuscation... by icebike · · Score: 1

      Code audit? Who's going to do that?
      One guy who wants to put obfuscated code in production systems is not likely to be audited by someone with the skills to detect it.

      --
      Sig Battery depleted. Reverting to safe mode.
  3. For example... by bhlowe · · Score: 3, Insightful

    char*_ = "'""/*"; #include #define m 21 #define o(l, k) for(l=0; lGP9$5-,#C?NX"]-35)>>t*3 o(e,4){ c[T] [e][t]=("5'##>4(" [T+t+T]-35)>>e*2 } } n(15) { s=T>9?m:(T&3)-3?15:36;o(e,s)o(t,2)c[T+19][e][t]="6*6,8*6.608.6264826668\ 865::(+;0(6+6-6/8,61638065678469.;88))()3(6,8*6.608.6264826668865:+;4)-*6-6/616365,\ -6715690.5;,89,81+,(023096/:40(8-7751)2)65;695(855(+*8)+;4**+4(((6.608.626482666886\ 5:+;4+4)0(8)6/61638065678469.;88)-4,4*8+4(((60(/6264826668865:+;4-616365676993-9:54\ +-14).;./347.+18*):1;-*0-975/)936.+:4*,80987(887(0(*)4.*""/4,4*8+4(((6264826668865:\ +;4/4-4+8-4)0(8)6365678469.;88)1/(6*6,6.60626466686:8)8-8*818.8582/9863(+;/""*6,6.6\ 0626466686:4(8)8-8*818.8582/9863(+;/,6.60626466686:8-818.8582/9864*4+4(0())+;/.6062\ 6466686:8/8380/7844,4-4*4+4(0())69+;/0626466686:818582/9864.4/4,4-4*4+4(0())+;" [e+E +e+t]-40; E+=s+s; } n(45){ if(T>i) { v(2,T,7); v(46,T,7); } v(2+T,44,7); } T=0; o(e, 42)o(t,m)h[T][e][t]--; while(R+i) { s = D=0; if (r-R) { n(19) if (G[R+i][T]+i) V=T/2 ; else if(G[R][T]+i) s++; if(s) { if(V>4){ V=9-V; D++; } V+=29; n(20) q(c[V][T][0],c [V][T][i],D); } } n(19) if((L=G[R][T])+i) { O=T-L; e=O>9; t=e?18-O :O; o(K,((t&3)-3? 16:37)){ if(K){ L=c[t+19][K-i][0]; O=c[t+19][K-i][i] ; } q(L,O,K && e); } } if(s) q( c[V][20][0], c[V][20][i], D); R--; } printf("\33[47;1f\33[?25h\33[40m"); return 0; } // TODO: Add comments.

    1. Re:For example... by davester666 · · Score: 5, Funny

      looks like it'll work. ship it. we'll fix any problems in v2.

      --
      Sleep your way to a whiter smile...date a dentist!
    2. Re:For example... by cold+fjord · · Score: 1

      You can't ship it in that condition, there is a comment in the code! Strip out the comment and then it should be ready to go.

      --
      much of left-wing thought is a kind of playing with fire by people who don't even know that fire is hot - George Orwell
    3. Re:For example... by kmoser · · Score: 1

      But if you remove the comments, how will the code know what it's supposed to do?

  4. It's amazing that they don't link to the source co by Anonymous Coward · · Score: 5, Insightful

    For a contest involving writing source code, it's astounding and infuriating that the judges did not link to the source code in the results.

  5. Ray tracer + web server + image encoder + clock by hydrofix · · Score: 5, Interesting

    I found this one a pretty mind-blowing entry. When compiled and run, it creates a web server at http://localhost:8224, which can be opened in a browser to display a ray-traced 3D scene of steel ball bearings on a checker-pattern surface, arranged to display the current time. Quoting the description:

    The program wears many hats (not literally). It is
    * a web server
    * a PNG encoder
    * a ray tracer
    * a clock

    Unlike the PC emulator entry, it does not require a binary blob and all the code and data fit within the 4 kilobyte limit.

    1. Re:Ray tracer + web server + image encoder + clock by Anonymous Coward · · Score: 0

      I noticed that in the link you are giving, the code is very obfuscated. So obfuscated that I can't even see it.

    2. Re:Ray tracer + web server + image encoder + clock by VortexCortex · · Score: 0

      Unlike the PC emulator entry, it does not require a binary blob and all the code and data fit within the 4 kilobyte limit.

      If you liked this you might have liked the 64k and 4k comp.s in the demoscene, which is unfortunately dead.

    3. Re:Ray tracer + web server + image encoder + clock by neiras · · Score: 1
    4. Re:Ray tracer + web server + image encoder + clock by Anonymous Coward · · Score: 0

      Looking at the #includes, I don't see libraries for PNG:

      #include
      #include
      #include
      #include

      Does the program include its own PNG format algorithms, or am I missing something?

      Same goes for the web server: did he really write his own web server in mills.c?

    5. Re:Ray tracer + web server + image encoder + clock by Anonymous Coward · · Score: 0

      Sorry, slashdot borked my copypasta.

      The #includes in mills.c (that I could decipher, anyway) are


      #include [math.h]
      #include [time.h]
      #include [unistd.h]
      #include [netinet/in.h]

    6. Re:Ray tracer + web server + image encoder + clock by hydrofix · · Score: 2

      Does the program include its own PNG format algorithms, or am I missing something?

      Same goes for the web server: did he really write his own web server in mills.c?

      Well in a way, yes for both. He only uses standard C libraries, so there is indeed no PNG library or an HTTP server #included. But due to the size limitations, the code can probably only produce one exact type of PNG image and the HTTP server can only serve one page, so those are not "proper" implementations by any means. For example, the HTTP server ignores the request path and the result of accessing http://localhost:8224/ http://localhost:8224/foo and http://localhost:8224/foo/bar is alwyas the same – pretty useless for a "real" HTTP server. If you look up the .C file, it's typeset in an artistic manner, resembling one of the ball bearings in the rendered end result. So, the point, like with many other IOCCC entries, is to demonstrate how some seemingly very complex tasks can be achieved by short, obfuscated C files.

    7. Re:Ray tracer + web server + image encoder + clock by stderr_dk · · Score: 1

      Does the program include its own PNG format algorithms, or am I missing something?

      The PNGs generated by the program are simple enough to be constructed more or less one byte at a time.

      Same goes for the web server: did he really write his own web server in mills.c?

      No, not really. At least not a fully functional one. His "webserver" simply waits for connections, read characters one at a time until it gets an empty line (the end of the HTTP requests), sends the "200 OK" and "Refresh: 1" headers, writes the PNG data directly to the socket and closes the connection. The "webserver" doesn't care what resources you request or if you use "GET", "HEAD", "POST" or something else.

      --
      alias sudo="echo make it yourself #" ; # https://pipedot.org/~stderr & http://soylentnews.org/~stderr
    8. Re:Ray tracer + web server + image encoder + clock by Anonymous Coward · · Score: 0

      A "web server" that basically only serves one thing is pretty simple to write. I'm not sure about PNG encoding specifically, but if you're generating the image by your own ray tracing method then it should be pretty easy to encode it to whatever standard by yourself, too.

      I still prefer this

    9. Re:Ray tracer + web server + image encoder + clock by Anonymous Coward · · Score: 2, Insightful

      in the demoscene, which is unfortunately dead

      Uh, no it's not?

    10. Re:Ray tracer + web server + image encoder + clock by Anonymous Coward · · Score: 0

      Wrong link, or am I failing to see the relevance? On a side note, I can't believe all the work that popped up around such a crappy program; sometimes, it's like watching Henry Selick work with dried-up play-doh.

    11. Re:Ray tracer + web server + image encoder + clock by Anonymous Coward · · Score: 0

      The scene has died several times during the years and it will also keep dying over and over again for whatever is the reason du jour. Until it stops, which is the sign that the scene has died.

    12. Re:Ray tracer + web server + image encoder + clock by cold+fjord · · Score: 1

      I found this one a pretty mind-blowing entry. ...

      The program wears many hats (not literally). It is

      * a web server
      * a PNG encoder
      * a ray tracer
      * a clock

      Unlike the PC emulator entry, it does not require a binary blob and all the code and data fit within the 4 kilobyte limit.

      And this is why I'm a big fan of OpenBSD's continuous code audits and general outlook regarding security.

      --
      much of left-wing thought is a kind of playing with fire by people who don't even know that fire is hot - George Orwell
    13. Re:Ray tracer + web server + image encoder + clock by prichardson · · Score: 0

      Are you seriously shitting on this guy for not implementing a generic solution? Would you go to an impressionist art gallery and lament the lack of photorealistic paintings? Would you go to a game of Fiasco and complain about the lack of interesting combat mechanics?

      --
      Help I'm a rock.
    14. Re:Ray tracer + web server + image encoder + clock by hydrofix · · Score: 1

      Err.. Well, let's just say I am sure he would have implemented as general of a solution as was possible within the constraints imposed by the rules, if that was the entrant's goal. Make no mistake, I have tremendous respect for this competition and the entrants. Sad to see there are such lamers on Slashdot showing an unreasonably hostile attitude for someone simply taking interest in someone else's work. You don't happen to be employed by the copyright mafia by any chance, do you?

  6. Re:It's amazing that they don't link to the source by Anonymous Coward · · Score: 1

    "The International Obfuscated C Code Contest

    The 22nd IOCCC Winners"

    This is the title of the page. Yet we miss:

    -the obfuscated C code
    -winners
    -C code
    -code

    Fck that.

  7. Largest small system emulator - Humbling by Flammon · · Score: 2

    Humbled after reading Largest small system emulator. http://ioccc.org/2013/cable3/hint.html

    1. Re:Largest small system emulator - Humbling by Anonymous Coward · · Score: 0

      My brain seriosly just exploded. I'm just going to stay here in the corner and cry for a while.

  8. Even their site is obfuscated by Anonymous Coward · · Score: 1

    Can someone parse this quote from the README for me?

    This year, several 8 people won 9 people won 15 awards.

    1. Re:Even their site is obfuscated by Anonymous Coward · · Score: 0

      Obviously, there were 15 awards and 9 winners. Sheesh!

      The winners were:

      4 - Yusuke Endoh (Most tweetable 1-liner, Most lazy SKIer, Most recyclable, Most solid)
      3 - Adrian Cable (Most partisan 1-liner, Largest small system emulator, Best of show)
      2 - Yves-Marie Morgan (Smallest large system simulator, Most playfully versatile)
      1 - Don Yang (Most catty)
      1 - J. David Lowe (Best sparkling utility)
      1 - Arch Robison (Most poetic use of strings)
      1 - Qiming Hou (Best use of 1 Infinite Loop)
      1 - Michael Birken (Best painting tool)
      1 - Christopher Mills (Most timely rendered)

    2. Re:Even their site is obfuscated by Anonymous Coward · · Score: 0

      Obviously, there were 15 awards and 9 winners. Sheesh!

      And the "several 8 people won" part?

    3. Re:Even their site is obfuscated by Anonymous Coward · · Score: 0

      Isn't it obvious? "Several 8" refers to a number between 1*8 and infinity * 8. In this case, it's 1.125*8.

  9. Re:It's amazing that they don't link to the source by Anonymous Coward · · Score: 0

    First link in the summary is the source code.

  10. Re:It's amazing that they don't link to the source by Art+Challenor · · Score: 4, Funny

    For a contest involving writing source code, it's astounding and infuriating that the judges did not link to the source code in the results.

    What did you expect? It's a contest for writing obfuscated code and you expect a webpage that has clear, concise information?

  11. Busted! by Trax3001BBS · · Score: 2

    "As I was writing up this description, I discovered I'm not the first person to write an obfuscated C sparkline utility! Vicent Martí created
    [this one](https://gist.github.com/vmg/1368661) years (!) ago. (My implementation is completely independent.)" http://ioccc.org/2013/dlowe/hint.text

    I fully believe this was a coincidence, but one can never say they hadn't seen it or similar before as it's would appear within their circle of interest.

    But to complete this project then find an older version must be deflating in some manner.

  12. In other news by Anonymous Coward · · Score: 1

    The International logically desiged, well documented, comprehensible and maintainable C code contest yet again received no entries this year.

    1. Re:In other news by EETech1 · · Score: 1

      That was funny +1

  13. Re:It's amazing that they don't link to the source by ericloewe · · Score: 1

    Navigate to "previous winners". It's all there.

  14. Microsoft MS-DOS 6.22 image by Anonymous Coward · · Score: 0

    While the 'cable3' entry's "bios" file is a stub, the dos6.22.img file looks a lot like a Microsoft MS-DOS v6.22 diskette image when opened with 7-Zip. Hopefully the IOCCC HQ will not be raided by a joint FBI-BSA Strike Team, as it appears to be still under support?!?:

    From Wikipedia:

    However the only versions of MS-DOS currently recognized as stand-alone OSs, and supported as such by Microsoft are MS-DOS 6.0 and 6.22, both of which remain available for download via their MSDN, volume license, and OEM license partner websites, for customers with valid login credentials.