Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

How do I textually combine a large number of modules into a single file?

by Vlad, the IM-perler (Novice)
on Sep 07, 2011 at 04:28 UTC ( #924528=perlquestion: print w/replies, xml ) Need Help??
Vlad, the IM-perler has asked for the wisdom of the Perl Monks concerning the following question:

I'm rolling my own security/packaging system. I like the way pp grabs everything but I dislike its need to uncompress it all into /tmp

Is there some way I can either group all the code files or extract al the code from a par into a single text file? I have a pretty good decrypt system that reads a certificate then decrypts and pipes txt to perl

This wont work with a par file because par wont run from stdin. An ideas?

ps: yes I know a keen hacker might find the code in RAM
  • Comment on How do I textually combine a large number of modules into a single file?

Replies are listed 'Best First'.
Re: How do I textually combine a large number of modules into a single file?
by chromatic (Archbishop) on Sep 07, 2011 at 07:14 UTC
Re: How do I textually combine a large number of modules into a single file?
by afoken (Abbot) on Sep 07, 2011 at 07:40 UTC

      The problem can't really be solved by using a compiled language either. There are decompilers for every compiled language. The code won't be pretty, but you can figure it out enough to rip off what ever it is the obfu was guarding. Indeed, I recall seeing a proof that in a general sense, obfu is impossible. I can't find it on google scholar searches, and I don't recall the author. I did find a paper that showed deobfu is NP-Easy though (Appel). Not sure how relevant that is though…

      Anyway, I would say the only way to prevent them from seeing your code is to run it as a web service (or similar) so they can't get at the executing process.

      Not quite. Don't think of it as Obfuscation, think product activation.

      And no the web activation method is not suitable.

        Don't think of it as Obfuscation, think product activation.

        Essentially the same problem. Your program contains checks à la is_product_activated(). And you don't want the end-user to use your product when it is not "activated". As a minor variant, the "activation" allows decrypting encrypted code needed for advanced features.

        Did you know that perl can load and run an arbitary script whenever it is started (search for "sitecustomize.pl" in perlrun)? So monkeypatching those functions should be quite easy. And of course, there is B::Deparse, making all obfuscation futile. Decrypting the encrypted code can be done using the required decryption functions of the program, e.g. from sitecustomize.pl. The code can then be written to a plain file, using a simple print if it is eval""uated, or using B::Deparse for more complex setups.

        Product activation is just nonsense. Look at Microsoft's current products. You are told that you have to activate them, but that's not true. People found various ways to circumvent the need for activation. One old and trivial way is to set the clock to the far future, install the product, turn the clock back, and enjoy a decades long evaluation phase. Another way is to fool the product into thinking it runs on an OEM system, where the activation is not needed. And you can bet that Microsoft invested a lot of work into the product activation.

        Hire a good lawyer, make him write a good contract for selling your product. Sell support and updates for your product, not just the product.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://924528]
Approved by kcott
Front-paged by Corion
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-07-18 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (389 votes). Check out past polls.

    Notices?