Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

We are sorry to see you leave - Beta is different and we value the time you took to try it out. Before you decide to go, please take a look at some value-adds for Beta and learn more about it. Thank you for reading Slashdot, and for making the site better!

Source Code For 22nd IOCCC Winners Has Been Released

Soulskill posted about a year ago | from the go-small-or-go-home dept.

Programming 47

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."

Sorry! There are no comments related to the filter you selected.

Perl (5, Funny)

Threni (635302) | about a year ago | (#45867741)

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

Re:Perl (1)

John Bokma (834313) | about a year ago | (#45867943)

Yes, it's called CPAN.

Re:Perl (0)

Anonymous Coward | about a year ago | (#45868211)

There is no code.

Re:Perl (1)

countach (534280) | about a year ago | (#45869091)

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

Java (-1)

Anonymous Coward | about a year ago | (#45869445)

Is there one for Java, but yet another way around -- where the reader doesn't fall asleep before it comes to something interesting?

It's not just the obfuscation... (4, Interesting)

LikwidCirkel (1542097) | about a year ago | (#45867809)

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 [ioccc.org]

Re:It's not just the obfuscation... (2)

hydrofix (1253498) | about a year ago | (#45867903)

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.

Re:It's not just the obfuscation... (2)

icebike (68054) | about a year ago | (#45868529)

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.

Re:It's not just the obfuscation... (2)

rusty0101 (565565) | about a year ago | (#45869835)

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.

Re:It's not just the obfuscation... (1)

icebike (68054) | about a year ago | (#45872805)

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.

Re:It's not just the obfuscation... (1)

TheGratefulNet (143330) | about a year ago | (#45869999)

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).

Re:It's not just the obfuscation... (1)

cold fjord (826450) | about a year ago | (#45870699)

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

Re:It's not just the obfuscation... (0)

Anonymous Coward | about a year ago | (#45870093)

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

For example... (3, Insightful)

bhlowe (1803290) | about a year ago | (#45867893)

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.

Re:For example... (5, Funny)

davester666 (731373) | about a year ago | (#45868567)

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

Re:For example... (1)

cold fjord (826450) | about a year ago | (#45870709)

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.

Re:For example... (1)

kmoser (1469707) | about a year ago | (#45885353)

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

It's amazing that they don't link to the source co (5, Insightful)

Anonymous Coward | about a year ago | (#45867955)

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.

Re:It's amazing that they don't link to the source (1)

Anonymous Coward | about a year ago | (#45868141)

"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.

Re:It's amazing that they don't link to the source (0)

Anonymous Coward | about a year ago | (#45868263)

First link in the summary is the source code.

Re:It's amazing that they don't link to the source (4, Funny)

Art Challenor (2621733) | about a year ago | (#45868329)

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?

Re:It's amazing that they don't link to the source (1)

ericloewe (2129490) | about a year ago | (#45870245)

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

Ray tracer + web server + image encoder + clock (5, Interesting)

hydrofix (1253498) | about a year ago | (#45867963)

I found this one [ioccc.org] a pretty mind-blowing entry. When compiled and run, it creates a web server at http://localhost:8224 [localhost] , 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.

Re:Ray tracer + web server + image encoder + clock (0)

Anonymous Coward | about a year ago | (#45868171)

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

Re:Ray tracer + web server + image encoder + clock (1)

neiras (723124) | about a year ago | (#45868305)

Re:Ray tracer + web server + image encoder + clock (0)

VortexCortex (1117377) | about a year ago | (#45868215)

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.

Re:Ray tracer + web server + image encoder + clock (2, Insightful)

Anonymous Coward | about a year ago | (#45868631)

in the demoscene, which is unfortunately dead

Uh, no it's not? [pouet.net]

Re:Ray tracer + web server + image encoder + clock (0)

Anonymous Coward | about a year ago | (#45870039)

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.

Re:Ray tracer + web server + image encoder + clock (0)

Anonymous Coward | about a year ago | (#45868455)

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?

Re:Ray tracer + web server + image encoder + clock (0)

Anonymous Coward | about a year ago | (#45868471)

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]

Re:Ray tracer + web server + image encoder + clock (2)

hydrofix (1253498) | about a year ago | (#45868591)

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/ [localhost] http://localhost:8224/foo [localhost] and http://localhost:8224/foo/bar [localhost] 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.

Re:Ray tracer + web server + image encoder + clock (0)

prichardson (603676) | about a year ago | (#45871155)

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?

Re:Ray tracer + web server + image encoder + clock (1)

hydrofix (1253498) | about a year ago | (#45874857)

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 [ioccc.org] , 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?

Re:Ray tracer + web server + image encoder + clock (1)

stderr_dk (902007) | about a year ago | (#45868595)

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.

Re:Ray tracer + web server + image encoder + clock (0)

Anonymous Coward | about a year ago | (#45868603)

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 [youtube.com]

Re:Ray tracer + web server + image encoder + clock (0)

Anonymous Coward | about a year ago | (#45868793)

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.

Re:Ray tracer + web server + image encoder + clock (1)

cold fjord (826450) | about a year ago | (#45870741)

I found this one [ioccc.org] 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 [openbsd.org] continuous code audits [openbsd.org] and general outlook regarding security.

Largest small system emulator - Humbling (2)

Flammon (4726) | about a year ago | (#45868239)

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

Re:Largest small system emulator - Humbling (0)

Anonymous Coward | about a year ago | (#45870089)

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

Even their site is obfuscated (1)

Anonymous Coward | about a year ago | (#45868259)

Can someone parse this quote from the README [ioccc.org] for me?

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

Re:Even their site is obfuscated (0)

Anonymous Coward | about a year ago | (#45868509)

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)

Re:Even their site is obfuscated (0)

Anonymous Coward | about a year ago | (#45868639)

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

And the "several 8 people won" part?

Re:Even their site is obfuscated (0)

Anonymous Coward | about a year ago | (#45868665)

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

Busted! (2)

Trax3001BBS (2368736) | about a year ago | (#45868677)

"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 [ioccc.org]

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.

In other news (1)

Anonymous Coward | about a year ago | (#45869055)

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

Re:In other news (1)

EETech1 (1179269) | about a year ago | (#45873735)

That was funny +1

Microsoft MS-DOS 6.22 image (0)

Anonymous Coward | about a year ago | (#45873897)

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.

Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?