The results of the 21st IOCCC contest

Announced the winners the 21st international contest of obfuscated code in C. As usual, the participants were surprised by the ability to cram some incredible things in the program up to 4096 bytes. To get the maximum pleasure, the organizers recommend to watch version without spoilers and try to understand a program's code, what it does.

For example, making such a program?
the
 main(l
,a,n,d)char**a;{
for(d=atoi(a[1])/10*80-
atoi(a[2])/5-596;n="@NKA\
CLCCGZAAQBEAADAFaISADJABBA^\
SNLGAQABDAXIMBAACTBATAHDBAN\
ZcEMMCCCCAAhEIJFAEAAABAfHJE\
TBdFLDAANEfDNBPHdBcBBBEA_AL\
H E L L O, W O R L D! "
[l++-3];)for(;n-- > 64;)
putchar(!d+++33^
l&1);}

Response
Right, print the world map.



And not just prints, but still notes the location on the map (symbol ", or # coordinates that can be specified at startup).
By the way, is the "best small program" on the IOCCC 1992.


The inventor of the binary lambda calculus John Tromp presented to the contest IOCCC program tromp.c with a minimal implementation of binary λ-calculus.

the
 Int L[A],m,b*D=A,
*c*a=L,C*U=L,u;s
(_){u--&&s(a=*a);}
char*B,I,O;S(){b=b
--?b:m/read(0,&I,1
)-1;return~I>>b&1;
}k(l,u){for(;l<=u;
U-L<A?*U++=46^l++[
"-,&;,,/.--/,:-,'/"
".-,-,,/.-,*,//..,"
]:exit(5));}p(Int*m){
return!*U?*m=S()?U++,!S
()?m[1]=p (U++), 2:3:1,p(U)
:S()?U+=2:p(U[1]++),U-m;}x(
c){k(7*!b,9);*U++=b&&S();c&&x
(b);}d(Int*l){--l[1]||d(l[d(*l),
*l=B,B=l,2]);}main(e){for(k(10,33
),a[4]-=m=e-2&7,a[23]=p(U),b=0;;e-2
?e?e-3?s(D=a),C=a [3],++1[a=a[2]],d(
D):c?D=c,c=*D,*D= a,a=D:exit(L[C+1])
:C--<23?C=u+m&1?O =O+O|C&a 1.9:write(m
||(O=C+28),&O,1)+ 1:(S(),x(0<b++?k(0,
6),U[-5]=96:0)):( D=B?B:calloc(4,X))
?B=*D,*D=c,c=D,D[ 2]=a,a[++D[1]]++,D
[3]=++C+u:exit(6) )e=L[C++],u=L[C];} 

However, not included even in the top three winners.

the First place. Perfect obfuscation
zeitak.c
Very subtly obfuscated code. Even if the analysis deobfuscating version zeitak_deobfucate.c, it is very difficult to understand what she's doing.

Second place. The most simple use C
hamano.c
Funny app encrypts your texts by the algorithm the dancing men when generating PDF files.
Well, and the program code as a hint:
Code
 #define \
D(s)"<<"#s">>"
#define q(s)p(#s)
#define S " endobj "
#define Y "endstream"S
#include <stdio.h>
#define o(s) b[s]=_;\
p("%u 0 obj",s);
#define E for (c=d;c < 123;c++)
#define DANCE "trailer "D\
(/Root 3 0 R /Size %d) "\nstartxref %u %%%%EOF\n*/"
#define p(s, ...) _+=printf(s, ##__VA_ARGS__)
#define C "<</Type/Page /Parent %d %d R /Resources <<\
/ProcSet[ /PDF/Text]/Font <</U"D(/Subtype/Type1/BaseFont\
/Courier) " /T<</Subtype/Type3 /FontBBox[0 0 10 10]/FontMatrix[\
%f 0 0 % f 0 0]/FirstChar %d/LastChar %d/Encoding < < /Differences[%d"
typedef int N;typedef char*Nyan;typedef char A;N a,b[64],d=65,_,v
[32]={84,0,64,282,90,74,330,85,93,173,167,176,80,208,81,13,7,87
,160,346,32,128,170,218,16,26}; Nyan w[]={"+*-(,&&","+*,&&"
,"+*.&/&","+*/*/+","+*())'('" ,"+**&)&","+*(&'&","+*'*'+",
"","+,./","+,-,./","+--,+*" ,"","+,(/","+,),(/","+-),+*"
,"10 d0 0 ","8 7 2 2 re" ,"+*+."'@'mi +/+/(mi"};Nyan
nyan(Nyan _N y,A n){
N g=v[~-y%32];Nyan
s=w[g>>n&3|n*2];
for(a=0;*_=*s++;
a++,_++,*_++=32)
{*_+=*_-32?10:0;
if(a%2&&*_/16==3
){if(g>>8)*_=105-*_;
_++;*_++=32;*_=~-a&&a-13
?108:109;}}return n?n-9?nyan
(_,y,n-2):_:nyan(_+=~y&''?sprintf
(_,17[w]):0,y,9);}N main(N, c){A e[256];
p("/*%%PDF-1.3%%*/")-2;q(#include<stdio.h>\n);
q(#define o *_++&&*_-41\n#define);p(" endstream ");q
(main(){for(;*_++; *_-40?:putchar(o?*_:o?10:41));\n)
;q(#define endobj return 0;}\n);q(typedef int ET;/)
;q(*);o(1)*b=~(p(D (/Length 2 0 R)"stream\n"))
;for(p("BT 12 818" " Td/%c 12 Tf 12 TL%%%c/"

getchar(),~c;c-10? p("/%c 12 Tf(\\%o)"
"Tj",v[~-c%' '<25[ v]&&!~-(~-c/'@')?0
:7],c):(p("()'"))) ;p("%%\";\nET ");*
b-=~_;p(Y"/*");E{a =nyan(e+sprintf(e,
16[w]),c,6)-e;o(c - 59)p(D(/Length %d)
"stream\n%s"Y,a,e) ;}o(2)p(" %u"S,*b);
o(3)p(D(/Pages 4 0 R)S);o(4)p(D(/Count
1/MediaBox[0 0 595 842]/Kids[5 0 R])S)
;o(5)p(C,4,0,6 e-2, 6e-2f,d 122,d);E p(
"/%c",~-c/6+~14?c: d);q(]>>/CharProcs<<)
;E if(~-c/6+~14)p( "/%c %d 0 R",c,c+~58);
for(q (>>/Widths[), c=59;--c;p(" 10"));a=p
("]>>>>>>/Contents 1 0 R>>"S);for(p("xref\
0% d ",--d);c<d;p("%010u\
%05d n ",*(c+a+a+b),NULL));
return!(p(DANCE,d,a));} 

Third place. Steganography
vik.c
Application of steganography for hiding image PNG or the text inside the other PNG images, and then pulls back. The secret bits are added to lower the RGB values. As a bonus, the author provided a picture of chocolates that has a unique quality: after encoding and subsequent decoding of the image code appears valid Brainfuck program, and it can run without a third-party interpreter.

Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

The use of Lisp in production

FreeBSD + PostgreSQL: tuning the database server

As we did a free Noodle for iOS and how we plan to earn