Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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 Zeokat (Novice) on Dec 29, 2017 at 18:37 UTC
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 making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-03-19 03:20 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (232 votes). Check out past polls.