By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,564 Members | 810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,564 IT Pros & Developers. It's quick & easy.

Stupid question

P: n/a
Hi everyone!
Can anyone explain me this program?
I'm getting really confused.
thx in advance.

Laszlo Kis-Adam
<df******@freemail.hu>

"
#include <stdio.h>
main(t,_,a)char *a;{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==2?_<13?
main(2,_+1,"%s %d %d\n"):9:16:t<0?t<-72?main(_,t,
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n{n+,/+#\
n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw\
' i;# ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk \
nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{\
n' ')# }'+}##(!!/")
:t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
:0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),
a+1);}
"
Nov 21 '06 #1
Share this Question
Share on Google+
19 Replies


P: n/a
Leslie Kis-Adam said:
Hi everyone!
Can anyone explain me this program?
I'm getting really confused.

#include <stdio.h>
main(t,_,a)char *a;
It's actually very simple. Since main is required to take either no, or two,
parameters, this program (in which main takes /three/ parameters) doesn't
obey the rules of C, and so its behaviour is undefined. It might do
anything at all.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Nov 22 '06 #2

P: n/a
Richard Heathfield <rj*@see.sig.invalidwrites:
Leslie Kis-Adam said:
>Hi everyone!
Can anyone explain me this program?
I'm getting really confused.

#include <stdio.h>
main(t,_,a)char *a;

It's actually very simple. Since main is required to take either no, or two,
parameters, this program (in which main takes /three/ parameters) doesn't
obey the rules of C, and so its behaviour is undefined. It might do
anything at all.
Assuming that the program is for a hosted implementation that doesn't
document this form of main() as an extension.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 22 '06 #3

P: n/a

Leslie-and-or-Lazlo Kis-Adam wrote:
Can anyone explain me this program?
(snip obfuscated source code)
Looks like an entry to the "Obfuscated C Contest". (Google that
if you don't know what it is.)
I'm getting really confused.
Obfuscation is the whole idea. You didn't think that C
programmers actually write code like that on the job, did you?
(Well, there's a certain ex-coworker of mine who used to write
code ALMOST that obfuscated... but he got fired for it, and
rightly so.)

If you really, really want a disection of this beast, I'm afraid
you'll have to pester someone else here into giving you one; I
don't torture my brain that way these days. I do structured
programming, not demolished programming.
thx in advance.
You're welcome, in retrospect.

Cheers,
Robbie Hatley
lone wolf intj at pac bell dot net
(Put "[usenet]" in subject to bypass spam filter.)
Nov 22 '06 #4

P: n/a
Keith Thompson said:
Richard Heathfield <rj*@see.sig.invalidwrites:
>Leslie Kis-Adam said:
>>Hi everyone!
Can anyone explain me this program?
I'm getting really confused.

#include <stdio.h>
main(t,_,a)char *a;

It's actually very simple. Since main is required to take either no, or
two, parameters, this program (in which main takes /three/ parameters)
doesn't obey the rules of C, and so its behaviour is undefined. It might
do anything at all.

Assuming that the program is for a hosted implementation that doesn't
document this form of main() as an extension.
Hosted? Granted. But I believe your other point is incorrect, since it would
apply only to a C99 program, which this clearly is not, as it relies on
implicit int.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Nov 22 '06 #5

P: n/a
Leslie Kis-Adam wrote:
Hi everyone!
Can anyone explain me this program?
I'm getting really confused.
thx in advance.
It's making recursive calls to main(int, int, char *) (which already
takes us out of "Standard C conformance", which is slightly disappointing.)

There is a lot of conditional logic using the ternary operator, which,
if it were written in if-else syntax, might make the program a little
easier to follow. There are a couple of places that depend on operator
precedence as well, and stupid things like the fact that 31[a] is
equivalent to a[31]. Then there's the use of "_" as a scalar,
defaulting to "int", and the use of logical operators to delimit
statements (as opposed to using braces and semicolons.)

Getting past the mechanical level of obfuscation, which is really little
more than "ugly code", and which the author probably used some program
to make anyway, you will find that it's basically what you might call a
polymorphic function being called recursively, or maybe you would call
it a switch statement (but definitely being called recursively).

Then it does some kind of lookup-and-substitution, and all I can tell
you about that is it involves looking for the "/" character somehow.

