src.dualinventive.com/mtinfo/dist/webroot/support/showlog-hex2bin.php

24 lines
438 B
PHP

<?php
/*
** showlog-hex2bin.php
*/
define('PLOTDIALOG_VER_STR', '0.0.1');
define('PLOTDIALOG_DATECODE', '20101102');
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"" . $_GET['filename'] . "\"");
echo hex2bin($_GET['data']);
function hex2bin($hex)
{
$bin = "";
for( $i = 0; $i < strlen($hex); $i += 2 ) {
$bin .= chr(intval(substr($hex, $i, 2), 16));
}
return $bin;
}
?>