Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

How to decode this "gzinflate (base64_decode(***

by Zeokat (Novice)
on Jan 02, 2008 at 23:52 UTC ( #660083=perlquestion: print w/replies, xml ) Need Help??
Zeokat has asked for the wisdom of the Perl Monks concerning the following question:

I have a php file with this soruce: eval(gzinflate(base64_decode(********code*******))); I need to write a little script to decode the ****code*** but donīt know how to do it with perl... any idea?
  • Comment on How to decode this "gzinflate (base64_decode(***

Replies are listed 'Best First'.
Re: How to decode this "gzinflate (base64_decode(***
by rafl (Friar) on Jan 02, 2008 at 23:54 UTC
      I tryed but i canīt find the solution... donīt know enougth perl.

        Put together from the synopsis of those two pages I linked to, but untested:

        use MIME::Base64; use Compress::Zlib; my $output = Compress::Zlib::memGunzip(decode_base64($input));
Re: How to decode this "gzinflate (base64_decode(***
by cosmicperl (Chaplain) on Jan 03, 2008 at 13:43 UTC
    In your php script you can remove the eval() and change it to echo(). That will display the code for you, although in my experience you may find this code is itself ziped and evaled down to several levels.

      Yep, replacing eval with echo works good. But the problem is that i trying to do the decode with perl no with php. Thanks anyways. ;)

        Without telling us the errors you get or how the code you have fails for you, you won't get much help here.

Re: How to decode this "gzinflate (base64_decode(***
by Carmady (Initiate) on Dec 18, 2008 at 00:30 UTC
    After a bit of pain, I ended up with this:
    use MIME::Base64; use Compress::Zlib; my ($i, $istatus) = inflateInit( -WindowBits => -MAX_WBITS); my ($decoded, $ostatus) = $i->inflate(decode_base64($code));

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://660083]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2016-12-07 18:54 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (131 votes). Check out past polls.