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 class PackLittleEndian extends Handler { use MultipleAddressMode, UnaryOperator; ..

Decoded Output download

<?php

class PackLittleEndian extends Handler {

	use MultipleAddressMode, UnaryOperator;

	public function getOperandType($i) {
		switch($i) {
			case 1: return $this->operandType;
			case 2:	return "U08";
		}
	}

	public function getOperandAddressMode($i) {
		switch($i) {
			case 1: return $this->addressMode;
			case 2: return "ARR";
		}
	}

	protected function getActionOnUnitData() {
		$cType = $this->getOperandCType(1);
		$width = substr($this->operandType, 1);
		$macro = "SWAP_LE_I{$width}";
		if($this->operandType[0] == 'F') {
			// accommodate native compiler, for which op1 might be a macro defined as a literal
			$lines = array();
			$lines[] = "$cType v = op1;";
			$lines[] = "*((uint{$width}_t *) res_ptr) = $macro(*((uint{$width}_t *) &v));";
			return $lines;
		} else {
			return "*((uint{$width}_t *) res_ptr) = $macro(op1);";
		}
	}
}

?>

Did this file decode correctly?

Original Code

<?php

class PackLittleEndian extends Handler {

	use MultipleAddressMode, UnaryOperator;

	public function getOperandType($i) {
		switch($i) {
			case 1: return $this->operandType;
			case 2:	return "U08";
		}
	}

	public function getOperandAddressMode($i) {
		switch($i) {
			case 1: return $this->addressMode;
			case 2: return "ARR";
		}
	}

	protected function getActionOnUnitData() {
		$cType = $this->getOperandCType(1);
		$width = substr($this->operandType, 1);
		$macro = "SWAP_LE_I{$width}";
		if($this->operandType[0] == 'F') {
			// accommodate native compiler, for which op1 might be a macro defined as a literal
			$lines = array();
			$lines[] = "$cType v = op1;";
			$lines[] = "*((uint{$width}_t *) res_ptr) = $macro(*((uint{$width}_t *) &v));";
			return $lines;
		} else {
			return "*((uint{$width}_t *) res_ptr) = $macro(op1);";
		}
	}
}

?>

Function Calls

None

Variables

None

Stats

MD5 bc65f213b3ce25ce58c30636ec22e00c
Eval Count 0
Decode Time 84 ms