/* decode.c (saitou.c) - Eventually self-reproducing program Don Yang (uguu.org) Newline = ! (33) Space = ] to ~ (93 to 126) Code = # to [ (35 to 91) 02/28/00 */ #include #define T_BLOCK_BASE (176 - '!') #define TEMPLATE_SIZE (236 + 179 + 226) #define CODE_SIZE 350 #define XOR_KEY 6 char /* Encoded data */ *data = #include"aku.h" #include"soku.h" #include"zan.h" "*i]5471[=ohr&o*t*q*`*d*v*r;027*~=h./}tcr" "sth&t:r9b].,b-725-.t--//#r[ (TEMPLATE_SIZE + CODE_SIZE * 2) ? ';' : (x = data [ (rIndex++ - TEMPLATE_SIZE) % (CODE_SIZE + 1) + TEMPLATE_SIZE ]) ? x ^ (plain ? XOR_KEY : 0) : (plain = '\"'); } /* Writer */ main() { wIndex = sprintf(output, "char*d="); rIndex = plain = 0; for(fIndex = 1; fIndex < *data + T_BLOCK_BASE;) if( (block = data[fIndex++]) != '!' ) { if( block < ']' ) { if( !plain ) output[wIndex++] = '\"'; for(i = '#' + (plain ? 0 : 1); i < block; i++) output[wIndex++] = nextchar(); output[wIndex++] = plain ? nextchar() : '\"'; } else for(i = ']' - 1; i < block; i++) output[wIndex++] = ' '; } else output[wIndex++] = '\n'; output[wIndex] = 0; puts(output); }