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 $X= 'LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0..

Decoded Output download

/**
 * Our test CC module adapter
 * Mage_Payment_Model_Method_Abstract
 */
class TwentyThree_Valitor_Model_Payment extends Mage_Payment_Model_Method_Abstract
{
	/**
	 * unique internal payment method identifier
	 *
	 * @var string [a-z0-9_]
	 */
	protected $_code = 'valitor';

	protected $_isInitializeNeeded = false;
	protected $_canUseInternal = true;
	protected $_canUseForMultishipping = false;
	protected $_isGateway = true;
	protected $_canAuthorize = true;
	protected $_canUseCheckout = true;

	// Order instance
	protected $_order = null;

	public function __construct()
	{
	}
	public function getOrderPlaceRedirectUrl()
	{
		return Mage::getUrl('valitor/payment/redirect');
	}
	public function getPaymentRedirectUrl()
	{
		return Mage::getUrl('valitor/payment/redirect');
	}
	/**
	 *  Returns Target URL
	 *
	 *  @return   string Target URL
	 */
	public function getValitorUrl()
	{
		$url = $this->getConfigData('submit_url');
		return $url;
	}

	/**
	 *  Return back URL
	 *
	 *  @return   string URL
	 */
	protected function getReturnURL()
	{
		return Mage::getUrl('valitor/payment/normal', array(
			'_secure' => true
		));
	}

	/**
	 *  Return URL for Valitor success response
	 *
	 *  @return   string URL
	 */
	protected function getSuccessURL()
	{
		return Mage::getUrl('valitor/payment/success', array(
			'_secure' => true
		));
	}

	/**
	 *  Return URL for Valitor failure response
	 *
	 *  @return   string URL
	 */
	protected function getErrorURL()
	{
		return Mage::getUrl('valitor/payment/error', array(
			'_secure' => true
		));
	}

	/**
	 *  Return URL for Valitor notify response
	 *
	 *  @return   string URL
	 */
	protected function getNotifyURL()
	{
		return Mage::getUrl('valitor/payment/notify');
	}

	public function getOnlinePaymentUrl()
	{
		return Mage::getUrl('valitor/payment/redirect');
	}

	/**
	 *  Return Standard Checkout Form Fields for request to valitor
	 *  @return   array Array of hidden form fields
	 */
	public function getStandardCheckoutFormFields()
	{
		$session = Mage::getSingleton('checkout/session');
		$order   = $this->getOrder();

		if (!($order instanceof Mage_Sales_Model_Order))
		{
			Mage::throwException($this->_getHelper()->__('Cannot retrieve order object'));
		}
		
		$parameter = array(
			'Tilvisunarnumer' => $order->getRealOrderId() . '-' . time(),
			'SlodTokstAdGjaldfaeraTexti' => 'Continue', //fram
			'SlodTokstAdGjaldfaera' => $this->getSuccessURL(),
			'SlodTokstAdGjaldfaeraServerSide' => $this->getNotifyURL(),
			'SlodNotandiHaettirVid' => $this->getReturnURL(),
			'VefverslunID' => $this->getConfigData('paymentgateway_id'),
			'Oryggisnumer' => $this->getConfigData('security_number'),
			'Adeinsheimild' => $this->getConfigData('authentication'),
			'KaupandaUpplysingar' => '0',
			'Gjaldmidill' => $this->getConfigData('currency'),
			'Tunguml' => $this->getConfigData('lang'),
		);

		$myArr = $order->getAllVisibleItems();
		$oldstrLysing = 'Vara_X_Lysing';
		$oldstrFjoldi = 'Vara_X_Fjoldi';
		$oldstrVerd = 'Vara_X_Verd';
		$oldstrAfsl = 'Vara_X_Afslattur';
		$i = 1;
		$vorur = null;
		$tester = 0;
		//Vrur bnar til
		foreach($myArr as $itemId => $item) 
		{
			$newstrLysing = substr_replace($oldstrLysing, strval($i), 5, 1);
			$parameter[$newstrLysing] = $item->getName();
			$newstrFjoldi = substr_replace($oldstrFjoldi, strval($i), 5, 1);
			$parameter[$newstrFjoldi] = strval($item->getQtyToInvoice());
			$newstrVerd = substr_replace($oldstrVerd, strval($i), 5, 1);
			$parameter[$newstrVerd] = $item->getPriceInclTax();
			$newstrAfsl = substr_replace($oldstrAfsl, strval($i), 5, 1);
		//	$parameter[$newstrAfsl] = '0';
			$parameter[$newstrAfsl] = $item->getBase_discount_amount();
			$vorur .= $parameter[$newstrFjoldi] . $parameter[$newstrVerd] . $parameter[$newstrAfsl];
			$i++;
		}
		//Btum vi shipping
		if ($order->getShippingAmount() > '0') {
		$newstrLysing = substr_replace($oldstrLysing, strval($i), 5, 1);
		$parameter[$newstrLysing] = $order->getShippingDescription();
		$newstrFjoldi = substr_replace($oldstrFjoldi, strval($i), 5, 1);
		$parameter[$newstrFjoldi] = '1';
		$newstrVerd = substr_replace($oldstrVerd, strval($i), 5, 1);
		$parameter[$newstrVerd] = round($order->getShippingTaxAmount()+$order->getShippingAmount());
		$newstrAfsl = substr_replace($oldstrAfsl, strval($i), 5, 1);
		$parameter[$newstrAfsl] = '0';
		$vorur .= $parameter[$newstrFjoldi] . $parameter[$newstrVerd] . $parameter[$newstrAfsl];
		}

		$mysign     = $this->sign($parameter['Oryggisnumer'] . $parameter['Adeinsheimild'] . $vorur . $parameter['VefverslunID'] . $parameter['Tilvisunarnumer'] . $parameter['SlodTokstAdGjaldfaera'] . $parameter['SlodTokstAdGjaldfaeraServerSide'] . $parameter['Gjaldmidill']);
		//$body = implode("
", $parameter);
		//mail("[email protected]","parameter",$body);
		$fields     = array();
		$sort_array = array();
		$arg        = "";
		$sort_array = $this->arg_sort($parameter);

		while (list($key, $val) = each($sort_array))
		{
			if ($key == 'Oryggisnumer')
			{
				continue;
			}
			$fields[$key] = $val; // urlencode($this->charset_encode($val,'utf-8'));
		}
		$fields['RafraenUndirskrift'] = $mysign;

		return $fields;
	}

