in reply to 3-D Stereogram, Self replicating source.
Umm, that's amazing. Very cool. Can you give up a little bit about how this sucker works?
-Any sufficiently advanced technology is
indistinguishable from doubletalk.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: 3-D Stereogram, Self replicating source.
by John M. Dlugosz (Monsignor) on Oct 16, 2001 at 03:34 UTC | |
In the last 3 lines before the DATA, you can see that since the real line ends with a # so everything after that is ignored. The rest of the program works the same way, but is obfuscated by using different characters. Everything between the first 2 commas is a string. The bottom part, which cannot be cloaked the same way hence the major hint in the form of #'s, processes the text string thus: Which basically changes |,Y,or% into , and changes z,!,or x into Q (more on that next), and throws away a few other letters, which give him padding that can be anywhere including in the "real" code. |'s etc. become commas. They were escaped out so that the q could use them to delimit the string . The Q, previously z,!,x (or already Q), turns into the new comment character -- everything starting from a Q or z is removed. Having four choices makes it less obvious that each "real" part of a line ends in this. Note that such ender character forms a solid vertical stripe in the 14th column, so this code could have processed it by taking 14 chars and throwing away the rest. It's just a matter of changing the last 3 lines. Those lines are shorter than 13 chars, but garbage can be added after # and it works just the same, making the real code in the first "column" that gets replicated and munged to hold the image. Having no image in the topmost line simplifies things, and should be there for a border anyway. —John | [reply] [d/l] |
by Toodles (Monk) on Oct 16, 2001 at 11:52 UTC | |
and 'W'atch $_ and step by step down towards the eval with the 'n' command. It should be obvious as soon as you see the line of Q's. Next it removes everything from the Q's to end of line. You'll be left with: With decent space, comments, and more meaningfull variable names...This is for education only; wont work unless in proper shape, with DATA available. Things I should have done differently: The first my(...) was totally unneeded. I didn't use strict or -w, so this should have gone out the window. I should have used if instead of unless where possible. 4 wasted charachters each. $s-=$s or $s^=$s would have been more fun than my($s) and done the same thing Since the charachters in the DATA section get added in a numeric scalar context, that means that anything not a digit equates to 0. So, instead of bunches of 0's, I could do anything, even making harder to read the data some like this smiley: Feel free to try it.
Edit: chipmunk 2001-11-12 | [reply] [d/l] [select] |
by chipmunk (Parson) on Oct 16, 2001 at 07:37 UTC | |
perlop explains the tr/// operator in greater detail. | [reply] [d/l] |
by John M. Dlugosz (Monsignor) on Oct 16, 2001 at 07:39 UTC | |
—John | [reply] |