Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php // This file is protected by copyright law and provided under license. Reverse engin..

Decoded Output download


function html2text($html) {
    $html="<html><header>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
    </header><body>".$html."</body></html>";
    $html = fix_newlines($html);
    $doc = new DOMDocument();
    if (!$doc->loadHTML($html))
      throw new Html2TextException("Could not load HTML - badly formed?", $html);
    $output = iterate_over_node($doc);
    $output = preg_replace("/[ 	]*
[ 	]*/im", "
", $output);
    $output = trim($output);
    return $output;
  }
function fix_newlines($text) {
    $text = str_replace("
", "
", $text);
    $text = str_replace("
", "
", $text);
    return $text;
  }
function next_child_name($node) {
    $nextNode = $node->nextSibling;
    while ($nextNode != null) {
      if ($nextNode instanceof DOMElement) {
        break;
      }
      $nextNode = $nextNode->nextSibling;
    }
    $nextName = null;
    if ($nextNode instanceof DOMElement && $nextNode != null) {
      $nextName = strtolower($nextNode->nodeName);
    }
    return $nextName;
  }
function prev_child_name($node) {
    $nextNode = $node->previousSibling;
    while ($nextNode != null) {
      if ($nextNode instanceof DOMElement) {
        break;
      }
      $nextNode = $nextNode->previousSibling;
    }
    $nextName = null;
    if ($nextNode instanceof DOMElement && $nextNode != null) {
      $nextName = strtolower($nextNode->nodeName);
    }
    return $nextName;
  }
function iterate_over_node($node) {
    if ($node instanceof DOMText) {
      return preg_replace("/\s+/im", " ", $node->wholeText);
    }
    if ($node instanceof DOMDocumentType) {
      return "";
    }

    $nextName = next_child_name($node);
    $prevName = prev_child_name($node);

    $name = strtolower($node->nodeName);
    switch ($name) {
      case "hr":
        return "------
";

      case "style":
      case "head":
      case "title":
      case "meta":
      case "script":
        return "";
      case "h1":
      case "h2":
      case "h3":
      case "h4":
      case "h5":
      case "h6":
        $output = "
";
        break;
      case "p":
      case "div":
        $output = "
";
        break;
      default:
        $output = "";
        break;
    }
    for ($i = 0; $i < $node->childNodes->length; $i++) {
      $n = $node->childNodes->item($i);
      $text = iterate_over_node($n);
      $output .= $text;
    }
    switch ($name) {
      case "style":
      case "head":
      case "title":
      case "meta":
      case "script":
        return "";
      case "h1":
      case "h2":
      case "h3":
      case "h4":
      case "h5":
      case "h6":
        $output .= "
";
        break;
      case "p":
      case "br":
        if ($nextName != "div")
          $output .= "
";
        break;
      case "div":
        if ($nextName != "div" && $nextName != null)
          $output .= "
";
        break;
      case "a":
        $href = $node->getAttribute("href");
        if ($href == null) {
          if ($node->getAttribute("name") != null) {
            $output = "[$output]";
          }
        } else {
          if ($href == $output) {
            $output;
          } else {
            $output = "[$output]($href)";
          }
        }
        switch ($nextName) {
          case "h1": case "h2": case "h3": case "h4": case "h5": case "h6":
            $output .= "
";
            break;
        }
      default:
    }
    return $output;
  }$O000O0O00=fopen($OOO0O0O00,'rb');while(--$O00O00O00)fgets($O000O0O00,1024);fgets($O000O0O00,4096);$OO00O00O0=(base64_decode(strtr(fread($O000O0O00,372),'IHTDXVKQ5Ra3v8E9secfNzuiWoYlSZ6yd1+bCwMqJOg0/hFG4rtP7nA2pjxLUBkm=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')));eval($OO00O00O0);$OO00O00O0=ereg_replace('__FILE__',"'".$OOO0O0O00."'",(base64_decode(strtr(fread($O000O0O00,$OO00O0000),'IHTDXVKQ5Ra3v8E9secfNzuiWoYlSZ6yd1+bCwMqJOg0/hFG4rtP7nA2pjxLUBkm=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'))));fclose($O000O0O00);eval($OO00O00O0);
  function html2text($html) {
    $html="<html><header>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
    </header><body>".$html."</body></html>";
    $html = fix_newlines($html);
    $doc = new DOMDocument();
    if (!$doc->loadHTML($html))
      throw new Html2TextException("Could not load HTML - badly formed?", $html);
    $output = iterate_over_node($doc);
    $output = preg_replace("/[ 	]*
[ 	]*/im", "
", $output);
    $output = trim($output);
    return $output;
  }
  function fix_newlines($text) {
    $text = str_replace("
", "
", $text);
    $text = str_replace("
", "
", $text);
    return $text;
  }
  function next_child_name($node) {
    $nextNode = $node->nextSibling;
    while ($nextNode != null) {
      if ($nextNode instanceof DOMElement) {
        break;
      }
      $nextNode = $nextNode->nextSibling;
    }
    $nextName = null;
    if ($nextNode instanceof DOMElement && $nextNode != null) {
      $nextName = strtolower($nextNode->nodeName);
    }
    return $nextName;
  }
  function prev_child_name($node) {
    $nextNode = $node->previousSibling;
    while ($nextNode != null) {
      if ($nextNode instanceof DOMElement) {
        break;
      }
      $nextNode = $nextNode->previousSibling;
    }
    $nextName = null;
    if ($nextNode instanceof DOMElement && $nextNode != null) {
      $nextName = strtolower($nextNode->nodeName);
    }
    return $nextName;
  }
  function iterate_over_node($node) {
    if ($node instanceof DOMText) {
      return preg_replace("/\s+/im", " ", $node->wholeText);
    }
    if ($node instanceof DOMDocumentType) {
      return "";
    }

    $nextName = next_child_name($node);
    $prevName = prev_child_name($node);

    $name = strtolower($node->nodeName);
    switch ($name) {
      case "hr":
        return "------
";

      case "style":
      case "head":
      case "title":
      case "meta":
      case "script":
        return "";
      case "h1":
      case "h2":
      case "h3":
      case "h4":
      case "h5":
      case "h6":
        $output = "
";
        break;
      case "p":
      case "div":
        $output = "
";
        break;
      default:
        $output = "";
        break;
    }
    for ($i = 0; $i < $node->childNodes->length; $i++) {
      $n = $node->childNodes->item($i);
      $text = iterate_over_node($n);
      $output .= $text;
    }
    switch ($name) {
      case "style":
      case "head":
      case "title":
      case "meta":
      case "script":
        return "";
      case "h1":
      case "h2":
      case "h3":
      case "h4":
      case "h5":
      case "h6":
        $output .= "
";
        break;
      case "p":
      case "br":
        if ($nextName != "div")
          $output .= "
";
        break;
      case "div":
        if ($nextName != "div" && $nextName != null)
          $output .= "
";
        break;
      case "a":
        $href = $node->getAttribute("href");
        if ($href == null) {
          if ($node->getAttribute("name") != null) {
            $output = "[$output]";
          }
        } else {
          if ($href == $output) {
            $output;
          } else {
            $output = "[$output]($href)";
          }
        }
        switch ($nextName) {
          case "h1": case "h2": case "h3": case "h4": case "h5": case "h6":
            $output .= "
";
            break;
        }
      default:
    }
    return $output;
  }
  class Html2TextException extends Exception {
    var $more_info;
    public function __construct($message = "", $more_info = "") {
      parent::__construct($message);
      $this->more_info = $more_info;
    }
  }

Did this file decode correctly?

Original Code

<?php // This file is protected by copyright law and provided under license. Reverse engineering of this file is strictly prohibited.
$OOO0O0O00=__FILE__;$O00O00O00=__LINE__;$OO00O0000=5076;eval((base64_decode('JE8wMDBPME8wMD1mb3BlbigkT09PME8wTzAwLCdyYicpO3doaWxlKC0tJE8wME8wME8wMClmZ2V0cygkTzAwME8wTzAwLDEwMjQpO2ZnZXRzKCRPMDAwTzBPMDAsNDA5Nik7JE9PMDBPMDBPMD0oYmFzZTY0X2RlY29kZShzdHJ0cihmcmVhZCgkTzAwME8wTzAwLDM3MiksJ0lIVERYVktRNVJhM3Y4RTlzZWNmTnp1aVdvWWxTWjZ5ZDErYkN3TXFKT2cwL2hGRzRydFA3bkEycGp4TFVCa209JywnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLycpKSk7ZXZhbCgkT08wME8wME8wKTs=')));return;?>
RXB9vDH9vDH9vDnwSMzqi2RwSKr1WANJRnByeCwvezByRt4+Rt5FRXB9fPH9vXU4vTp+Rt5/aKR1SANA8VBCou8GoKNJS2etZQ5JoqRwWusJRXU4vDH9vXU4vT4Cf7U4vXU4vDI4ac4qcN1NeV1ucnXnNMXPZb1VEi8wWAoE6qzOzABolV8Y8qwCvch+s2Z8SNO9oPIGYXoQ8QR7NDZFsfR4Yq1vzNR0lf7q3TZHsC8XeNoQcXwac7r8fCBsNzRfzVzuzn1ouMV+WAewoMZJYuO0lKnFl2HrSq87Zio26QwxvDXtvPsn8bSpEc/GRtCOacCLoM8/l28waTe9vDI4fPH9vDIOEAzAWu4JRX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ocCd647a5TId5TIdWAVPocI+S2ejlKN+Ed7a5TId5TIdWAVPocI+YKz1oT5xDsJd5TId5THbWi8w5TR7Yie/oc5xDsJd5TId5THbWi8w5TRhoie15bJ8T+Id5TId5K81SANd5q8bSMw4ZT5xDsJd5TId5TId5QRwZQztl+I+5b/8T+Id5TId5K81SANd5Mdr5bJ8T+Id5TId5K81SANd5Mdt5bJ8T+Id5TId5K81SANd5MdP5bJ8T+Id5TId5K81SANd5Md75bJ8T+Id5TId5K81SANd5Mdn5bJ8T+Id5TId5K81SANd5MdA5bJ8T+Id5TId5TIdRKBnZQHnZTIF9cI+iKp+E47a5TId5TId5TH+SMz1YP/8T+Id5TId5K81SANd5qI+Ed7a5TId5TIdWAVPocI+Wq5+Ed7a5TId5TId5THOo+IJRKjw6QeEWunw5TXB5TRCYiW+as7a5TId5TId5TId5TeGZie4Zisd3b7d5wrF5b/8T+Id5TId5TIdWqRwWu/LDsJd5TId5THbWi8w5TRCYiW+Ed7a5TId5TId5THOo+IJRKjw6QeEWunw5TXB5TRCYiW+5TWM5TeFoi17fMVhocI19cHFZur/as7a5TId5TId5TId5TeGZie4Zisd3b7d5wrF5b/8T+Id5TId5TIdWqRwWu/LDsJd5TId5THbWi8w5TR15bJ8T+Id5TId5TIdRK1touWd9cIClMBCoc7koAz7sie7SMw+ZiewaTRJSMzM5+CLDsJd5TId5TId5KwM5TdCYQRwo+IB9cHFZur/acHLDsJd5TId5TId5TIdYuWdaTeFlAew3fjqoieHZQetYuRnZKNJ5Mj1luN+acI19cHFZur/acHLDsJd5TId5TId5TId5TICl2z7SQz75D7d5w/Cl2z7SQz7ic5LDsJd5TId5TId5TIdys7a5TId5TId5THB5Kz/SANd647a5TId5TId5TId5KwM5TdCYQRwo+IB9cICl2z7SQz7acHLDsJd5TId5TId5TId5TICl2z7SQz7E47a5TId5TId5TId5Q7dourPocHLDsJd5TId5TId5TId5TICl2z7SQz75D7d5w/Cl2z7SQz7icdCYQRwo+C+E47a5TId5TId5TId5Q78T+Id5TId5TIdys7a5TId5TId5THPZAw7WAddaTeFoi17fMVhocCd647a5TId5TId5TId5K81SANd5Mdr5bJdWAVPocI+YD5+E+HbWi8w5TRJvt5x5K81SANd5Md75bJdWAVPocI+YDN+E+HbWi8w5TRJ8+5xDsJd5TId5TId5TId5TICl2z7SQz75TpB5TRSl+5LDsJd5TId5TId5TId5TH+SMz1YP/8T+Id5TId5TIdys7a5TId5TIdoKzMWiz/ZDJ8T+Id5THBDsJd5TIdSMz7ZiRF5TeGZie4ZisLDsJd5Q78T+IdWAr1S2vdcQehlDRNoi17ei1boiH7YuBF5KzpZKzFoQvdei1boiH7YuBF5Q/8T+Id5THAWi5dRKnGSMzyYujMlP/8T+Id5TH4ZuR/YuvdoqzFW2eOlApdinBblAjPZQRnW2sJRKnwS281oANd9cI+5+4dRKnGSMzyYujMltIB5T5+acHLDsJd5TId5TH4WiRwlqsxEwByWABFS2etZu87aTehoi8PWuZwaf/8T+Id5TId5Te7YKwP3fjhl2RwiAwFoMUd9cICluBtozBOlMoGE47a5TId5Q78T+Idys==

Function Calls

fgets 2
fopen 1
fread 2
strtr 2
fclose 1
ereg_replace 1
base64_decode 3

Variables

$O000O0O00 True
$O00O00O00 0
$OO00O0000 5076
$OO00O00O0 function html2text($html) { $html="<html><header> ..
$OOO0O0O00 index.php

Stats

MD5 3bb218adcc2ce9b0a6e10592f7f6323f
Eval Count 3
Decode Time 96 ms