	public function getProductName($order)
	{
		$ret = array();
		foreach ((array) $order->getAllItems() as $item)
		{
			$ret[] = Mage::getModel('catalog/product')->load($item->getProductId())->getName();
		}
		return $ret;
	}
	public function sign($prestr)
	{

		$mysign = md5($prestr);
		return $mysign;
	}
	public function arg_sort($array)
	{
		ksort($array);
		reset($array);
		return $array;
	}
	public function charset_encode($input, $_output_charset, $_input_charset = "GBK")
	{
		$output = "";

		if ($_input_charset == $_output_charset || $input == null)
		{
			$output = $input;
		}
		elseif (function_exists("mb_convert_encoding"))
		{
			$output = mb_convert_encoding($input, $_output_charset, $_input_charset);
		}
		elseif (function_exists("iconv"))
		{
			$output = iconv($_input_charset, $_output_charset, $input);
		}
		else
		{
			die("sorry, you have no libs support for charset change.");
		}

		return $output;
	}



	/**
	 * simulate form submission
	 * @param unknown_type $URL
	 * @param unknown_type $post_data
	 * @param unknown_type $referrer
	 */
	public static function posturl($URL, $post_data, $referrer = "")
	{
		$URL_Info = parse_url($URL);
		// Building referrer
		if ($referrer == "") // if not given use this script as referrer
			$referrer = $_SERVER["SCRIPT_URI"];

		// making string from $data
		foreach ($post_data as $key => $value)
			$values[] = "$key=" . urlencode($value);

		$data_string = implode("&", $values);
		// Find out which port is needed - if not given use standard (=80)
		if (!isset($URL_Info["port"]))
			$URL_Info["port"] = 80;
		// building POST-request:
		$request .= "POST " . $URL_Info["path"] . " HTTP/1.1
";
		$request .= "Host: " . $URL_Info["host"] . "
";
		$request .= "Referer: $referrer
";
		$request .= "Content-type: application/x-www-form-urlencoded
";
		$request .= "Content-length: " . strlen($data_string) . "
";
		$request .= "Connection: close
";
		$request .= "
";
		$request .= $data_string . "
";
		$fp = fsockopen($URL_Info["host"], $URL_Info["port"]);
		fputs($fp, $request);
		while (!feof($fp))
		{
			$result .= fgets($fp, 128);
		}
		fclose($fp);
		$result = substr($result, strpos($result, "

"));
		return trim($result);
	}

	public function getCurrentUrl()
	{
		$pageURL = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
		if ($_SERVER["SERVER_PORT"] != "80")
		{
			$pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
		}
		else
		{
			$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
		}
		return $pageURL;
	}


}

Did this file decode correctly?

Original Code

<?php $X= 'LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgkJCQkJCUF1dGhvcjogICAgIEFiZHVsIFJhaG1hbiBTaGVyemFkICh3d3cuYWZnaGFuY3liZXJzb2Z0LmNvbSkKCQkJ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sewtNX1F6EiJ9Nr1b8Lug5VLd30imcJwXc0aISgi4k4MD2zf8TZvesZVb3Ahf1nTzvLRymIJqxh1blcBIgUXHac/vV1UOtZdY8lk+qoTt+PxrvuAe/A9Rn7mgdDXoC7BO320aieBzi4BOTNeHza29/bh4Hk8A7vG/DwQZ15DouWuZFniMfM5MEqCBvJ8A2KZXoXQ/6A0KIQ7nmk93H35uZmFxNud3lUyVYMIJrpuVUUzg9+hv5hdjbqCgAZM8l0QGKRK9ZI1bS4Fiw+/LTAP7ipPL7KC9Sj7rcuuXvadhKAKqRC4DfpawTZDTdrPZqyfIr7nfUhQJXCaDSFPu7497975hXPqbHMcFZmGJ7qehG6BXOlgJxa/Q5+gbPD/4POWoMFq9OKavvj9rF5mlp/1oZpcsbwwb5PwuerSoCBOMIQB4/nIJH8kQRzrQt10OsF5MD+wO+Hq067rCLmMzp9PxwDwiNAePY08N1Uidxbqz2W693R2xMbzwcm0jeg+jvDk5/PTkarstXYpr5M6GdBqz7l0LxG9enhfwE=')));?>

Function Calls

gzinflate 1
base64_decode 1

Variables

$X LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t..

Stats

MD5 2d37e072fa2b8f4b562831fbba96fb19
Eval Count 1
Decode Time 107 ms