If you really want to figure this program out, I would suggest
re-writing it, making use of whitespace and reasonable identifier names.
Instead of using the function "main" for the recursion, make another
function. Lose the ternary operators in favor of if-else. Where the
author used the side effects of expressions delimited by logical && and
||, use curly braces and semicolons. Then maybe you can step through it
in a debugger or something and figure out how the cipher actually works.
Nov 22 '06 #6

P: n/a
Richard Heathfield wrote:
Keith Thompson said:
>Richard Heathfield <rj*@see.sig.invalidwrites:
>>Leslie Kis-Adam said:

Hi everyone!
Can anyone explain me this program?
I'm getting really confused.

#include <stdio.h>
main(t,_,a)char *a;
It's actually very simple. Since main is required to take either no, or
two, parameters, this program (in which main takes /three/ parameters)
doesn't obey the rules of C, and so its behaviour is undefined. It might
do anything at all.
Assuming that the program is for a hosted implementation that doesn't
document this form of main() as an extension.

Hosted? Granted. But I believe your other point is incorrect, since it would
apply only to a C99 program, which this clearly is not, as it relies on
implicit int.
You guys are arguing about how it's not "Standard C" (which it's not),
but not making any indication that you can see how the cipher is
implemented. I can't. I can get *to* the cipher. I can understand how
it's blocked, more or less, but I could not tell you even in vague terms
how it works.

I know you guys make a hobby out of establishing the standard-C-ness of
the newsgroup, but come on! How does this program stop at 12 choruses?
How does it count your true love's gifts for each day? How does the
string decipher know how to pick each character from the ciphertext it
gets?
Here, let's make the program Standard-C conforming, no warnings with
$ cc -g -ansi --pedantic -o obfusc obfusc.c
And maybe put in a little whitespace (still horrible):
/* file: obfusc.c */
#include <stdio.h>
int gifts(int t, int _, char *a)
{
return !0 < t ? t < 3 ? gifts(-79, -13, a + gifts(-87, 1 - _,
gifts(-86, 0,
a + 1) +
a)) : 1,
t < _? gifts(t + 1, _, a) : 3, gifts(-94, -27 + t, a)
&& t == 2 ? _ < 13 ? gifts(2, _ + 1,
"%s %d %d\n") : 9 : 16 : t < 0 ? t < -72 ? gifts(_, t,
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n{n+,/+#\
n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw\
' i;# ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk \
nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{\
n' ')# }'+}##(!!/")
: t < -50 ? _ == *a ? putchar(31[a]) : gifts(-65, _,
a + 1) : gifts((*a == '/') + t, _, a + 1)
: 0 < t ? gifts(2, 2, "%s") : *a == '/'
|| gifts(0, gifts(-61, *a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),
a + 1);
}

int main(int argc, char **argv)
{
return gifts(argc, argc, argv[0]);
}

/* end: obfusc.c */
Nov 22 '06 #7

P: n/a
Richard Heathfield <rj*@see.sig.invalidwrites:
Keith Thompson said:
>Richard Heathfield <rj*@see.sig.invalidwrites:
>>Leslie Kis-Adam said:
Hi everyone!
Can anyone explain me this program?
I'm getting really confused.

#include <stdio.h>
main(t,_,a)char *a;

It's actually very simple. Since main is required to take either no, or
two, parameters, this program (in which main takes /three/ parameters)
doesn't obey the rules of C, and so its behaviour is undefined. It might
do anything at all.

Assuming that the program is for a hosted implementation that doesn't
document this form of main() as an extension.

Hosted? Granted. But I believe your other point is incorrect, since
it would apply only to a C99 program, which this clearly is not, as
it relies on implicit int.
C99 says that an implementation may define other forms of main(), but
that permission is redundant given C99 4p6:

A conforming implementation may have extensions (including
additional library functions), provided they do not alter the
behavior of any strictly conforming program.

C90 has the same wording.

For that matter, a C99 implementation could provide implicit int as an
extension, though it would still be required to issue a diagnostic (in
conforming mode) for any use of it.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 22 '06 #8

P: n/a
"Leslie Kis-Adam" <df******@freemail.huwrote in message
news:ek**********@rs18.lvs.iif.hu...
Hi everyone!
Can anyone explain me this program?
I'm getting really confused.
thx in advance.
Two things you should know:

#1: There is some sort of an obfuscated 'C' contest, see here:

http://www.ioccc.org/main.html

The winning entries from previous years are quite ... obfuse.

#2: Some companies make software that will transform 'C' code into code
that compiles equivalently for the purpose of protecting intellectual
property when source that compiles must be distributed. I've never used
such software, and I'm not sure that it could do such a downtown job as the
code you supplied.

Where did you get this code?

Dave.

Nov 22 '06 #9

P: n/a
This should be enough to make it obvious:

/* file:obfusc.c */
static const char *string1 = "%s %d %d\n"; /* no printf(), so not a
format string -- that's a red herring. */
static const char *string2 =
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r
:'d*'3,}{w+K w'K:'+}e#';dq#'l
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw'
i;# ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw'
iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n'
')# }'+}##(!!/";
static const char *string3 = "%s"; /* no printf(), so not a format
string */
static const char *string4 = "!ek;dc
i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry";
#include <stdio.h>
int gifts(int t, int u, char *a) {
return !0 < t ? t < 3 ? gifts(-79, -13, a + gifts(-87, 1 - u,
gifts(-86, 0, a + 1) + a))
: 1, t < u ? gifts(t + 1, u, a)
: 3, gifts(-94, -27 + t, a) && t == 2 ? u < 13 ? gifts(2, u +
1, string1)
: 9
: 16
: t < 0 ? t < -72 ? gifts(u, t, string2)
: t < -50 ? u == *a ? putchar(31[a]) /* identical to
putchar(a[31]) -- this is where stuff get spit out */
: gifts(-65, u, a + 1)
: gifts((*a == '/') + t, u, a + 1)
: 0 < t ? gifts(2, 2, string3)
: *a == '/' || gifts(0, gifts(-61, *a,
string4), a + 1);
}

