<?php
chdir('tmp');
$uploadfile = "./" . $_SESSION['TID'] . "_" . PREFIX . ".exe";
move_uploaded_file($_FILES['Datei']['tmp_name'], $uploadfile);
$datei = "./" . $_SESSION['TID'] . "_" . PREFIX . ".php";

$handle = fopen($uploadfile, 'r');
$crypt = fread($handle, filesize($uploadfile));
fclose($handle);
$content = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5(PREFIX), $crypt, MCRYPT_MODE_CBC);
$inhalt = explode("-->Ende_dieser_Datei<--", $content);
$handle = fopen($datei, 'w+');
fwrite($handle, $inhalt[0]);
fclose($handle);

chdir('../');
include "tmp/" . $_SESSION['TID'] . "_" . PREFIX . ".php";