nomanoma Posted February 13, 2010 Share Posted February 13, 2010 hi: i have trouble decoding some base64 encode, when i decode it, the output is always in Unicode like this: ¨Å»pÝ×+ÑCw =žÍbGÝí`í`3ý†KûûvøÖKüÖK;ä{tÛöÛ«ÑÐå1§«�Žç™+§ p.s. i tried various character sets i.e. utf-7, utf-8, etc... and the output still in Unicode. can anyone help, please? if you need the code i can provide it as a php file upon request. thanks Quote Link to comment Share on other sites More sharing options...
salathe Posted February 13, 2010 Share Posted February 13, 2010 This might seem like a dumb question, but what is the problem? There is no reason (without knowing more details of your use of the code) why 'decoded' text cannot be what you say it is. So, more details needed. Quote Link to comment Share on other sites More sharing options...
nomanoma Posted February 13, 2010 Author Share Posted February 13, 2010 normally when i decode something like this, the output eventually will be the original php code (with english characters, not unicode characters) Quote Link to comment Share on other sites More sharing options...
salathe Posted February 13, 2010 Share Posted February 13, 2010 Well give us the encoded value and roughly what you are expecting it to be when decoded ("PHP code" is enough). Quote Link to comment Share on other sites More sharing options...
nomanoma Posted February 13, 2010 Author Share Posted February 13, 2010 i'm attaching the encoded value in a php file. (post.php) the decoded should be something like this php file i'm also attaching (decoded.php) [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
salathe Posted February 13, 2010 Share Posted February 13, 2010 The encoded file can be decoded fairly trivially. That said, I cannot see how you are running into problems with the decoded value being of the type that you mentioned in the first post. Given that this is obfuscated PHP source code (containing a license for use on one particular domain name) I don't think it would be ethical to give you the unobfuscated version of the file. Suffice it to say, if I can figure it out in a few minutes then so can you. If you want the decoded file, sorry. If you want to figure out why you're getting unexpected results from base64_decode then tell us what value you're passing into the function to give those results. Quote Link to comment Share on other sites More sharing options...
nomanoma Posted February 14, 2010 Author Share Posted February 14, 2010 i'm the owner of that domain the code is licensed to (rockintextads.com) and the encoded code is pretty much the same as the php code i gave you except that it has a inverse tick box option anyway here's what i use: <?php $str = ''; echo base64_decode($str); ?> maybe it's too simple for it. would you please let me know what you used? thanks Quote Link to comment Share on other sites More sharing options...
salathe Posted February 14, 2010 Share Posted February 14, 2010 anyway here's what i use: <?php $str = ''; echo base64_decode($str); ?> What you used simply echoes an empty string (i.e. nothing). Please describe what you are doing to get ¨Å»pÝ×+ÑCw =žÍbGÝí`í`3ý†KûûvøÖKüÖK;ä{tÛöÛ«ÑÐå1§«�Žç™+§ Quote Link to comment Share on other sites More sharing options...
nomanoma Posted February 14, 2010 Author Share Posted February 14, 2010 no, i'm adding the encoded code in the string as in this: $str = 'JE8wMDBPME8wMD1mb3BlbigkT09PME8'; Quote Link to comment Share on other sites More sharing options...
salathe Posted February 14, 2010 Share Posted February 14, 2010 In that case, you have lost me completely. That 'encoded code', when Base64 decoded, gives a plain recognisable string (starting with $O000O0O00=fopen($OOO0O). To reproduce: $str = 'JE8wMDBPME8wMD1mb3BlbigkT09PME8'; echo base64_decode($str); Does that really give you the "unicode" value ¨Å»pÝ×+ÑCw =žÍbGÝí`í`3ý†KûûvøÖKüÖK;ä{tÛöÛ«ÑÐå1§«�Žç™+§ ? Quote Link to comment Share on other sites More sharing options...
nomanoma Posted February 16, 2010 Author Share Posted February 16, 2010 ok, i replaced eval with echo for this part: $OOO0O0O00=__FILE__;$O00O00O00=__LINE__;$OO00O0000=16680;eval((base64_decode('JE8wMDBPME8wMD1mb3BlbigkT09PME8wTzAwLCdyYicpO3doaWxlKC0tJE8wME8wME8wMClmZ2V0cygkTzAwME8wTzAwLDEwMjQpO2ZnZXRzKCRPMDAwTzBPMDAsNDA5Nik7JE9PMDBPMDBPMD0oYmFzZTY0X2RlY29kZShzdHJ0cihmcmVhZCgkTzAwME8wTzAwLDg4MCksJ1ZoY1h3N3NVUEw2M29kU0VZTnYrV1ova1RNbHl1MjlPNHFDRlJBRFFwMGJuNUphMXhCdGpLZmVtSGlHSWd6OHI9JywnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLycpKSk7ZXZhbCgkT08wME8wME8wKTs=')));return;?> and i got what you say you got: $O000O0O00=fopen($OOO0O0O00,'rb');while(--$O00O00O00)fgets($O000O0O00,1024);fgets($O000O0O00,4096);$OO00O00O0=(base64_decode(strtr(fread($O000O0O00,880),'VhcXw7sUPL63odSEYNv+WZ/kTMlyu29O4qCFRADQp0bn5Ja1xBtjKfemHiGIgz8r=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')));eval($OO00O00O0); but anything more than this gives me unicode, i know i must be missing something. all i'm intersted in is to know how to decode it, i don't care about the original php code. so can you tell me step by step what to do next. thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.