int main(int argc, char **argv)
{
return gifts(argc, argc, argv[0]);
}

/*
Consider how recursion and a simple table might be helpful, given this
hint:
"On the <12day of Christmas my true love gave to me
<12drummers drumming, <11pipers piping, <10lords a-leaping,
<9ladies dancing, <8maids a-milking, <7swans a-swimming,
<6geese a-laying, <5gold rings;
<4calling birds, <3french hens, <2turtle doves
and a partridge in a pear tree."
*/

Nov 22 '06 #10

P: n/a
Keith Thompson wrote:
Richard Heathfield <rj*@see.sig.invalidwrites:
Keith Thompson said:
Richard Heathfield <rj*@see.sig.invalidwrites:
Leslie Kis-Adam said:
Hi everyone!
Can anyone explain me this program?
I'm getting really confused.

#include <stdio.h>
main(t,_,a)char *a;

It's actually very simple. Since main is required to take either no, or
two, parameters, this program (in which main takes /three/ parameters)
doesn't obey the rules of C, and so its behaviour is undefined. It might
do anything at all.

Assuming that the program is for a hosted implementation that doesn't
document this form of main() as an extension.
Hosted? Granted. But I believe your other point is incorrect, since
it would apply only to a C99 program, which this clearly is not, as
it relies on implicit int.

C99 says that an implementation may define other forms of main(), but
that permission is redundant given C99 4p6:

A conforming implementation may have extensions (including
additional library functions), provided they do not alter the
behavior of any strictly conforming program.

C90 has the same wording.
Using that wording, I don't believe there is a guarantee that execution
of the program starts with main(). It allows a declaration of int
main(int, int, char *) to really mean that execution starts at start().
(It would be a rather silly extension, of course.)
For that matter, a C99 implementation could provide implicit int as an
extension, though it would still be required to issue a diagnostic (in
conforming mode) for any use of it.
It could, but the behaviour would not be defined by the C standard. As
a result, it could provide the syntax of implicit int to mean implicit
void. And in that case, I'm not so sure it would be a silly extension.

Nov 22 '06 #11

P: n/a
Keith Thompson said:

<snip>
C99 says that an implementation may define other forms of main(), but
that permission is redundant given C99 4p6:

A conforming implementation may have extensions (including
additional library functions), provided they do not alter the
behavior of any strictly conforming program.

