[ILUG-BOM] whats obfuscation

Sankha Subhra Som sankha@[EMAIL-PROTECTED]
Thu Sep 26 15:43:12 IST 2002


Hi
Yes it prints n! and is pretty good at doing that(large precision)
I commented out the #include<stdio.h> and ran the preprocessor on the 
original file.
Then i ran indent on the result to give it a decent look.
Then i changed all the variables to more meaningful ones.
The thirteenth line looks something like this

for (l = 0; l < 14; putchar ("\t\"8)>l\"9!.)>vl"[l] ^ 'L'), ++l);

It is supposed to print something like
"Enter number: "
The perplexing part is the putchar() in the loop
Taking a close look at it you can see that he has a 14 character striing in 
the quotes "\t\"8)>l\"9!.)>vl" .This he indexes by [l]. While the loop 
executes he extracts each character systematically and does an bitwise 
exclusive OR with 'L' and prints the resulting character.This prints the 
string.
Now the question why does he do an XOR with 'L' is easy. He could have done 
an XOR with nethin for the matter but then the string in quotes would have 
been different.
If a XOR b = c
then a XOR c = b
This explains the 13th line.
Will try to make sense out of the remaining code.
-- 
SANKHA SUBHRA SOM
ATC - BIOINFORMATICS
TCS
KLK BUILDING.
HYDERABAD-1
Ph:(040)6787980-1024

********************************************************
        An anonymous digitoid
********************************************************
Everything happens to everybody sooner or later if there is time enough.




More information about the Linuxers mailing list