Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Take *that*, Deparse!

by Felonious (Chaplain)
on Nov 28, 2002 at 03:29 UTC ( [id://216231]=obfuscated: print w/replies, xml ) Need Help??

Through experimentation, I found a couple of (new?) tricks to play a little havoc with both Perl's lexer and B::Deparse. The idea is to make '-MO=Deparse' useless. Try it out!:)

(Note: I came up with these while doing my last obfu, and you can find the same tricks and more used there).

#!/usr/bin/perl sub ::'&'{bless$_[0]}sub ::1:{print $_[0]->(),$"}sub ';'{print $_[0]-> (),$/}::{print'Just '}->()->(::{another})->(::{Perl});$q->(::{hacker})

The early worm gets the bird.

Replies are listed 'Best First'.
Re: Take *that*, Deparse!
by BrowserUk (Patriarch) on Nov 28, 2002 at 04:50 UTC

    ? Deparse seems to handle that with aplomb.

    C:\test>perl -MO=Deparse,p #!/usr/bin/perl sub ::'&'{bless$_[0]}sub ::1:{print $_[0]->(),$"}sub ';'{print $_[0]-> (),$/}::{print'Just '}->()->(::{another})->(::{Perl});$q->(::{hacker}) ^Z sub main:: (&) { bless $_[0]; } sub 1 { print $_[0]->(), $"; } sub (;) { print $_[0]->(), $/; } main::(sub { print 'Just '; } )->()->(main::(sub { 'another'; } ))->(main::(sub { 'Perl'; } )); &$q(main::(sub { 'hacker'; } )); - syntax OK

    Seems perfectly clear to me:)


    Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
    Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
    Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
    Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.

      D'oh! You're right... Deparse handled that "fairly ok" (though what it produced is not valid perl) under perl 5.6.1, which I failed to test;)

      Under 5.8.0, the part that produces:

      sub main:: (&) { bless $_[0]; }
      suffers the same fate as the below (which should work in both):
      #!/usr/bin/perl sub :::::: { print "Just another Perl Hacker\n"; } &::::::;
      /Me hopes that one works;)


      The early worm gets the bird.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-03-28 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found