On Fri, Feb 22, 2002 at 08:16:57PM -0500, Jerrad Pierce wrote:
> Not to flog a dead horse but did anybody even bother to search CPAN?
> I see nothing in the archives about this, yet it was relatively easy
> to stumble across:
> 
> http://www.cpan.org/authors/id/C/CR/CRAIC/shroud-1.0

I did, found it, read it, ran it and decided that it would not be hard to
'unshroud' the results.  Here's a small example.

[gyepi@nome gyepi]$ cat hello.pl

sub hello {
        my $var = shift;
        my $hello = 'hello';
 
        print "$hello $var\n";
}
 
my $world = 'world';
my $you = 'you';
 
&hello($world);
&hello($you);

[gyepi@nome gyepi]$ perl shroud-1.0.pl --input hello.pl
sub hello {
my $aaaaaaab = shift;
my $aaaaaaaa = 'hello';
print "$aaaaaaaa $aaaaaaab\n";
}
my $aaaaaaac = 'world';
my $aaaaaaad = 'you';
&hello($aaaaaaac);
&hello($aaaaaaad);


Because the replacement variables increase monotonically, once you decide on
a more appropriate name, you can s///g for the obfuscated variable.
Anyone for whom this obfuscation works would probably be scared off by the
original code anyway.

-Gyepi

-- 
Never mistake motion for action.
        --Ernest Hemingway  

Reply via email to