Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Here is a commercial obfuscator

by diotalevi (Canon)
on Mar 14, 2003 at 17:13 UTC ( #243120=note: print w/replies, xml ) Need Help??


in reply to Here is a commercial obfuscator

It took half an hour to patch B::Deparse to mangle names. How long do you think it'd take to re-implement the rest of that expensive suite?

--- /usr/libdata/perl5/i386-openbsd/5.6.1/B/Deparse.pm Thu Oct 3 2 +0:39:48 2002 +++ B/Obfuscate.pm Fri Mar 14 11:56:35 2003 @@ -6,7 +6,7 @@ # This is based on the module of the same name by Malcolm Beattie, # but essentially none of his code remains. -package B::Deparse; +package B::Obfuscate; use Carp 'cluck', 'croak'; use B qw(class main_root main_start main_cv svref_2object opnumber OPf_WANT OPf_WANT_VOID OPf_WANT_SCALAR OPf_WANT_LIST @@ -208,6 +208,13 @@ # \f - flush left (no indent) # \cK - kill following semicolon, if any +sub rot13 { + my $text = shift; + $text =~ tr/a-zA-Z/n-zA-Zm-z/; + + return $text; +} + sub null { my $op = shift; return class($op) eq "NULL"; @@ -376,7 +383,7 @@ sub compile { my(@args) = @_; return sub { - my $self = B::Deparse->new(@args); + my $self = B::Obfuscate->new(@args); $self->stash_subs("main"); $self->{'curcv'} = main_cv; $self->walk_sub(main_cv, main_start); @@ -784,7 +791,7 @@ if ($name =~ /^\^../) { $name = "{$name}"; # ${^WARNING_BITS} etc } - return $stash . $name; + return $stash . rot13($name); } # Notice how subs and formats are inserted between statements here @@ -1872,7 +1879,7 @@ sub padname { my $self = shift; my $targ = shift; - return $self->padname_sv($targ)->PVX; + return rot13($self->padname_sv($targ)->PVX); } sub padany {

Seeking Green geeks in Minnesota

Replies are listed 'Best First'.
Re: Re: Here is a commercial obfuscator
by diotalevi (Canon) on Mar 14, 2003 at 17:23 UTC

    I obfuscated Real Synthetic Audio Downloader using that patch.

    require(LWP::UserAgent); ($| = 1); ($rnIrQvE = '/home/josh/rsa/'); ($rnIrRKG = '.wma'); ($rnIrsLCr = qr[http://.+?\.asx]); sub QROtT () { package constant; $FpnynE; } ($Hn, $ED, $EF); ($Hn = 'LWP::UserAgent'->new); (my $qBJAyBnqF = trG_qBJAyBnqF()); qBJAyBnq_svyrF($rnIrQvE, $qBJAyBnqF); sub trG_qBJAyBnqF { my(%qBJAyBnqF); (my(@wF_HEyF) = map((('http://synthetic.org/jscript/' . $_) . 'sho +wlist.js'), ('', 'previous-'))); JSURL: foreach my $wF_HEy (@wF_HEyF) { '???'; ($EF = $Hn->get($wF_HEy)); ($EF->is_success or next JSURL); (my(@nFK_HEyF) = ($EF->content =~ /$rnIrsLCr/g)); ASXURL: foreach my $nFK_HEy (@nFK_HEyF) { '???'; ($EF = $Hn->get($nFK_HEy)); (my $Jzn = $EF->content); ($Jzn =~ s/[\s\15\12]+//g); (($Jzn =~ /(\d+)-(\w+)/) or (warn(((q['] . $Jzn) . q[' did +n't match /(\\d+)-(\\w+)/])) and next)); (my($qnGr, $FCrrq) = ($1, $2)); if (((not $qBJAyBnqF{$qnGr}) or ($FCrrq eq 'isdn'))) { ($qBJAyBnqF{$qnGr} = $Jzn); '???'; } else { '???'; } } } return((\%qBJAyBnqF)); } sub qBJAyBnq_svyrF { (my($qvErpGBEL, $qBJAyBnq) = @_); foreach my $onFr_svyr (sort(keys(%$qBJAyBnq))) { (my $Jzn_HEy = $$qBJAyBnq{$onFr_svyr}); '???'; (my $svyr = (($qvErpGBEL . $onFr_svyr) . $rnIrRKG)); if (-e($svyr)) { '???'; next; } ($ED = 'HTTP::Request'->new('GET', $Jzn_HEy)); ($EF = $Hn->request($ED, $svyr)); '???'; print(($svyr . "\n")); } }
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Re: Here is a commercial obfuscator
by hardburn (Abbot) on Mar 14, 2003 at 17:25 UTC

    I haven't looked at the source for B::Deparse, but I'm guessing it must add the whitespace on its own. Just remove those spots and you've got most of the rest.

    I hear an old statement about adding functionality by removing something.

    ----
    Reinvent a rounder wheel.

    Note: All code is untested, unless otherwise stated

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2020-10-25 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (249 votes). Check out past polls.

    Notices?