isn't it though? I was pretty in awe myself.
12 days of christmasobfuscated C
19 Replies - 8790 Views - Last Post: 30 May 2009 - 03:12 PM
#17
Re: 12 days of christmas
Posted 30 May 2009 - 12:25 PM
Well, when I tried it I ended up getting these 3 errors. Anyone know why?
't' : undeclared identifier
'_' : undeclared identifier
'a' : undeclared identifier
'main' : function-style initializer appears to be a function definition
't' : undeclared identifier
'_' : undeclared identifier
'a' : undeclared identifier
'main' : function-style initializer appears to be a function definition
#18
Re: 12 days of christmas
Posted 30 May 2009 - 12:32 PM
Did you compile as a C or C++ program? Cause it should be compiled as a C program.
#19
Re: 12 days of christmas
Posted 30 May 2009 - 01:55 PM
Here are some features of C syntax your obfuscated code relies on:
1. Old C function declarations. That's when you had to declare the aruments not inside the parenthesis, but outside. For example:
Modern C:
Old C:
2. "_" is a valid variable name.
3. Array index evaluation can be done in any order. For example:
Compile it, you will see that both printf() statements are identical.
Couple all of the above with some crazy bit arithmetic and usage of newlines, and you get yourself an obfuscated code.
P.S. I just found an interesting link on this website. If you want to learn more about obfuscated code, check it out - http://www.dreaminco...showtopic=38102
1. Old C function declarations. That's when you had to declare the aruments not inside the parenthesis, but outside. For example:
Modern C:
void f(char c) { }
Old C:
void f() char c { }
2. "_" is a valid variable name.
3. Array index evaluation can be done in any order. For example:
int array[5] = {1,2,3,4,5};
printf("%d", array[0]);
printf("%d", 0[array]);
Compile it, you will see that both printf() statements are identical.
Couple all of the above with some crazy bit arithmetic and usage of newlines, and you get yourself an obfuscated code.
P.S. I just found an interesting link on this website. If you want to learn more about obfuscated code, check it out - http://www.dreaminco...showtopic=38102
This post has been edited by Dantheman: 30 May 2009 - 02:04 PM
#20
Re: 12 days of christmas
Posted 30 May 2009 - 03:12 PM
Very nice. Thanks dantheman
|
|

New Topic/Question
Reply




MultiQuote




|