ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> Programming

Reading an encoded PHP file with ioncube_read_file.

Author Message
rtnet



Joined: 22 Jul 2015
Posts: 1

PostPosted: Wed Jul 22, 2015 1:21 pm    Post subject: Reading an encoded PHP file with ioncube_read_file. Reply with quote

Hello,
I have a problem with reading an encoded PHP file with ioncube_read_file.
Please see source below:

a.php
Code:
<?php
echo ioncube_read_file('b.php');
?>


b.php
Code:
<?php
echo '1111111';
?>


both are encoded in same project, encoder version 8.3

executing a.php results with
Code:
1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted. Ensure that you use binary mode when transferring files with FTP and disable the 'TAR smart cr/lf feature' if using WinZIP\n");}if(function_exists('_il_exec')){return _il_exec();}echo('Site error: the file '.__FILE__.' requires the ionCube PHP Loader '.basename($__ln).' to be installed by the website operator. If you are the website operator please use the ionCube Loader Wizard to assist with installation.');exit(199); ?>  (...)

instead of b.php source
How can I fix it?
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 190

PostPosted: Thu Jul 23, 2015 8:58 am    Post subject: Reply with quote

You need to *encrypt* b.php rather than encode it. The function ioncube_read_file function only decrypts encrypted files. Remember that encoding completely removes the source code by compiling the PHP source to byte code. So you cannot reverse encoding using ioncube_read_file().

If you want to decrypt an encrypted file and then pass the result to eval() then please note that you should not have the opening and closing tags, <?php ?> , in b.php.

Please also note that in order to encrypt rather than encode you will need to override the default behaviour of the Encoder which is to encode PHP files.

If you need further details then please raise a ticket in our Support Help Desk at http://support.ioncube.com
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> Programming All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum