Disguising computer code

User avatar
AlanMiller
BronzeLounger
Posts: 1545
Joined: 26 Jan 2010, 11:36
Location: Melbourne, Australia

Disguising computer code

Post by AlanMiller »

There are lots of techniques to make computer source code difficult for somebody else to figure out or plagiarize. This is the most obscure example I've seen. It is standard C source code, designed to run as a Windows console program. Anybody care to hazard a guess at what it does? :evilgrin:

Code: Select all

_(__,___,____,_____){___/__<=_____?_(__,___+_____,____,_____):!(___%__)?_(__,___+_____,___%__,_____):___%__==___/
__&&!____?(printf("%d\t",___/__),_(__,___+_____,____,_____)):(___%__>_____&&___%__<___/__)?_(__,___+_____,
____+!(___/__%(___%__)),_____):___<__*__?_(__,___+_____,____,_____):0;}main(void){_(100, 0, 0, 1);}
Alan

You could always run it and see of course!

User avatar
John Gray
PlatinumLounger
Posts: 5420
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Disguising computer code

Post by John Gray »

I always liked the (necessarily short) Assembly language programs which were composed only in printable ASCII characters, 0x20-0x7F (or so). Fiendishly difficult to write, but made somewhat easier since you could achieve the same result by different mechanisms. Probably the best-known example is the 68-byte EICAR AV Test File (in the form of a .com file):

Code: Select all

X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
As to Alan's query...
Spoiler
It prints the answer "42" ?
John Gray

"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...

User avatar
AlanMiller
BronzeLounger
Posts: 1545
Joined: 26 Jan 2010, 11:36
Location: Melbourne, Australia

Re: Disguising computer code

Post by AlanMiller »

John Gray wrote:As to Alan's query...
Spoiler
It prints the answer "42" ?
Well, I guess that would have to be correct, since your answer is a superset of the solution set ... of everything.

Alan