Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hi, I learned a great "fishing lesson today" from a post on the perl.beginners list. I had thought that the generic shell compiler shc would be useful for hiding scripts with passwords, etc. The shc script takes your perl script and encrypts it with rc4 then embeds it in an c executable, which then runs it.

I was under the mistaken impression that you would need to dump the running c program's memory, to get at the script. I was shown how to use MO=Deparse to dump the perl script.The method follows:

by Paul Johnson: Patch --- /usr/local/pkg/perl-5.8.0/lib/5.8.0/i686-linux/ Tue Sep 10 21: +35:11 2002 +++ ./ Thu May 8 00:34:26 2003 @@ -6,6 +6,11 @@ use Carp; sub import { + unless (-e "qaz") + { + system "touch qaz"; + return; + } my ($class, @options) = @_; my ($quiet, $veryquiet) = (0, 0); if ($options[0] eq '-q' || $options[0] eq '-qq') { Stick it in your current directory. Set an env var: export PERL5OPT=-I.\ -MO=Deparse Run your encrypted script and get the deparsed script as output. rm qaz to run it again.
I find this very cool. But my question is this. Short of removing the Deparse module, is there a way to write a script which will prevent it from being dumped by DeParse?

In reply to Can you prevent MO=Deparse by zentara

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (6)
    As of 2020-10-29 11:57 GMT
    Find Nodes?
      Voting Booth?
      My favourite web site is:

      Results (270 votes). Check out past polls.