C90 has the same wording.
So you are claiming that the behaviour of the program is - what?
Well-defined? Clearly not, for various reasons (not least of which is that
it violates at least one "shall" that is not a constraint).
Implementation-defined? Clearly not, or my implementation would have to
document what it makes of int main(int, int, char *). Unspecified? Clearly
not, since this classification only applies to correct behaviour, and it is
obvious that any compiler is allowed to reject the program as incorrect.
Locale-specific? Clearly not, since - again - the implementation would have
to document it. Doesn't leave a lot of scope, does it? The only behaviour
classification I haven't mentioned is of course "undefined".

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Nov 22 '06 #12

P: n/a
David T. Ashley said:

<snip>
Where did [Leslie] get this code?
It's been knocking around for years. I presume it's an old IOCCC winner.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Nov 22 '06 #13

P: n/a
Richard Heathfield <rj*@see.sig.invalidwrites:
Keith Thompson said:
<snip>
>C99 says that an implementation may define other forms of main(), but
that permission is redundant given C99 4p6:

A conforming implementation may have extensions (including
additional library functions), provided they do not alter the
behavior of any strictly conforming program.

C90 has the same wording.

So you are claiming that the behaviour of the program is - what?
Well-defined? Clearly not, for various reasons (not least of which is that
it violates at least one "shall" that is not a constraint).
Implementation-defined? Clearly not, or my implementation would have to
document what it makes of int main(int, int, char *). Unspecified? Clearly
not, since this classification only applies to correct behaviour, and it is
obvious that any compiler is allowed to reject the program as incorrect.
Locale-specific? Clearly not, since - again - the implementation would have
to document it. Doesn't leave a lot of scope, does it? The only behaviour
classification I haven't mentioned is of course "undefined".
It's undefined *unless* the implementation meets certain conditions.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 22 '06 #14

P: n/a
Keith Thompson said:
Richard Heathfield <rj*@see.sig.invalidwrites:
>Keith Thompson said:
<snip>
>>C99 says that an implementation may define other forms of main(), but
that permission is redundant given C99 4p6:

A conforming implementation may have extensions (including
additional library functions), provided they do not alter the
behavior of any strictly conforming program.

C90 has the same wording.

So you are claiming that the behaviour of the program is - what?
Well-defined? Clearly not, for various reasons (not least of which is
that it violates at least one "shall" that is not a constraint).
Implementation-defined? Clearly not, or my implementation would have to
document what it makes of int main(int, int, char *). Unspecified?
Clearly not, since this classification only applies to correct behaviour,
and it is obvious that any compiler is allowed to reject the program as
incorrect. Locale-specific? Clearly not, since - again - the
implementation would have to document it. Doesn't leave a lot of scope,
does it? The only behaviour classification I haven't mentioned is of
course "undefined".

It's undefined *unless* the implementation meets certain conditions.
That's also true of fflush(stdin), j = ++i + i++, and so on and so forth.
Would you argue that those, too, are undefined unless the implementation
meets certain conditions?

So what do we mean by "the" implementation? The code was posted in
comp.lang.c, where it is reasonable to expect that quite a few people using
quite a few different compilers will have a go at compiling it. So there
isn't really any such thing as "the" implementation, although of course we
all use the phrase.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Nov 22 '06 #15

P: n/a
Richard Heathfield <rj*@see.sig.invalidwrites:
Keith Thompson said:
>Richard Heathfield <rj*@see.sig.invalidwrites:
[...]
>It's undefined *unless* the implementation meets certain conditions.

That's also true of fflush(stdin), j = ++i + i++, and so on and so forth.
Would you argue that those, too, are undefined unless the implementation
meets certain conditions?
I think you're taking my pedantic quibble too seriously. 8-)}

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 22 '06 #16

P: n/a
Keith Thompson said:
Richard Heathfield <rj*@see.sig.invalidwrites:
>Keith Thompson said:
>>Richard Heathfield <rj*@see.sig.invalidwrites:
[...]
>>It's undefined *unless* the implementation meets certain conditions.

That's also true of fflush(stdin), j = ++i + i++, and so on and so forth.
Would you argue that those, too, are undefined unless the implementation
meets certain conditions?

I think you're taking my pedantic quibble too seriously. 8-)}
If you were *right*, I *would* take it seriously. :-)

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Nov 22 '06 #17

