HEX-Code wieder in Ursprungs-Datei zurueckwandeln
Hallo Forum.
Mit einer PHP-Datei kann ich beliebige Dateien (im Moment noch per manuelle Eingabe in der Datei) in Hex-Code umwandeln ...
Code sieht so aus:
Jetzt möchte ich (ebenfalls mit PHP :P) wieder aus dem Hex-Code (z.B. 3c3f7068700a69662028697373657428245f4745545b) wieder in die Ursprungsdatei zurückwandeln ... muss doch möglich sein, oder nicht?
Greetz, Lousek
Mit einer PHP-Datei kann ich beliebige Dateien (im Moment noch per manuelle Eingabe in der Datei) in Hex-Code umwandeln ...
Code sieht so aus:
<?php
$infile = "div.php";
if(file_exists($infile)) {
$handle = fopen($infile, "r");
$content = fread($handle, filesize($infile));
fclose($handle);
}
$hexval = bin2hex($content);
print "$hexval";
?>
Jetzt möchte ich (ebenfalls mit PHP :P) wieder aus dem Hex-Code (z.B. 3c3f7068700a69662028697373657428245f4745545b) wieder in die Ursprungsdatei zurückwandeln ... muss doch möglich sein, oder nicht?
Greetz, Lousek
Please also mark the comments that contributed to the solution of the article
Content-Key: 89727
Url: https://administrator.de/contentid/89727
Printed on: April 23, 2024 at 16:04 o'clock
1 Comment