Location: PHPKode > projects > Ptk-forensics > ptk/lib/get_data_unit.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
include("check_session_image.php");
include("lib_commands.php");
include("loggerClass.php");
include("lib_std.php");
if (isset($_SESSION['data_token']) && strcmp($_SESSION['data_token'],$_GET['tk'])==0){
$offset = sanitize($_GET['arg1'],INT);
$sector = sanitize($_GET['arg2'],INT);
$total = sanitize($_GET['arg3'],INT);

$token = sanitize($_GET['tk'],PARANOID);
if($total=='') $total=1;
$hex_content = get_sector_content_hex($_SESSION['image_path'], $offset, $sector, $total);
$hex_content = preg_replace("/\\\n/", "<br>", $hex_content);

if($total!=1){
	$title = $sector."-".($sector+$total-1);
}else{
	$title = $sector;
}
?>
<div style="float:left">
	<button onclick="ajax_request_data_unit('get_sector_content.php?tk=<?=$token?>&arg1=<?=$offset;?>&arg2=<?=$sector;?>&arg3=<?=$total;?>&arg4=ascii', '<?=$sector;?>'); ">Ascii</button>
	<button onclick="ajax_request_data_unit('get_sector_content.php?tk=<?=$token?>&arg1=<?=$offset;?>&arg2=<?=$sector;?>&arg3=<?=$total;?>&arg4=hex', '<?=$sector;?>'); ">Hex</button>
	<button onclick="ajax_request_data_unit('get_sector_content.php?tk=<?=$token?>&arg1=<?=$offset;?>&arg2=<?=$sector;?>&arg3=<?=$total;?>&arg4=asciistrings', '<?=$sector;?>'); ">Ascii strings</button>
	<button onclick="window.location = 'export_sector.php?arg1=<?=$offset;?>&arg2=<?=$sector;?>&arg3=<?=$total;?>';">Export</button>
</div>
<div style="margin-left: 180px; float:left; text-align:center;font-weight:bold">
<img src="../img/left.png" style="cursor:pointer" onclick="addAjaxContentToTab('<?=$title;?>','get_data_unit.php?tk=<?=$token?>&arg1=<?=$offset;?>&arg2=<?=$sector-1;?>&arg3=<?=$total;?>'); changeTabTitle('<?=$title;?>','<?if($total!=1){echo ($sector-1)."-".($sector+$total-2);}else{echo $sector-1;}?>')">
&nbsp;
<?echo $title;?>
&nbsp;
<img src="../img/arrow.png" style="cursor:pointer" onclick="addAjaxContentToTab('<?=$title;?>','get_data_unit.php?tk=<?=$token?>&arg1=<?=$offset;?>&arg2=<?=$sector+1;?>&arg3=<?=$total;?>'); changeTabTitle('<?=$title;?>','<?if($total!=1){echo ($sector+1)."-".($sector+$total);}else{echo $sector+1;}?>');">
</div>

<img src='../img/progress.gif'  style="float: right; display: none;z-index: 10000000;margin-right: 10px" id="progress<?=$sector;?>">
<div id="<?=$sector;?>" class="file_content" style="width: 96%; float:left; height:96%;"><pre><?=$hex_content;?></pre></div>
<?
}else{
        new AuditLog('Unauthorized access to get_data_unit');
        header("location: goto_home.php");
}
?>

Return current item: Ptk-forensics