P: n/a
dc*****@connx.com wrote:
This should be enough to make it obvious:

/* file:obfusc.c */
static const char *string1 = "%s %d %d\n"; /* no printf(), so not a
format string -- that's a red herring. */
static const char *string2 =
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r
:'d*'3,}{w+K w'K:'+}e#';dq#'l
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw'
i;# ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw'
iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n'
')# }'+}##(!!/";
static const char *string3 = "%s"; /* no printf(), so not a format
string */
static const char *string4 = "!ek;dc
i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry";
#include <stdio.h>
int gifts(int t, int u, char *a) {
return !0 < t ? t < 3 ? gifts(-79, -13, a + gifts(-87, 1 - u,
gifts(-86, 0, a + 1) + a))
: 1, t < u ? gifts(t + 1, u, a)
: 3, gifts(-94, -27 + t, a) && t == 2 ? u < 13 ? gifts(2, u +
1, string1)
: 9
: 16
: t < 0 ? t < -72 ? gifts(u, t, string2)
: t < -50 ? u == *a ? putchar(31[a]) /* identical to
putchar(a[31]) -- this is where stuff get spit out */
: gifts(-65, u, a + 1)
: gifts((*a == '/') + t, u, a + 1)
: 0 < t ? gifts(2, 2, string3)
: *a == '/' || gifts(0, gifts(-61, *a,
string4), a + 1);
}

int main(int argc, char **argv)
{
return gifts(argc, argc, argv[0]);
}

/*
Consider how recursion and a simple table might be helpful, given this
hint:
"On the <12day of Christmas my true love gave to me
<12drummers drumming, <11pipers piping, <10lords a-leaping,
<9ladies dancing, <8maids a-milking, <7swans a-swimming,
<6geese a-laying, <5gold rings;
<4calling birds, <3french hens, <2turtle doves
and a partridge in a pear tree."
*/
Tks very much!
Laszlo Kis-Adam
Nov 22 '06 #18

P: n/a
David T. Ashley wrote:
"Leslie Kis-Adam" <df******@freemail.huwrote in message
news:ek**********@rs18.lvs.iif.hu...
>Hi everyone!
Can anyone explain me this program?
I'm getting really confused.
thx in advance.

Two things you should know:

#1: There is some sort of an obfuscated 'C' contest, see here:

http://www.ioccc.org/main.html

The winning entries from previous years are quite ... obfuse.

#2: Some companies make software that will transform 'C' code into code
that compiles equivalently for the purpose of protecting intellectual
property when source that compiles must be distributed. I've never used
such software, and I'm not sure that it could do such a downtown job as the
code you supplied.

Where did you get this code?

Dave.
Tks for the hints. Actually I've got a hint from my lecturer Phd. Andras
Poppe, that there is a code like this, and one of my classmates shared
it on a forum.

Laszlo Kis-Adam
Nov 22 '06 #19

P: n/a
Robbie Hatley wrote:
Leslie-and-or-Lazlo Kis-Adam wrote:
>Can anyone explain me this program?
(snip obfuscated source code)

Looks like an entry to the "Obfuscated C Contest". (Google that
if you don't know what it is.)
>I'm getting really confused.

Obfuscation is the whole idea. You didn't think that C
programmers actually write code like that on the job, did you?
(Well, there's a certain ex-coworker of mine who used to write
code ALMOST that obfuscated... but he got fired for it, and
rightly so.)

If you really, really want a disection of this beast, I'm afraid
you'll have to pester someone else here into giving you one; I
don't torture my brain that way these days. I do structured
programming, not demolished programming.
>thx in advance.

You're welcome, in retrospect.

Cheers,
Robbie Hatley
lone wolf intj at pac bell dot net
(Put "[usenet]" in subject to bypass spam filter.)

Well, thx for NOT torturing your brain! :D
Actually,
Leslie Kis-Adam
Laszlo Kis-Adam
László Kis-Ádám
Kis-Adam Laszlo
Kis-Ádám László
are the same.
László, or Laszlo means Leslie in english.
My real or original name is: "Kis-Ádám László" in this order.
Nov 22 '06 #20

This discussion thread is closed

Replies have been disabled for this discussion.