Can anyone tell me what language this code is:

$T7FC56270E7A70FA81A5935B72EACBE29 += (ord($TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA]) >> 4); if ($T7FC56270E7A70FA81A5935B72EACBE29) { $T9D5ED678FE57BCCA610140957AFAB571 =

I need to find a translator for it. It was in the footer of a php script I have and I want to translate the entire code to HTML.

Mike

Dani AI

Generated

This is obfuscated PHP — not a new language. is correct that obfuscation is not encryption, and ’s analysis shows the file contains a small unpacker that turns an embedded blob into the actual footer HTML. The safe way to work with this is to inspect the blob offline, not to execute unknown code on a live site.

A practical, safe workflow:

  • Make a full backup of the file and work on a copy in an isolated environment (local VM or disposable container).

  • Locate the encoded blob (the long string) and extract only that string. Do not run the original file.

  • Decode the blob into a file for inspection instead of using eval. For example, using the PHP CLI (replace ENCODED_STRING):

    php -r "file_put_contents('decoded.php', base64_decode('ENCODED_STRING'));"
  • Open decoded.php in a text editor. If it’s still mangled you’re looking at a custom decompressor (look for bit operations, ord()/shifts or sliding-window copies). Those indicate an LZ77/LZSS-style unpacker that reconstructs plain HTML or PHP.

How to modify without breaking things:

  • If decoded output is plain HTML, copy that HTML into your footer and remove the obfuscated invocation. Keep the original file (or comment it) so you can restore it if needed.
  • If the unpacked payload contains checks (remote calls, license checks), search for file_get_contents, curl, fsockopen or other network calls before removing them.
  • If unsure, paste the decoded output into a sandbox and test thoroughly. Use php -l decoded.php to check syntax.

References for the functions and security posture:

Keep originals, work offline, and replace the obfuscation with the decoded HTML once confirmed safe.

Recommended Answers

All 8 Replies

.

It's not encoded. Obfuscation != Encryption. Please provide all of the PHP, not just 2 lines of it.

To elaborate on my previous statement. It is not encoded, it is obfuscated. Though technically, since PHP is interpreted, there is no way to truly encrypt PHP without a third-party application. As an example, this is what that code looks like with normal variable names.

$var1 += (ord($var2[$var3]) >> 4);
if ($var1) { $var4 =

for starters its not encoded perse, its simple obfuscated.

If you start working backwards and doing some find and replace you'll see it translates right back to php.

<?php    

if (!function_exists("copyright"))  
{   
	function copyright($a)
	{    
		$a = base64_decode($a);    
		$b = 0;    
		$c = 0;    
		$d = 0;    
		$e = (ord($a[1]) << 8) + ord($a[2]);
		$f = 3;    
		$g = 0;    
		$h = 16;    
		$i = "";    
		$j = strlen($a);
		$k = __FILE__;
		$k = file_get_contents($k);
		$l = 0;
		
		preg_match('/(print|sprint|echo)/', $k, $l);
		
		for (;$f<$j;)
		{     
			if (count($l)) exit;     
			if ($h == 0)     
			{      
				$e = (ord($a[$f++]) << 8);
				$e += ord($a[$f++]);
				$h = 16;
			}     
			if ($e & 0x8000)
			{
			$b = (ord($a[$f++]) << 4);
			$b += (ord($a[$f]) >> 4);
			
			if ($b)      
			{       
				$c = (ord($a[$f++]) & 0x0F) + 3;       
				
				for ($d = 0; $d < $c; $d++)        
					$i[$g+$d] = $i[$g-$b+$d];
					$g += $c;      
			}      
			else      
			{       
				$c = (ord($a[$f++]) << 8);
				$c += ord($a[$f++]) + 16;
				
				for ($d = 0; $d < $c; $i[$g+$d++] = $a[$f]);       
					$f++; $g += $c;      }     }     else $i[$g++] = $a[$f++];     
					$e <<= 1;     
					$h--;
					     
				if ($f == $j)     
				{      
					$k = implode("", $i);      
					$k = "?".">".$k."<"."?";      
					return $k;     
				}    
		}   
	}  
}  

eval(copyright("QAAAPD8NCg0KLy8gRm9ua3NpeQMAb25sYXIgAAAlLQSRZnVuY3Rpb24AACBrdWxsYW5pY2lfYmlsZ2kAAF9hbCgpew0KCSRjaHVjaz0AAGZpbGVfZ2V0X2NvbnRlbnQQEHMoIgMmLnR4dCIpOwLRZGVnZQABcj1leHBsb2RlKCJ8IiwgBBOAaAHycmV0dXJuICQCYgMAfQgqY29vAABraWVfZG9zeWFfdGVtaXpsYBhlCEQBQj1mb3BlbigiAoMHUiwgIkA4dwejZmNsb3NlKCQCogbRBctnaXICAmlzX3lhcAUTZWNobyAiRwFQ/gAAIFlhcP1s/Xlvci48QlI+3SgAbmQBYGwVgHIuIEz8dGZlbiBiAABla2xleWlu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IkaQWQMANkJJ+RAQAnJyABJHdo0xAggxxpICA8PSA3CTYDom51bQLAC4EKwCUgMQMzMwNEAdJ0bXAB0HN1YnN0cpwhDCD+MRhAAzChRAJRAEEHNQCDLiAkA5AEiWkrKwD08DxaAAMRbYUKsS4iLnVudw9BAdAZgeUNc28dwG51IAAAIC0EkQBBa3G9CJABgQ0KPz4="));  

?>

Now i didnt find anything specific when i looked for its purpose, but it seems to be a mechanism to obscure the copyright information in a template, usually wordpress, so it can not be removed, not easily anyways.

shawn you beat me to it.

It is a footer from a very old template that has a common license. I don't want to remove it. I just want to modify it. I don't understand about obfuscation. I will have to do a search to find out how to do this. Thanks for the reply. As always, you guys are the best help!!!

Mike

obfuscation implies protection,
modifying may stop the script,
with levels of 'stop' available to the author.
It is easy to check elsewhere for a particular string of Hex,
without bothering to write the php, code can,
if not exist substring(mycopyright) in footer.html
{
mysql drop table all
die copyright has been breached
}

obfuscation implies protection,
modifying may stop the script,
with levels of 'stop' available to the author.
It is easy to check elsewhere for a particular string of Hex,
without bothering to write the php, code can,
if not exist substring(mycopyright) in footer.html
{
mysql drop table all
die copyright has been breached
}

Once again, obfuscation is in no way a form of encryption. If you correctly reverse engineer obfuscated code you have the original code as the author wrote it. There is nothing the author can do to shut it down since you have the code. You can modify the code to not "phone home" or do any other form of checking. That's why PHP is a poor language to choose if you want to restrict your code, without using a third-party app there is pretty much nothing you can do to stop a reverse-engineer from tearing your code apart.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.