Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Spiro Japh 2

by udyog (Acolyte)
on Sep 08, 2005 at 02:21 UTC ( [id://490057]=note: print w/replies, xml ) Need Help??


in reply to Spiro Japh 2

Hello Brilliant!!

Its nice one!! Great!!

And, I am very interest to know the Obfuscation code. Is there any tutorial or any other help please.

Thank You.

Replies are listed 'Best First'.
Re^2: Spiro Japh 2
by liverpole (Monsignor) on Sep 08, 2005 at 03:06 UTC
    Thank you -- but you are too kind!  I am really not very good at obfuscation compared to many of the others whose works have graced the Monastery before me.  I think my talents lie more with inventing something relatively new, and then making it hard to decipher.  The really inspired obfuscated code, though, takes much longer to unravel than anything I could create, and there are a number of them at Perlmonks.org which I have yet to come close to figuring out!

    I do have a couple of suggestions, though:

    1. For starters, always write code in an area that you are familiar with.  Just think this way:  "What would make for really cool-looking (and maybe very unexpected) program output?"  Then try to code to that.
    2. Create a program that you're pleased with first, and then try to obfuscate it afterwards.  If you have an obfuscation technique in mind at the outset, so much the better, but write code that's easy for you to comprehend before you make obfuscate it, otherwise you'll get lost in your own mess.
    3. If you're going for a certain "look", make sure that the number of characters in your code is very close to the number of characters in the "picture" which will be the final output.  Once you've got the program as short as you can make it, create an ascii-image using all '#' characters, and then, with your favorite editor, align your code to it as best you can.
    4. If you're trying "uncharted" techniques in obfuscation, make sure to try running your program after even the smallest edit, to make sure that it still works correctly!
    5. The more platforms your program runs on, the better (of course).
    6. Most importantly, study the obfuscated code that others have created.  If there are "spoilers" (explanations of how the code functions) make sure to read them carefully.  If not (or if you are up to the challenge), attempt to figure out for yourself which of the more mysterious Perl techniques are at work.  Learning these useful Perl idioms will provide you the inspiration you need, not only to create masterful obfuscations of your own, but to become a better craftsman of Perl yourself!

    Good luck!

      Spoiler...

      There is no much complicated obfuscation here, except by creating unnecessary subroutines and using weird names, such as "::" and "sub", and weird-looking names such as "O123" and "l234"... With only method and variable names modifications, I could use the code with use strict; and use warnings; without errors.

      The clean version of the code:

      #!/usr/bin/perl use warnings; use strict; $|= 1; # This is usefull and required only on win32 machines eval{require Win32::Console::ANSI;}; # number of JAPHs per graph my $counter; # define the parameters for the graph my ($u,$v); # a way to slow the counter decrease, see below my ($a,$b); while(1) { unless ($counter) { # choose a random color printf("\e[1;%dm", 30+rand(7)); # clear the screen printf("\e[%d;%dH%s",1,1,"\e[J"); $u = rand 39/999; $v = rand 39/999; $counter = 3999; $b=qw/19 9 1/[int rand 3]; }; # print J A P H, on the given position printf ( # the ansi code mask "\e[%d;%dH%s", # X 11*sin($v*$counter) + 13, # Y 39* cos($u*$counter) + 41, # one of the four letters qw/J A P H/[$counter%4] ); # here is how $a and $b are used. ($a++%$b) or $counter--; }
      daniel
        Muito bem ruoso.   A very nicely crafted analysis!  Abrigado...

        But you know, I readily admit that in all of my submissions "there is no much complicated obfuscation".

        So I eagerly await your own obfuscation.  I think you will be very good at them! (I don't promise to be able to analyze it as well as you did mine, though -- I still have a lot to learn from the obfuscated code examples).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://490057]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-18 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found