Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Thread Tools Search this Thread
Old 30-07-2009
Join Date: May 2009
Posts: 44
Eval encoded file decoder

I am making a project in PHP where i am facing some issues with purchase script where i am using a very simple eval based encoding system i have try to think a lot and finally i have came to know how to decode the file by hand and following are the code for the same.

PHP Code:
// Open and read the content of the encoded file into a variable
$file file_get_contents('encoded_file1.php');

// Strip php tags
$file str_replace('<?php'""$file);
$file str_replace('<?'""$file);   // Make sure to get rid of short tags....
$file str_replace('?>'""$file);

// Strip new lines
$file str_replace("\n"""$file);

// Add semi colon to get around a parsing issue.
$file $file.';';

// Change the Eval function
$file str_replace('eval''echo '$file);

// Function to eval the new string
function demo()
$contents ob_get_contents();

// Run the code thru once
$file demol(); 

// Counter
$cnt 1;

// Loop it till it's decoded
while(preg_match('/^\?><\?php eval/'$file))
$file str_replace('?><?php eval''echo'$file);
$file str_replace('?><?'""$file);
$file deval();

//clean up some tags
$file str_replace('?><?php'""$file);
$file str_replace('?><?'""$file);

$cnt,' iterations<br/><br/>';
Reply With Quote
Old 30-07-2009
Join Date: May 2008
Posts: 2,383
How to eval a php html file

After thinking a lot and taking many people and resources from different sites and book i have created code for ByteRun's encoding and at the same time i had a check it's really working very fine so there is no need of having any tension about the code if anyone finds more such kinds of code then please reply to this thread

PHP Code:
// Function to eval the new string 
function test() 

  global $file1, $_F, $_X; 
  $contents = ob_get_contents(); 

// Run the code 
$file1 = test(); 

$_X = base64_decode($_X); 

$file1 = str_replace('$_X=base64_decode($_X);', "", $file1); 

preg_match('/\$_X=strtr.*?\'\);/', $file1, $match2); 

$file1 = str_replace($match2[0], "", $file1); 



$_R = ltrim($_R, '?><?php'); 
$_R = rtrim($_R, '

echo $_R; 
Reply With Quote

  TechArena Community > Software > Software Development
Tags: , , ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: "Eval encoded file decoder"
Thread Thread Starter Forum Replies Last Post
Is there any decoder to play re4 extension file in VLC Lynch Windows Software 4 10-07-2011 08:04 PM
Jerk or slow motion when playing an MKV file encoded with real video codec in VLC Paul$Terry Windows Software 5 09-07-2011 10:40 PM
The eval() method in Java Isabella Software Development 6 11-08-2010 05:05 PM
How to read a h-264 encoded file. Captain Carrot Windows Software 6 04-05-2010 10:21 AM
Eval function in javascript Solaris Software Development 5 02-03-2010 05:59 PM

All times are GMT +5.5. The time now is 04:54 PM.