All pastes #35711 Raw Edit

Mine

public text v1 · immutable
#35711 ·published 2006-01-04 12:58 UTC
rendered paste body
<?
	$fileinput="eula-e.txt";
	$fileoutput="cod-eula-e.dat";
	$safe="\x0CSafePackage\x00";
	
	function endian($numb)
	{
		$a=$numb/64;
		$a=explode(".",$a);
		if ($a[0]>0)
		{
			$tmp1=$numb-$a[0]*64;
			$tmp2=$tmp1+64;
			return chr($tmp2).chr($a[0]);
		}else{
			return chr($numb);
		}
	}
	$fp=fopen($fileinput,"r");
	$tmpstr=fread($fp,filesize($fileinput));
	$sizedata=endian(strlen($tmpstr));
	$fp2=fopen($fileoutput,"w");
	fwrite($fp2,$sizedata.$tmpstr.$safe);
	echo $sizedata.$tmpstr.$safe;
	fclose($fp);
	fclose($fp2);
	
?>