Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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(***
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.

    Lyle
      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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-12-19 09:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (75 votes), past polls